Re: [PATCH -next] arch/x86: Return value from notify_die should to be checked.

2020-06-22 Thread Bo YU
On Mon, Jun 22, 2020 at 5:46 PM Peter Zijlstra  wrote:
>
> On Mon, Jun 22, 2020 at 11:17:51AM +0200, Boris Petkov wrote:
> > On June 22, 2020 10:52:23 AM GMT+02:00, Alexandre Chartre 
> >  wrote:
> > > So the appropriate change to make Coverity happy
> >
> > Or we can stop "fixing" the kernel in order to shut up tools and not do 
> > anything.
>
> Agreed, no change required here.
Ok, thanks for everyone.


Re: [PATCH] arch/x86: Check return value from a notify_die() call

2020-06-21 Thread Bo YU
On Sun, Jun 21, 2020 at 10:40 PM Markus Elfring  wrote:
>
> I propose to improve the previous patch subject.
>
>
> > This is detected by Coverity scan: #CID: 1464472(CHECKED_RETURN)
> >
> > FIXES: c94082656dac7(x86: Use enum instead of literals for trap values)
>
> Is the following tag specification more appropriate?
>
> Fixes: c94082656dac7 ("x86: Use enum instead of literals for trap values")
Your description looks like more appropriate, thank you.
But I want to receive suggestions from other reviewers also. So I will
send V2 patch as your point
once got confirmed. Sorry.
>
> Regards,
> Markus


[PATCH -next] arch/x86: Return value from notify_die should to be checked.

2020-06-21 Thread Bo YU

This is detected by Coverity scan: #CID: 1464472(CHECKED_RETURN)

FIXES: c94082656dac7(x86: Use enum instead of literals for trap values)
Signed-off-by: Bo YU 
---
arch/x86/kernel/traps.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index af75109485c2..bf014fb59017 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -401,7 +401,8 @@ DEFINE_IDTENTRY_DF(exc_double_fault)

nmi_enter();
instrumentation_begin();
-   notify_die(DIE_TRAP, str, regs, error_code, X86_TRAP_DF, SIGSEGV);
+   if (notify_die(DIE_TRAP, str, regs, error_code, X86_TRAP_DF, SIGSEGV))
+   return;

tsk->thread.error_code = error_code;
tsk->thread.trap_nr = X86_TRAP_DF;
--
2.11.0



[PATCH -next] RDMA/rtrs: fix potential resources leaks

2020-06-19 Thread Bo YU

Dev is returned from allocation function kzalloc but it does not
free it in out_err path.

Detected by CoverityScan, CID# 1464569: (Resource leak)

Fixes: c0894b3ea69d3("RDMA/rtrs: core: lib functions shared between client and 
server modules")
Signed-off-by: Bo YU 
---
drivers/infiniband/ulp/rtrs/rtrs.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/ulp/rtrs/rtrs.c 
b/drivers/infiniband/ulp/rtrs/rtrs.c
index ff1093d6e4bc..03bdab92fa49 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs.c
@@ -607,6 +607,7 @@ rtrs_ib_dev_find_or_add(struct ib_device *ib_dev,
else
kfree(dev);
out_err:
+   kfree(dev);
return NULL;
}
EXPORT_SYMBOL(rtrs_ib_dev_find_or_add);
--
2.11.0



Re: [PATCH 5.4 020/142] tipc: block BH before using dst_cache

2020-06-01 Thread Bo YU
On Tue, Jun 2, 2020 at 2:08 AM Greg Kroah-Hartman
 wrote:
>
> From: Eric Dumazet 
>
> [ Upstream commit 1378817486d6860f6a927f573491afe65287abf1 ]
>
> dst_cache_get() documents it must be used with BH disabled.
>
> sysbot reported :

syzbot?

>
> BUG: using smp_processor_id() in preemptible [] code: /21697
> caller is dst_cache_get+0x3a/0xb0 net/core/dst_cache.c:68
> CPU: 0 PID: 21697 Comm:  Not tainted 5.7.0-rc6-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS 
> Google 01/01/2011
> Call Trace:
>  __dump_stack lib/dump_stack.c:77 [inline]
>  dump_stack+0x188/0x20d lib/dump_stack.c:118
>  check_preemption_disabled lib/smp_processor_id.c:47 [inline]
>  debug_smp_processor_id.cold+0x88/0x9b lib/smp_processor_id.c:57
>  dst_cache_get+0x3a/0xb0 net/core/dst_cache.c:68
>  tipc_udp_xmit.isra.0+0xb9/0xad0 net/tipc/udp_media.c:164
>  tipc_udp_send_msg+0x3e6/0x490 net/tipc/udp_media.c:244
>  tipc_bearer_xmit_skb+0x1de/0x3f0 net/tipc/bearer.c:526
>  tipc_enable_bearer+0xb2f/0xd60 net/tipc/bearer.c:331
>  __tipc_nl_bearer_enable+0x2bf/0x390 net/tipc/bearer.c:995
>  tipc_nl_bearer_enable+0x1e/0x30 net/tipc/bearer.c:1003
>  genl_family_rcv_msg_doit net/netlink/genetlink.c:673 [inline]
>  genl_family_rcv_msg net/netlink/genetlink.c:718 [inline]
>  genl_rcv_msg+0x627/0xdf0 net/netlink/genetlink.c:735
>  netlink_rcv_skb+0x15a/0x410 net/netlink/af_netlink.c:2469
>  genl_rcv+0x24/0x40 net/netlink/genetlink.c:746
>  netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
>  netlink_unicast+0x537/0x740 net/netlink/af_netlink.c:1329
>  netlink_sendmsg+0x882/0xe10 net/netlink/af_netlink.c:1918
>  sock_sendmsg_nosec net/socket.c:652 [inline]
>  sock_sendmsg+0xcf/0x120 net/socket.c:672
>  sys_sendmsg+0x6bf/0x7e0 net/socket.c:2362
>  ___sys_sendmsg+0x100/0x170 net/socket.c:2416
>  __sys_sendmsg+0xec/0x1b0 net/socket.c:2449
>  do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295
>  entry_SYSCALL_64_after_hwframe+0x49/0xb3
> RIP: 0033:0x45ca29
>
> Fixes: e9c1a793210f ("tipc: add dst_cache support for udp media")
> Cc: Xin Long 
> Cc: Jon Maloy 
> Signed-off-by: Eric Dumazet 
> Reported-by: syzbot 
> Signed-off-by: David S. Miller 
> Signed-off-by: Greg Kroah-Hartman 
> ---
>  net/tipc/udp_media.c |6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> --- a/net/tipc/udp_media.c
> +++ b/net/tipc/udp_media.c
> @@ -161,9 +161,11 @@ static int tipc_udp_xmit(struct net *net
>  struct udp_bearer *ub, struct udp_media_addr *src,
>  struct udp_media_addr *dst, struct dst_cache *cache)
>  {
> -   struct dst_entry *ndst = dst_cache_get(cache);
> +   struct dst_entry *ndst;
> int ttl, err = 0;
>
> +   local_bh_disable();
> +   ndst = dst_cache_get(cache);
> if (dst->proto == htons(ETH_P_IP)) {
> struct rtable *rt = (struct rtable *)ndst;
>
> @@ -210,9 +212,11 @@ static int tipc_udp_xmit(struct net *net
>src->port, dst->port, false);
>  #endif
> }
> +   local_bh_enable();
> return err;
>
>  tx_error:
> +   local_bh_enable();
> kfree_skb(skb);
> return err;
>  }
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "syzkaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to syzkaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/syzkaller/20200601174039.942780034%40linuxfoundation.org.


Re: [PATCH -next] fs/btrfs: Fix unlocking in btrfs_ref_tree_mod

2020-05-15 Thread Bo YU
On Fri, May 15, 2020 at 5:36 PM Johannes Thumshirn
 wrote:
>
> On 15/05/2020 11:24, Bo YU wrote:
> > Hi,
> > On Fri, May 15, 2020 at 5:03 PM Johannes Thumshirn
> >  wrote:
> >>
> >> On 15/05/2020 04:17, Bo YU wrote:
> >>> It adds spin_lock() in add_block_entry() but out path does not unlock
> >>> it.
> >>
> >> Which call path doesn't unlock it? There is an out_unlock label with a
> >> spin_unlock() right above your insert. So either coverity messed something
> >> up or the call path that needs the unlock has to jump to out_unlock instead
> >> of out.
> > This is out label without unlocking it. It will be offered spin_lock
> > in add_block_entry()
> > for be. But here I was worried about that unlock it in if() whether it
> > is right or not.
> >
>
> No add_block_entry() returns with the ref_verify_lock held on success only:
> static struct block_entry *add_block_entry(struct btrfs_fs_info *fs_info,
>u64 bytenr, u64 len,
>u64 root_objectid)
> {
> struct block_entry *be = NULL, *exist;
> struct root_entry *re = NULL;
>
> re = kzalloc(sizeof(struct root_entry), GFP_KERNEL);
> be = kzalloc(sizeof(struct block_entry), GFP_KERNEL);
> if (!be || !re) {
> kfree(re);
> kfree(be);
> return ERR_PTR(-ENOMEM);
> }
> be->bytenr = bytenr;
> be->len = len;
>
> re->root_objectid = root_objectid;
> re->num_refs = 0;
>
> spin_lock(_info->ref_verify_lock);
> [...]
>
>
> While the code caller checks for an error:
>
> if (action == BTRFS_ADD_DELAYED_EXTENT) {
> /*
>  * For subvol_create we'll just pass in whatever the parent 
> root
>  * is and the new root objectid, so let's not treat the passed
>  * in root as if it really has a ref for this bytenr.
>  */
> be = add_block_entry(fs_info, bytenr, num_bytes, ref_root);
> if (IS_ERR(be)) {
> kfree(ref);
> kfree(ra);
> ret = PTR_ERR(be);
> goto out;
> }
>
> So if add_block_entry returns -ENOMEM it didn't take the lock and thus no 
> unlock
> is needed.
Ok,  I got it. Please drop it.
Thank you!
>
> Or did I miss something?


Re: [PATCH -next] fs/btrfs: Fix unlocking in btrfs_ref_tree_mod

2020-05-15 Thread Bo YU
Hi,
On Fri, May 15, 2020 at 5:03 PM Johannes Thumshirn
 wrote:
>
> On 15/05/2020 04:17, Bo YU wrote:
> > It adds spin_lock() in add_block_entry() but out path does not unlock
> > it.
>
> Which call path doesn't unlock it? There is an out_unlock label with a
> spin_unlock() right above your insert. So either coverity messed something
> up or the call path that needs the unlock has to jump to out_unlock instead
> of out.
This is out label without unlocking it. It will be offered spin_lock
in add_block_entry()
for be. But here I was worried about that unlock it in if() whether it
is right or not.


[PATCH -next] fs/btrfs: Fix unlocking in btrfs_ref_tree_mod

2020-05-14 Thread Bo YU

It adds spin_lock() in add_block_entry() but out path does not unlock
it.

Detected by CoversityScan, CID# 1463343:(Missing unlock)

Fixes: fd708b81d972a (Btrfs: add a extent ref verify tool)
Signed-off-by: Bo YU 
---
fs/btrfs/ref-verify.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c
index 7887317033c9..8f644511006d 100644
--- a/fs/btrfs/ref-verify.c
+++ b/fs/btrfs/ref-verify.c
@@ -894,8 +894,10 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info,
out_unlock:
spin_unlock(_info->ref_verify_lock);
out:
-   if (ret)
+   if (ret) {
+   spin_unlock(_info->ref_verify_lock);
btrfs_clear_opt(fs_info->mount_opt, REF_VERIFY);
+   }
return ret;
}

--
2.11.0



Re: [PATCH -next] block/genhd: align title and output

2020-04-29 Thread Bo YU
On Sun, Apr 26, 2020 at 8:22 PM Bo YU  wrote:
>
> Before the patch:
>
> major minor  #blocks  name
>
>  2540   57671680 vda
>  2541   57670656 vda1
>
> After the patch:
>
> major minor   #blocksname
>
> 254   0   57671680   vda
> 254   1   57670656   vda1
>
> According to LDD3,major device maximun number is 12 bit,as it has 4 char
> placeholders.minor device maximum number is 20 bit(7 char palceholders)
> and keeping 10 char palceholders for blocks tag.If want to keep
> palceholder's numbers dynamiclly, There is more tricks to do that.  So i
> keep it simple.
>
> Signed-off-by: Bo YU 
> ---
>  block/genhd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/block/genhd.c b/block/genhd.c
> index 06b642b23a07..63a483cf76b9 100644
> --- a/block/genhd.c
> +++ b/block/genhd.c
> @@ -1151,7 +1151,7 @@ static void *show_partition_start(struct seq_file 
> *seqf, loff_t *pos)
>
> p = disk_seqf_start(seqf, pos);
> if (!IS_ERR_OR_NULL(p) && !*pos)
> -   seq_puts(seqf, "major minor  #blocks  name\n\n");
> +   seq_puts(seqf, "major minor   #blocksname\n\n");
> return p;
>  }
>
> @@ -1172,7 +1172,7 @@ static int show_partition(struct seq_file *seqf, void 
> *v)
> /* show the full disk and all non-0 size partitions of it */
> disk_part_iter_init(, sgp, DISK_PITER_INCL_PART0);
> while ((part = disk_part_iter_next()))
> -   seq_printf(seqf, "%4d  %7d %10llu %s\n",
> +   seq_printf(seqf, "%-4d  %-7d %-10llu %s\n",
>MAJOR(part_devt(part)), MINOR(part_devt(part)),
>(unsigned long long)part_nr_sects_read(part) >> 1,
>disk_name(sgp, part->partno, buf));
> --
> 2.11.0
>
Sorry, Ping again


[tip:perf/urgent] perf bpf: Return value with unlocking in perf_env__find_btf()

2019-05-02 Thread tip-bot for Bo YU
Commit-ID:  2e712675ffd1331bb527dfc851b0e98cd684c2f1
Gitweb: https://git.kernel.org/tip/2e712675ffd1331bb527dfc851b0e98cd684c2f1
Author: Bo YU 
AuthorDate: Mon, 22 Apr 2019 04:01:38 -0400
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Thu, 2 May 2019 16:00:19 -0400

perf bpf: Return value with unlocking in perf_env__find_btf()

In perf_env__find_btf(), we're returning without unlocking
"env->bpf_progs.lock". There may be cause lockdep issue.

Detected by CoversityScan, CID# 1444762:(program hangs(LOCK))

Signed-off-by: Bo YU 
Acked-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Alexander Shishkin 
Cc: Alexei Starovoitov 
Cc: Daniel Borkmann 
Cc: Martin KaFai Lau 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Song Liu 
Cc: Yonghong Song 
Cc: b...@vger.kernel.org
Cc: net...@vger.kernel.org
Fixes: 2db7b1e0bd49d: (perf bpf: Return NULL when RB tree lookup fails in 
perf_env__find_btf())
Link: http://lkml.kernel.org/r/20190422080138.10088-1-tsu.y...@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/env.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
index 9494f9dc61ec..6a3eaf7d9353 100644
--- a/tools/perf/util/env.c
+++ b/tools/perf/util/env.c
@@ -115,8 +115,8 @@ struct btf_node *perf_env__find_btf(struct perf_env *env, 
__u32 btf_id)
}
node = NULL;
 
-   up_read(>bpf_progs.lock);
 out:
+   up_read(>bpf_progs.lock);
return node;
 }
 


Re: [PATCH] staging: most: protect potential string overflow

2019-04-25 Thread Bo YU
On Wed, Apr 24, 2019 at 10:55 PM Dan Carpenter  wrote:
>
> On Mon, Apr 22, 2019 at 10:20:18PM -0400, Bo YU wrote:
> > There maybe cause potential string overflow issue due to use
> > strcpy without checking the length
> >
> > Detected By CoversityScan CID# 1444760
> >
> > Fixes: 131ac62253dba:(staging: most: core: use device description as name)
>
> It doesn't really fix anything, it just silences a static checker
> warning.
>
> > Signed-off-by: Bo YU 
> > ---
> >  drivers/staging/most/core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
> > index 956daf8c3bd2..0f26cebac91a 100644
> > --- a/drivers/staging/most/core.c
> > +++ b/drivers/staging/most/core.c
> > @@ -1431,7 +1431,7 @@ int most_register_interface(struct most_interface 
> > *iface)
> >
> >   INIT_LIST_HEAD(>p->channel_list);
> >   iface->p->dev_id = id;
> > - strcpy(iface->p->name, iface->description);
> > + strlcpy(iface->p->name, iface->description, sizeof(iface->p->name));
>
> We prefer strscpy() more than strlcpy() these days.

 Ok,will try it.
 Thanks,

>
> regards,
> dan carpenter
>


[PATCH] staging: most: protect potential string overflow

2019-04-22 Thread Bo YU
There maybe cause potential string overflow issue due to use
strcpy without checking the length

Detected By CoversityScan CID# 1444760

Fixes: 131ac62253dba:(staging: most: core: use device description as name)
Signed-off-by: Bo YU 
---
 drivers/staging/most/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
index 956daf8c3bd2..0f26cebac91a 100644
--- a/drivers/staging/most/core.c
+++ b/drivers/staging/most/core.c
@@ -1431,7 +1431,7 @@ int most_register_interface(struct most_interface *iface)
 
INIT_LIST_HEAD(>p->channel_list);
iface->p->dev_id = id;
-   strcpy(iface->p->name, iface->description);
+   strlcpy(iface->p->name, iface->description, sizeof(iface->p->name));
iface->dev.init_name = iface->p->name;
iface->dev.bus = 
iface->dev.parent = 
-- 
2.11.0



[PATCH] bpf:sample: fix field 'lock' has incomplete type in hbm.h

2019-04-04 Thread Bo YU

When compiling sample/bpf:

samples/bpf/hbm.h:12:23: error: field ‘lock’ has incomplete type
 struct bpf_spin_lock lock;

Fixes: 187d0738ff35(bpf: Sample HBM BPF program to limit egress bw)
Signed-off-by: Bo YU 
---
samples/bpf/hbm.h  | 2 +-
samples/bpf/hbm_out_kern.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/samples/bpf/hbm.h b/samples/bpf/hbm.h
index 518e8147d084..7ce18cb9e365 100644
--- a/samples/bpf/hbm.h
+++ b/samples/bpf/hbm.h
@@ -9,7 +9,7 @@
 * Include file for Host Bandwidth Management (HBM) programs
 */
struct hbm_vqueue {
-   struct bpf_spin_lock lock;
+   struct bpf_spin_lock *lock;
/* 4 byte hole */
unsigned long long lasttime;/* In ns */
int credit; /* In bytes */
diff --git a/samples/bpf/hbm_out_kern.c b/samples/bpf/hbm_out_kern.c
index f806863d0b79..04c4f3d6ab9a 100644
--- a/samples/bpf/hbm_out_kern.c
+++ b/samples/bpf/hbm_out_kern.c
@@ -90,7 +90,7 @@ int _hbm_out_cg(struct __sk_buff *skb)
curtime = bpf_ktime_get_ns();

// Begin critical section
-   bpf_spin_lock(>lock);
+   bpf_spin_lock(qdp->lock);
credit = qdp->credit;
delta = curtime - qdp->lasttime;
/* delta < 0 implies that another process with a curtime greater
@@ -105,7 +105,7 @@ int _hbm_out_cg(struct __sk_buff *skb)
}
credit -= len;
qdp->credit = credit;
-   bpf_spin_unlock(>lock);
+   bpf_spin_unlock(qdp->lock);
// End critical section

// Check if we should update rate
--
2.11.0



Re: linux-next: manual merge of the char-misc tree with the char-misc.current tree

2019-04-03 Thread Bo YU
On Wed, Apr 3, 2019 at 1:07 PM Srinivas Kandagatla
 wrote:
>
>
> On 03/04/2019 04:56, Stephen Rothwell wrote:
> > Hi all,
> >
> > Today's linux-next merge of the char-misc tree got a conflict in:
> >
> >drivers/misc/fastrpc.c
> >
> > between commit:
> >
> >01b76c32e3f3 ("misc: fastrpc: add checked value for dma_set_mask")
> >
> > from the char-misc.current tree and commit:
> >
> >977e6c8d1d18 ("misc: fastrpc: use correct spinlock variant")
> >
> > from the char-misc tree.
> >
> > I fixed it up (see below) and can carry the fix as necessary. This
> > is now fixed as far as linux-next is concerned, but any non trivial
> Greg did request Bo YU to rebase this patch on top of char-misc tree.
 Yes.The patch was v2 after rebasing char-misc tree.
>
> That would be a real fix for this conflict, until then this fixup should
> work.
Is there any modifies need me?
Anyway thank everyone!
>
> --srini
> > conflicts should be mentioned to your upstream maintainer when your tree
> > is submitted for merging.  You may also want to consider cooperating
> > with the maintainer of the conflicting tree to minimise any particularly
> > complex conflicts.
> >


[PATCH V2] misc: fastrpc: add checked value for dma_set_mask

2019-03-28 Thread Bo YU
There be should check return value from dma_set_mask to throw some info
if fail to set dma mask.

Detected by CoverityScan, CID# 1443983:  Error handling issues (CHECKED_RETURN)

Fixes:f6f9279f2bf0 (misc: fastrpc: Add Qualcomm fastrpc basic driver model)
Signed-off-by: Bo YU 
---
V2: rebase misc tree
---
 drivers/misc/fastrpc.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 39f832d27288..36d0d5c9cfba 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -1184,6 +1184,7 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
struct fastrpc_session_ctx *sess;
struct device *dev = >dev;
int i, sessions = 0;
+   int rc;

cctx = dev_get_drvdata(dev->parent);
if (!cctx)
@@ -1213,7 +1214,11 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
}
cctx->sesscount++;
spin_unlock(>lock);
-   dma_set_mask(dev, DMA_BIT_MASK(32));
+   rc = dma_set_mask(dev, DMA_BIT_MASK(32));
+   if (rc) {
+   dev_err(dev, "32-bit DMA enable failed\n");
+   return rc;
+   }

return 0;
 }
--
2.11.0



Re: [PATCH] misc/fastrpc: add checked value for dma_set_mask

2019-03-27 Thread Bo YU
On Thu, Mar 28, 2019 at 2:29 AM Greg KH  wrote:
>
> On Mon, Mar 18, 2019 at 10:05:19PM -0400, Bo YU wrote:
> > There be should check return value from dma_set_mask to throw some infos
> > if fail to set dma mask.
> >
> > Detected by CoverityScan, CID# 1443983:  Error handling issues 
> > (CHECKED_RETURN)
> >
> > Fixes:f6f9279f2bf0 (misc: fastrpc: Add Qualcomm fastrpc basic driver model)
> > Signed-off-by: Bo YU 
> > ---
> >  drivers/misc/fastrpc.c | 7 ++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
>
> This patch no longer applies to my tree due to other fastrpc fixes being
> sent before your patch :(
>
> Please rebase and resend.
Ok, will do.
Thank you.
>
> thanks,
> greg k-h


Re: [PATCH] misc/fastrpc: add checked value for dma_set_mask

2019-03-21 Thread Bo YU
On Thu, Mar 21, 2019 at 5:56 PM Kroah-Hartman
 wrote:
>
> On Thu, Mar 21, 2019 at 05:31:51PM +0800, Bo YU wrote:
> > On Tue, Mar 19, 2019 at 10:05 AM Bo YU  wrote:
> > >
> > > There be should check return value from dma_set_mask to throw some infos
> > > if fail to set dma mask.
> > >
> > > Detected by CoverityScan, CID# 1443983:  Error handling issues 
> > > (CHECKED_RETURN)
> > >
> > > Fixes:f6f9279f2bf0 (misc: fastrpc: Add Qualcomm fastrpc basic driver 
> > > model)
> > > Signed-off-by: Bo YU 
> > > ---
> > >  drivers/misc/fastrpc.c | 7 ++-
> > >  1 file changed, 6 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> > > index 39f832d27288..36d0d5c9cfba 100644
> > > --- a/drivers/misc/fastrpc.c
> > > +++ b/drivers/misc/fastrpc.c
> > > @@ -1184,6 +1184,7 @@ static int fastrpc_cb_probe(struct platform_device 
> > > *pdev)
> > > struct fastrpc_session_ctx *sess;
> > > struct device *dev = >dev;
> > > int i, sessions = 0;
> > > +   int rc;
> > >
> > > cctx = dev_get_drvdata(dev->parent);
> > > if (!cctx)
> > > @@ -1213,7 +1214,11 @@ static int fastrpc_cb_probe(struct platform_device 
> > > *pdev)
> > > }
> > > cctx->sesscount++;
> > > spin_unlock(>lock);
> > > -   dma_set_mask(dev, DMA_BIT_MASK(32));
> > > +   rc = dma_set_mask(dev, DMA_BIT_MASK(32));
> > > +   if (rc) {
> > > +   dev_err(dev, "32-bit DMA enable failed\n");
> > > +   return rc;
> > > +   }
> > >
> > Ping?
> > Do me need resend it?
>
> 2 days?  Please give us time to catch up on patches, right after the
> merge window closed.  This isn't a big deal, we have much higher
> priority patches to review.  It will be gotten to eventually :)
Ok, thank you. I am not sure the trival patch is ok so disturb you :)
>
> thanks,
>
> greg k-h


Re: [PATCH] misc/fastrpc: add checked value for dma_set_mask

2019-03-21 Thread Bo YU
On Tue, Mar 19, 2019 at 10:05 AM Bo YU  wrote:
>
> There be should check return value from dma_set_mask to throw some infos
> if fail to set dma mask.
>
> Detected by CoverityScan, CID# 1443983:  Error handling issues 
> (CHECKED_RETURN)
>
> Fixes:f6f9279f2bf0 (misc: fastrpc: Add Qualcomm fastrpc basic driver model)
> Signed-off-by: Bo YU 
> ---
>  drivers/misc/fastrpc.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> index 39f832d27288..36d0d5c9cfba 100644
> --- a/drivers/misc/fastrpc.c
> +++ b/drivers/misc/fastrpc.c
> @@ -1184,6 +1184,7 @@ static int fastrpc_cb_probe(struct platform_device 
> *pdev)
> struct fastrpc_session_ctx *sess;
> struct device *dev = >dev;
> int i, sessions = 0;
> +   int rc;
>
> cctx = dev_get_drvdata(dev->parent);
> if (!cctx)
> @@ -1213,7 +1214,11 @@ static int fastrpc_cb_probe(struct platform_device 
> *pdev)
> }
> cctx->sesscount++;
> spin_unlock(>lock);
> -   dma_set_mask(dev, DMA_BIT_MASK(32));
> +   rc = dma_set_mask(dev, DMA_BIT_MASK(32));
> +   if (rc) {
> +   dev_err(dev, "32-bit DMA enable failed\n");
> +   return rc;
> +   }
>
Ping?
Do me need resend it?
> return 0;
>  }
> --
> 2.11.0
>


[PATCH] misc/fastrpc: add checked value for dma_set_mask

2019-03-18 Thread Bo YU
There be should check return value from dma_set_mask to throw some infos
if fail to set dma mask.

Detected by CoverityScan, CID# 1443983:  Error handling issues (CHECKED_RETURN)

Fixes:f6f9279f2bf0 (misc: fastrpc: Add Qualcomm fastrpc basic driver model)
Signed-off-by: Bo YU 
---
 drivers/misc/fastrpc.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 39f832d27288..36d0d5c9cfba 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -1184,6 +1184,7 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
struct fastrpc_session_ctx *sess;
struct device *dev = >dev;
int i, sessions = 0;
+   int rc;
 
cctx = dev_get_drvdata(dev->parent);
if (!cctx)
@@ -1213,7 +1214,11 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
}
cctx->sesscount++;
spin_unlock(>lock);
-   dma_set_mask(dev, DMA_BIT_MASK(32));
+   rc = dma_set_mask(dev, DMA_BIT_MASK(32));
+   if (rc) {
+   dev_err(dev, "32-bit DMA enable failed\n");
+   return rc;
+   }
 
return 0;
 }
-- 
2.11.0



Re: [PATCH 2/2] net: bonding: fix incorrect type in assignment

2019-03-08 Thread Bo YU
On Fri, Mar 8, 2019 at 2:51 PM Jay Vosburgh  wrote:
>
> Bo YU  wrote:
>
> >There are some warning when:
> >
> >sudo make C=1 CF=-D__CHECK_ENDIAN__ drivers/net/bonding/
> >
> >drivers/net/bonding/bond_main.c:2438:40: warning: incorrect type in 
> >assignment (different base types)
> >drivers/net/bonding/bond_main.c:2438:40:expected restricted __be16 
> >[usertype] vlan_proto
> >drivers/net/bonding/bond_main.c:2438:40:
> >...
> >rivers/net/bonding/bond_options.c:1089:24: warning: incorrect type in 
> >assignment (different base types)
> >drivers/net/bonding/bond_options.c:1089:24:expected restricted __be32 
> >[addressable] [usertype] target
> >drivers/net/bonding/bond_options.c:1089:24:got unsigned long long const 
> >[usertype] value
> >
> >So fix it
> >
> >Signed-off-by: Bo YU 
> >---
> > drivers/net/bonding/bond_main.c| 2 +-
> > drivers/net/bonding/bond_options.c | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> >diff --git a/drivers/net/bonding/bond_main.c 
> >b/drivers/net/bonding/bond_main.c
> >index 135fec28daa9..07e52d863e91 100644
> >--- a/drivers/net/bonding/bond_main.c
> >+++ b/drivers/net/bonding/bond_main.c
> >@@ -2435,7 +2435,7 @@ struct bond_vlan_tag *bond_verify_device_path(struct 
> >net_device *start_dev,
> >   tags = kcalloc(level + 1, sizeof(*tags), GFP_ATOMIC);
> >   if (!tags)
> >   return ERR_PTR(-ENOMEM);
> >-  tags[level].vlan_proto = VLAN_N_VID;
> >+  tags[level].vlan_proto = cpu_to_be16(VLAN_N_VID);
> >   return tags;
> >   }
> >
> >diff --git a/drivers/net/bonding/bond_options.c 
> >b/drivers/net/bonding/bond_options.c
> >index da1fc17295d9..3a196999bd1b 100644
> >--- a/drivers/net/bonding/bond_options.c
> >+++ b/drivers/net/bonding/bond_options.c
> >@@ -1086,7 +1086,7 @@ static int bond_option_arp_ip_targets_set(struct 
> >bonding *bond,
> >   else
> >   netdev_err(bond->dev, "no command found in 
> > arp_ip_targets file - use + or -\n");
> >   } else {
> >-  target = newval->value;
> >+  target = cpu_to_be32(newval->value);
> >   ret = bond_option_arp_ip_target_add(bond, target);
>
> I'm not sure this is correct; if I'm reading the call path
> correctly, bond_changelink will
>
> if (data[IFLA_BOND_ARP_IP_TARGET]) {
> [...]
> __be32 target;
> [...]
> target = nla_get_be32(attr);
>
> bond_opt_initval(, (__force u64)target);
> err = __bond_opt_set(bond, BOND_OPT_ARP_TARGETS,
>  );
>
> thus, newval.value is initially be32, but stored in a u64.
> __bond_opt_set will call bond_opt_parse, which in turn will call
> bond_option_arp_ip_targets_set (via .set), and the change above would
> swap the newval.value back to host order (on little endian architectures
> for which cpu_to_be32 is not a no-op).
>
> Am I misunderstanding?  Did you test this change on an x86 or
> other little endian system?
Hi,
After above patch:
I have enable BONDING config in .config and dmesg:

[0.247417] Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

I don't have the HW, so just add printfk in  bond_option_arp_ip_targets_set
However, i don't get what i want to print.
I do the test in qemu-system-x86_64.
I do not know how to hit the driver maybe.
So, not confirmed :(
>
> -J
>
> ---
> -Jay Vosburgh, jay.vosbu...@canonical.com


[PATCH V3] bpf: fix warning about using plain integer as NULL

2019-03-07 Thread Bo YU
Sparse warning below:

sudo make C=2 CF=-D__CHECK_ENDIAN__ M=net/bpf/
CHECK   net/bpf//test_run.c
net/bpf//test_run.c:19:77: warning: Using plain integer as NULL pointer
./include/linux/bpf-cgroup.h:295:77: warning: Using plain integer as NULL 
pointer

Fixes: 8bad74f9840f ("bpf: extend cgroup bpf core to allow multiple cgroup 
storage types")
Acked-by: Yonghong Song 
Signed-off-by: Bo YU 
---
V3: put fix tag all in a line
V2: Add fix-up tag from Yonghong
---
 include/linux/bpf-cgroup.h | 2 +-
 net/bpf/test_run.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h
index 695b2a880d9a..a4c644c1c091 100644
--- a/include/linux/bpf-cgroup.h
+++ b/include/linux/bpf-cgroup.h
@@ -292,7 +292,7 @@ static inline int bpf_cgroup_storage_assign(struct bpf_prog 
*prog,
 static inline void bpf_cgroup_storage_release(struct bpf_prog *prog,
  struct bpf_map *map) {}
 static inline struct bpf_cgroup_storage *bpf_cgroup_storage_alloc(
-   struct bpf_prog *prog, enum bpf_cgroup_storage_type stype) { return 0; }
+   struct bpf_prog *prog, enum bpf_cgroup_storage_type stype) { return 
NULL; }
 static inline void bpf_cgroup_storage_free(
struct bpf_cgroup_storage *storage) {}
 static inline int bpf_percpu_cgroup_storage_copy(struct bpf_map *map, void 
*key,
diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
index da7051d62727..fab142b796ef 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -16,7 +16,7 @@
 static int bpf_test_run(struct bpf_prog *prog, void *ctx, u32 repeat,
u32 *retval, u32 *time)
 {
-   struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE] = { 0 };
+   struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE] = { 
NULL };
enum bpf_cgroup_storage_type stype;
u64 time_start, time_spent = 0;
int ret = 0;
-- 
2.11.0



[PATCH V2] bpf: fix warning about using plain integer as NULL

2019-03-07 Thread Bo YU
Sparse warning below:

sudo make C=2 CF=-D__CHECK_ENDIAN__ M=net/bpf/
CHECK   net/bpf//test_run.c
net/bpf//test_run.c:19:77: warning: Using plain integer as NULL pointer
./include/linux/bpf-cgroup.h:295:77: warning: Using plain integer as NULL 
pointer

Fixes: 8bad74f9840f ("bpf: extend cgroup bpf core to allow multiple
cgroup storage types")

Acked-by: Yonghong Song 
Signed-off-by: Bo YU 
---
V2: Add fix-up tag from Yonghong
---
 include/linux/bpf-cgroup.h | 2 +-
 net/bpf/test_run.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h
index 695b2a880d9a..a4c644c1c091 100644
--- a/include/linux/bpf-cgroup.h
+++ b/include/linux/bpf-cgroup.h
@@ -292,7 +292,7 @@ static inline int bpf_cgroup_storage_assign(struct bpf_prog 
*prog,
 static inline void bpf_cgroup_storage_release(struct bpf_prog *prog,
  struct bpf_map *map) {}
 static inline struct bpf_cgroup_storage *bpf_cgroup_storage_alloc(
-   struct bpf_prog *prog, enum bpf_cgroup_storage_type stype) { return 0; }
+   struct bpf_prog *prog, enum bpf_cgroup_storage_type stype) { return 
NULL; }
 static inline void bpf_cgroup_storage_free(
struct bpf_cgroup_storage *storage) {}
 static inline int bpf_percpu_cgroup_storage_copy(struct bpf_map *map, void 
*key,
diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
index da7051d62727..fab142b796ef 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -16,7 +16,7 @@
 static int bpf_test_run(struct bpf_prog *prog, void *ctx, u32 repeat,
u32 *retval, u32 *time)
 {
-   struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE] = { 0 };
+   struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE] = { 
NULL };
enum bpf_cgroup_storage_type stype;
u64 time_start, time_spent = 0;
int ret = 0;
-- 
2.11.0



[PATCH 2/2] net: bonding: fix incorrect type in assignment

2019-03-07 Thread Bo YU
There are some warning when:

sudo make C=1 CF=-D__CHECK_ENDIAN__ drivers/net/bonding/

drivers/net/bonding/bond_main.c:2438:40: warning: incorrect type in assignment 
(different base types)
drivers/net/bonding/bond_main.c:2438:40:expected restricted __be16 
[usertype] vlan_proto
drivers/net/bonding/bond_main.c:2438:40:
...
rivers/net/bonding/bond_options.c:1089:24: warning: incorrect type in 
assignment (different base types)
drivers/net/bonding/bond_options.c:1089:24:expected restricted __be32 
[addressable] [usertype] target
drivers/net/bonding/bond_options.c:1089:24:got unsigned long long const 
[usertype] value

So fix it

Signed-off-by: Bo YU 
---
 drivers/net/bonding/bond_main.c| 2 +-
 drivers/net/bonding/bond_options.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 135fec28daa9..07e52d863e91 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2435,7 +2435,7 @@ struct bond_vlan_tag *bond_verify_device_path(struct 
net_device *start_dev,
tags = kcalloc(level + 1, sizeof(*tags), GFP_ATOMIC);
if (!tags)
return ERR_PTR(-ENOMEM);
-   tags[level].vlan_proto = VLAN_N_VID;
+   tags[level].vlan_proto = cpu_to_be16(VLAN_N_VID);
return tags;
}
 
diff --git a/drivers/net/bonding/bond_options.c 
b/drivers/net/bonding/bond_options.c
index da1fc17295d9..3a196999bd1b 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -1086,7 +1086,7 @@ static int bond_option_arp_ip_targets_set(struct bonding 
*bond,
else
netdev_err(bond->dev, "no command found in 
arp_ip_targets file - use + or -\n");
} else {
-   target = newval->value;
+   target = cpu_to_be32(newval->value);
ret = bond_option_arp_ip_target_add(bond, target);
}
 
-- 
2.11.0



[PATCH 0/2] net: bonding: fix sparse warning

2019-03-07 Thread Bo YU


Bo YU (2):
  net: bonding: fix restricted __be16 degrades to integer
  net: bonding: fix incorrect type in assignment

 drivers/net/bonding/bond_main.c| 8 
 drivers/net/bonding/bond_options.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

--
2.11.0



[PATCH 1/2] net: bonding: fix restricted __be16 degrades to integer

2019-03-07 Thread Bo YU
There are some warning when:

sudo make C=1 CF=-D__CHECK_ENDIAN__ drivers/net/bonding/

drivers/net/bonding/bond_main.c:2385:26: warning: restricted __be16 degrades to 
integer
drivers/net/bonding/bond_main.c:2391:20: warning: restricted __be16 degrades to 
integer
...
drivers/net/bonding/bond_main.c:3241:60: warning: restricted __be16 degrades to 
integer
drivers/net/bonding/bond_main.c:3241:60: warning: restricted __be16 degrades to 
integer

So fix it.

Signed-off-by: Bo YU 
---
 drivers/net/bonding/bond_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index b59708c35faf..135fec28daa9 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2382,13 +2382,13 @@ static void bond_arp_send(struct net_device *slave_dev, 
int arp_op,
return;
}
 
-   if (!tags || tags->vlan_proto == VLAN_N_VID)
+   if (!tags || be16_to_cpu(tags->vlan_proto) == VLAN_N_VID)
goto xmit;
 
tags++;
 
/* Go through all the tags backwards and add them to the packet */
-   while (tags->vlan_proto != VLAN_N_VID) {
+   while (be16_to_cpu(tags->vlan_proto) != VLAN_N_VID) {
if (!tags->vlan_id) {
tags++;
continue;
@@ -3238,7 +3238,7 @@ static inline u32 bond_eth_hash(struct sk_buff *skb)
 
ep = skb_header_pointer(skb, 0, sizeof(hdr_tmp), _tmp);
if (ep)
-   return ep->h_dest[5] ^ ep->h_source[5] ^ ep->h_proto;
+   return ep->h_dest[5] ^ ep->h_source[5] ^ 
be16_to_cpu(ep->h_proto);
return 0;
 }
 
-- 
2.11.0



[PATCH] bpf: fix warning about using plain integer as NULL

2019-03-07 Thread Bo YU
Sparse warning below:

sudo make C=2 CF=-D__CHECK_ENDIAN__ M=net/bpf/
CHECK   net/bpf//test_run.c
net/bpf//test_run.c:19:77: warning: Using plain integer as NULL pointer
./include/linux/bpf-cgroup.h:295:77: warning: Using plain integer as NULL 
pointer

Signed-off-by: Bo YU 
---
 include/linux/bpf-cgroup.h | 2 +-
 net/bpf/test_run.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h
index 695b2a880d9a..a4c644c1c091 100644
--- a/include/linux/bpf-cgroup.h
+++ b/include/linux/bpf-cgroup.h
@@ -292,7 +292,7 @@ static inline int bpf_cgroup_storage_assign(struct bpf_prog 
*prog,
 static inline void bpf_cgroup_storage_release(struct bpf_prog *prog,
  struct bpf_map *map) {}
 static inline struct bpf_cgroup_storage *bpf_cgroup_storage_alloc(
-   struct bpf_prog *prog, enum bpf_cgroup_storage_type stype) { return 0; }
+   struct bpf_prog *prog, enum bpf_cgroup_storage_type stype) { return 
NULL; }
 static inline void bpf_cgroup_storage_free(
struct bpf_cgroup_storage *storage) {}
 static inline int bpf_percpu_cgroup_storage_copy(struct bpf_map *map, void 
*key,
diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
index da7051d62727..fab142b796ef 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -16,7 +16,7 @@
 static int bpf_test_run(struct bpf_prog *prog, void *ctx, u32 repeat,
u32 *retval, u32 *time)
 {
-   struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE] = { 0 };
+   struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE] = { 
NULL };
enum bpf_cgroup_storage_type stype;
u64 time_start, time_spent = 0;
int ret = 0;
-- 
2.11.0



[PATCH V2] staging: wilc1000: fix incorrent type in initializer

2019-02-27 Thread Bo YU
Fix sparse warning:

drivers/staging/wilc1000//host_interface.c:444:49: warning: incorrect type in 
initializer (different address spaces)
drivers/staging/wilc1000//host_interface.c:444:49:expected struct 
cfg80211_bss_ies const *ies
drivers/staging/wilc1000//host_interface.c:444:49:got struct 
cfg80211_bss_ies const [noderef]  *ies

Signed-off-by: Bo YU 
---
V2: Adding cc wireless-list
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 20349af2ed30..4dd9a20f6a0b 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -441,7 +441,7 @@ void *wilc_parse_join_bss_param(struct cfg80211_bss *bss,
const u8 *tim_elm, *ssid_elm, *rates_ie, *supp_rates_ie;
const u8 *ht_ie, *wpa_ie, *wmm_ie, *rsn_ie;
int ret;
-   const struct cfg80211_bss_ies *ies = bss->ies;
+   const struct cfg80211_bss_ies *ies = rcu_dereference(bss->ies);
 
param = kzalloc(sizeof(*param), GFP_KERNEL);
if (!param)
-- 
2.11.0



[PATCH V2] staging: wilc1000: fix incorrent type assignment

2019-02-25 Thread Bo YU
Fix sparse warning:

drivers/staging/wilc1000/host_interface.c:450:30: warning: incorrect type in 
assignment (different base types)
drivers/staging/wilc1000/host_interface.c:450:30:expected restricted __le16 
[usertype] beacon_period
drivers/staging/wilc1000/host_interface.c:450:30:got unsigned short 
[usertype] beacon_interval
drivers/staging/wilc1000/host_interface.c:451:25: warning: incorrect type in 
assignment (different base types)
drivers/staging/wilc1000/host_interface.c:451:25:expected restricted __le16 
[usertype] cap_info
drivers/staging/wilc1000/host_interface.c:451:25:got unsigned short 
[usertype] capability

Signed-off-by: Bo YU 
---
V2: use cpu_to_le16 assign valid type according to Ajay's suggestions
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 50dc2dd942f5..20349af2ed30 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -447,8 +447,8 @@ void *wilc_parse_join_bss_param(struct cfg80211_bss *bss,
if (!param)
return NULL;
 
-   param->beacon_period = bss->beacon_interval;
-   param->cap_info = bss->capability;
+   param->beacon_period = cpu_to_le16(bss->beacon_interval);
+   param->cap_info = cpu_to_le16(bss->capability);
param->bss_type = WILC_FW_BSS_TYPE_INFRA;
param->ch = ieee80211_frequency_to_channel(bss->channel->center_freq);
ether_addr_copy(param->bssid, bss->bssid);
-- 
2.11.0



[PATCH] staging: wilc1000: fix incorrect type in initializer

2019-02-25 Thread Bo YU
Fix sparse warning following:

drivers/staging/wilc1000/host_interface.c:444:49: warning: incorrect type in 
initializer (different address spaces)
drivers/staging/wilc1000/host_interface.c:444:49:expected struct 
cfg80211_bss_ies const *ies
drivers/staging/wilc1000/host_interface.c:444:49:got struct 
cfg80211_bss_ies const [noderef]  *ies

Signed-off-by: Bo YU 
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index cdcb52aec779..89ae22d40f71 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -441,7 +441,7 @@ void *wilc_parse_join_bss_param(struct cfg80211_bss *bss,
const u8 *tim_elm, *ssid_elm, *rates_ie, *supp_rates_ie;
const u8 *ht_ie, *wpa_ie, *wmm_ie, *rsn_ie;
int ret;
-   const struct cfg80211_bss_ies *ies = bss->ies;
+   const struct cfg80211_bss_ies *ies = rcu_dereference(bss->ies);
 
param = kzalloc(sizeof(*param), GFP_KERNEL);
if (!param)
-- 
2.11.0



[PATCH] staging: wilc1000: Fix incorrent type in assignment

2019-02-25 Thread Bo YU
The patch fixes following sparse warning:

drivers/staging/wilc1000/host_interface.c:450:30: warning: incorrect type in 
assignment (different base types)
drivers/staging/wilc1000/host_interface.c:450:30:expected restricted __le16 
[usertype] beacon_period
drivers/staging/wilc1000/host_interface.c:450:30:got unsigned short 
[usertype] beacon_interval
drivers/staging/wilc1000/host_interface.c:451:25: warning: incorrect type in 
assignment (different base types)
drivers/staging/wilc1000/host_interface.c:451:25:expected restricted __le16 
[usertype] cap_info
drivers/staging/wilc1000/host_interface.c:451:25:got unsigned short 
[usertype] capability

Signed-off-by: Bo YU 
---
I have no hardware to test it and just to compile it
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 50dc2dd942f5..cdcb52aec779 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -106,10 +106,10 @@ struct wilc_join_bss_param {
u8 ssid_terminator;
u8 bss_type;
u8 ch;
-   __le16 cap_info;
+   u16 cap_info;
u8 sa[ETH_ALEN];
u8 bssid[ETH_ALEN];
-   __le16 beacon_period;
+   u16 beacon_period;
u8 dtim_period;
u8 supp_rates[WILC_MAX_RATES_SUPPORTED + 1];
u8 wmm_cap;
-- 
2.11.0



[PATCH V3] staging: ks7010: removed unused variables

2019-02-22 Thread Bo YU
From: Bo Yu 

Compiling the kernel with W=1 results in the following warning:

drivers/staging/ks7010/ks_hostif.c:465:6: warning: variable ‘mib_val_type’
set but not used [-Wunused-but-set-variable]
  u16 mib_val_type;

drivers/staging/ks7010/ks_hostif.c:464:6: warning: variable ‘mib_val_size’
set but not used [-Wunused-but-set-variable]
u16 mib_val_size;

drivers/staging/ks7010/ks_hostif.c:786:6: warning: variable ‘result_code’
set but not used [-Wunused-but-set-variable]
  u16 result_code;

Remove these variables.

Cc: Greg Kroah-Hartman 
Cc: Sergio Paracuellos 
Cc: Quytelda Kahja 

Signed-off-by: Bo Yu 
---
Changelog:
V3: fix spell issue in subject line
V2: fix patch format
---
 drivers/staging/ks7010/ks_hostif.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index d938b0997a53..913d8996437a 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -461,13 +461,9 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
struct net_device *dev = priv->net_dev;
u32 mib_status;
u32 mib_attribute;
-   u16 mib_val_size;
-   u16 mib_val_type;
 
mib_status = get_dword(priv);
mib_attribute = get_dword(priv);
-   mib_val_size = get_word(priv);
-   mib_val_type = get_word(priv);
 
if (mib_status) {
netdev_err(priv->net_dev, "attribute=%08X, status=%08X\n",
@@ -783,9 +779,7 @@ void hostif_ps_adhoc_set_confirm(struct ks_wlan_private 
*priv)
 static
 void hostif_infrastructure_set_confirm(struct ks_wlan_private *priv)
 {
-   u16 result_code;
 
-   result_code = get_word(priv);
priv->infra_status = 1; /* infrastructure mode set */
hostif_sme_enqueue(priv, SME_MODE_SET_CONFIRM);
 }
-- 
2.11.0



[PATCH V2] staging: ks7070: removed unused varibales

2019-02-22 Thread Bo YU
From: Bo Yu 

Compiling the kernel with W=1 results in the following warning:

drivers/staging/ks7010/ks_hostif.c:465:6: warning: variable ‘mib_val_type’
set but not used [-Wunused-but-set-variable]
  u16 mib_val_type;

drivers/staging/ks7010/ks_hostif.c:464:6: warning: variable ‘mib_val_size’
set but not used [-Wunused-but-set-variable]
u16 mib_val_size;

drivers/staging/ks7010/ks_hostif.c:786:6: warning: variable ‘result_code’
set but not used [-Wunused-but-set-variable]
  u16 result_code;

Remove these variables.

Rebase on next-20190222

V2: fix patch format

Cc: Greg Kroah-Hartman 
Cc: Sergio Paracuellos 
Cc: Quytelda Kahja 

Signed-off-by: Bo Yu 
---
 drivers/staging/ks7010/ks_hostif.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index d938b0997a53..913d8996437a 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -461,13 +461,9 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
struct net_device *dev = priv->net_dev;
u32 mib_status;
u32 mib_attribute;
-   u16 mib_val_size;
-   u16 mib_val_type;
 
mib_status = get_dword(priv);
mib_attribute = get_dword(priv);
-   mib_val_size = get_word(priv);
-   mib_val_type = get_word(priv);
 
if (mib_status) {
netdev_err(priv->net_dev, "attribute=%08X, status=%08X\n",
@@ -783,9 +779,7 @@ void hostif_ps_adhoc_set_confirm(struct ks_wlan_private 
*priv)
 static
 void hostif_infrastructure_set_confirm(struct ks_wlan_private *priv)
 {
-   u16 result_code;
 
-   result_code = get_word(priv);
priv->infra_status = 1; /* infrastructure mode set */
hostif_sme_enqueue(priv, SME_MODE_SET_CONFIRM);
 }
-- 
2.11.0



[PATCH] staging/ks7070: Removed unused varibale

2019-02-22 Thread Bo YU
From: Bo Yu 

Compiling the kernel with W=1 results in the following warning:

drivers/staging/ks7010/ks_hostif.c:465:6: warning: variable ‘mib_val_type’
set but not used [-Wunused-but-set-variable]
  u16 mib_val_type;

drivers/staging/ks7010/ks_hostif.c:464:6: warning: variable ‘mib_val_size’
set but not used [-Wunused-but-set-variable]
u16 mib_val_size;

drivers/staging/ks7010/ks_hostif.c:786:6: warning: variable ‘result_code’
set but not used [-Wunused-but-set-variable]
  u16 result_code;

Remove these variables.

Rebase on next-20190222

Cc: Greg Kroah-Hartman 
Cc: Sergio Paracuellos 
Cc: Quytelda Kahja 

Signed-off-by: Bo Yu 
---
 drivers/staging/ks7010/ks_hostif.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index d938b0997a53..913d8996437a 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -461,13 +461,9 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
struct net_device *dev = priv->net_dev;
u32 mib_status;
u32 mib_attribute;
-   u16 mib_val_size;
-   u16 mib_val_type;
 
mib_status = get_dword(priv);
mib_attribute = get_dword(priv);
-   mib_val_size = get_word(priv);
-   mib_val_type = get_word(priv);
 
if (mib_status) {
netdev_err(priv->net_dev, "attribute=%08X, status=%08X\n",
@@ -783,9 +779,7 @@ void hostif_ps_adhoc_set_confirm(struct ks_wlan_private 
*priv)
 static
 void hostif_infrastructure_set_confirm(struct ks_wlan_private *priv)
 {
-   u16 result_code;
 
-   result_code = get_word(priv);
priv->infra_status = 1; /* infrastructure mode set */
hostif_sme_enqueue(priv, SME_MODE_SET_CONFIRM);
 }
-- 
2.11.0



[PATCH] staging/erofs: fix sparse's warnings on undeclared symbols in erofs

2019-02-21 Thread Bo YU
From: Bo Yu 

Fix sparse warnings:

drivers/staging/erofs/utils.c:134:6: warning: symbol
'erofs_try_to_release_workgroup' was not declared. Should it be static?

Fixes: 51232df5e4b26("staging: erofs: fix race when the managed cache is 
enabled")
Cc: Gao Xiang 
Cc: Chao Yu 
CC: Greg Kroah-Hartman 
Signed-off-by: Bo Yu 
---
 drivers/staging/erofs/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/erofs/utils.c b/drivers/staging/erofs/utils.c
index b535898ca753..33cd5ad55cb8 100644
--- a/drivers/staging/erofs/utils.c
+++ b/drivers/staging/erofs/utils.c
@@ -131,7 +131,7 @@ static void erofs_workgroup_unfreeze_final(struct 
erofs_workgroup *grp)
__erofs_workgroup_free(grp);
 }
 
-bool erofs_try_to_release_workgroup(struct erofs_sb_info *sbi,
+static bool erofs_try_to_release_workgroup(struct erofs_sb_info *sbi,
struct erofs_workgroup *grp,
bool cleanup)
 {
-- 
2.11.0



[PATCH] perf trace: Fix potential USE_AFTER_FREE problem

2019-02-13 Thread Bo YU
From: Bo Yu 

There is a freed pointer "evsel", so fix it.

Detected by CoverityScan, CID#1442595("Memory-illegalaccesses
(USE_AFTER_FREE)")
Fixes: 6ab3bc240ade4("perf trace: Support multiple "vfs_getname" probes")

Signed-off-by: Bo Yu 
---
 tools/perf/builtin-trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index b36061cd1ab8..4036b20a1067 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2515,7 +2515,7 @@ static size_t trace__fprintf_thread_summary(struct trace 
*trace, FILE *fp);
 static bool perf_evlist__add_vfs_getname(struct perf_evlist *evlist)
 {
bool found = false;
-   struct perf_evsel *evsel, *tmp;
+   struct perf_evsel *evsel = NULL, *tmp;
struct parse_events_error err = { .idx = 0, };
int ret = parse_events(evlist, "probe:vfs_getname*", );
 
-- 
2.11.0



[PATCH] drm/amdgpu: Error handling issues about CHECKED_RETURN

2019-02-13 Thread Bo YU
From: Bo Yu 

Calling "amdgpu_ring_test_helper" without checking return value

Signed-off-by: Bo Yu 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 57cb3a51bda7..48465a61516b 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -4728,7 +4728,9 @@ static int gfx_v8_0_cp_test_all_rings(struct 
amdgpu_device *adev)
 
for (i = 0; i < adev->gfx.num_compute_rings; i++) {
ring = >gfx.compute_ring[i];
-   amdgpu_ring_test_helper(ring);
+   r = amdgpu_ring_test_helper(ring);
+   if (r)
+   return r;
}
 
return 0;
-- 
2.11.0



[PATCH] perf pmu-events: Removed unused variable

2019-02-13 Thread Bo YU
From: Bo Yu 

Compiling kernel when W=1, it will throw a warning:

pmu-events/jevents.c: In function ‘save_arch_std_events’:
pmu-events/jevents.c:417:15: warning: unused variable ‘sb’ [-Wunused-variable]
  struct stat *sb = data;

Removed the unused variable

Signed-off-by: Bo Yu 
---
 tools/perf/pmu-events/jevents.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index 68c92bb599ee..92e60fd11fdd 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -414,7 +414,6 @@ static int save_arch_std_events(void *data, char *name, 
char *event,
char *metric_name, char *metric_group)
 {
struct event_struct *es;
-   struct stat *sb = data;
 
es = malloc(sizeof(*es));
if (!es)
-- 
2.11.0



[tip:x86/cleanups] x86/mtrr: Remove unused variable

2019-02-08 Thread tip-bot for Bo Yu
Commit-ID:  c81cd5c08d676483bb09f4809660d2a1abea0062
Gitweb: https://git.kernel.org/tip/c81cd5c08d676483bb09f4809660d2a1abea0062
Author: Bo Yu 
AuthorDate: Fri, 8 Feb 2019 07:53:43 -0500
Committer:  Thomas Gleixner 
CommitDate: Fri, 8 Feb 2019 14:32:33 +0100

x86/mtrr: Remove unused variable

Compiling the kernel with W=1 results in the following warning:

arch/x86/kernel/cpu/mtrr/cleanup.c:299:16: warning: variable ‘second_basek’ set 
but not used [-Wunused-but-set-variable]
  unsigned long second_basek, second_sizek;

Remove the unused variable.

[ tglx: Massaged changelog ]

Signed-off-by: Bo Yu 
Signed-off-by: Thomas Gleixner 
Cc: b...@alien8.de
Cc: h...@zytor.com
Cc: pu...@hygon.cn
Link: https://lkml.kernel.org/r/20190208125343.11451-1-tsu.y...@gmail.com

---
 arch/x86/kernel/cpu/mtrr/cleanup.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c 
b/arch/x86/kernel/cpu/mtrr/cleanup.c
index 3668c5df90c6..5bd011737272 100644
--- a/arch/x86/kernel/cpu/mtrr/cleanup.c
+++ b/arch/x86/kernel/cpu/mtrr/cleanup.c
@@ -296,7 +296,7 @@ range_to_mtrr_with_hole(struct var_mtrr_state *state, 
unsigned long basek,
unsigned long sizek)
 {
unsigned long hole_basek, hole_sizek;
-   unsigned long second_basek, second_sizek;
+   unsigned long second_sizek;
unsigned long range0_basek, range0_sizek;
unsigned long range_basek, range_sizek;
unsigned long chunk_sizek;
@@ -304,7 +304,6 @@ range_to_mtrr_with_hole(struct var_mtrr_state *state, 
unsigned long basek,
 
hole_basek = 0;
hole_sizek = 0;
-   second_basek = 0;
second_sizek = 0;
chunk_sizek = state->chunk_sizek;
gran_sizek = state->gran_sizek;


[PATCH] x86: drop warning from mtrr: -Wunused-but-set-variable

2019-02-08 Thread Bo YU
From: Bo Yu 

There is a warning if enable W=1 when compile kernel:

arch/x86/kernel/cpu/mtrr/cleanup.c:299:16: warning: variable ‘second_basek’ set 
but not used [-Wunused-but-set-variable]
  unsigned long second_basek, second_sizek;

Signed-off-by: Bo Yu 
---
 arch/x86/kernel/cpu/mtrr/cleanup.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c 
b/arch/x86/kernel/cpu/mtrr/cleanup.c
index 3668c5df90c6..5bd011737272 100644
--- a/arch/x86/kernel/cpu/mtrr/cleanup.c
+++ b/arch/x86/kernel/cpu/mtrr/cleanup.c
@@ -296,7 +296,7 @@ range_to_mtrr_with_hole(struct var_mtrr_state *state, 
unsigned long basek,
unsigned long sizek)
 {
unsigned long hole_basek, hole_sizek;
-   unsigned long second_basek, second_sizek;
+   unsigned long second_sizek;
unsigned long range0_basek, range0_sizek;
unsigned long range_basek, range_sizek;
unsigned long chunk_sizek;
@@ -304,7 +304,6 @@ range_to_mtrr_with_hole(struct var_mtrr_state *state, 
unsigned long basek,
 
hole_basek = 0;
hole_sizek = 0;
-   second_basek = 0;
second_sizek = 0;
chunk_sizek = state->chunk_sizek;
gran_sizek = state->gran_sizek;
-- 
2.11.0



[PATCH V5 2/2] kobject: drop newline from msg string

2019-01-09 Thread Bo YU
There is currently a missing terminating newline in non-switch case
match when msg == NULL

Signed-off-by: Bo YU 
---
Changes in V4:
Recovery originly declaration, requested by Greg.

Change in V3:
Improve the commit log, requested by Rafael.

Changes in V2:
Drop newline from msg according to Joe's suggestion.
---
 lib/kobject_uevent.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index c87a96c4800e..f05802687ba4 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -200,7 +200,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
 
r = kobject_action_type(buf, count, , _args);
if (r) {
-   msg = "unknown uevent action string\n";
+   msg = "unknown uevent action string";
goto out;
}
 
@@ -212,7 +212,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
r = kobject_action_args(action_args,
count - (action_args - buf), );
if (r == -EINVAL) {
-   msg = "incorrect uevent action arguments\n";
+   msg = "incorrect uevent action arguments";
goto out;
}
 
@@ -224,7 +224,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
 out:
if (r) {
devpath = kobject_get_path(kobj, GFP_KERNEL);
-   pr_warn("synth uevent: %s: %s",
+   pr_warn("synth uevent: %s: %s\n",
   devpath ?: "unknown device",
   msg ?: "failed to send uevent");
kfree(devpath);
-- 
2.11.0



[PATCH V5 0/2] kobject: fix code style and drop newline

2019-01-09 Thread Bo YU
There are some mirror changes in kobject_uevent.c.

Btw, this is v5 for the patchset.2/2 was fixed by v1-v4,but 1/2 was marked
V2 :(.

Bo YU (2):
  kobject: to repalce printk with pr_* style
  kobject: drop newline from msg string

 lib/kobject_uevent.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

--
2.11.0



[PATCH V5 1/2] kobject: to repalce printk with pr_* style

2019-01-09 Thread Bo YU
Repalce printk with pr_warn in kobject_synth_uevent and replace
printk with pr_err in uevent_net_init to make both consistent with
other code in kobject_uevent.c

Signed-off-by: Bo YU 

---
Changes in V2:
Improve the commit log, doing as the patch did.
---
 lib/kobject_uevent.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 27c6118afd1c..c87a96c4800e 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -224,7 +224,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
 out:
if (r) {
devpath = kobject_get_path(kobj, GFP_KERNEL);
-   printk(KERN_WARNING "synth uevent: %s: %s",
+   pr_warn("synth uevent: %s: %s",
   devpath ?: "unknown device",
   msg ?: "failed to send uevent");
kfree(devpath);
@@ -765,8 +765,7 @@ static int uevent_net_init(struct net *net)
 
ue_sk->sk = netlink_kernel_create(net, NETLINK_KOBJECT_UEVENT, );
if (!ue_sk->sk) {
-   printk(KERN_ERR
-  "kobject_uevent: unable to create netlink socket!\n");
+   pr_err("kobject_uevent: unable to create netlink socket!\n");
kfree(ue_sk);
return -ENODEV;
}
-- 
2.11.0



[PATCH v4 2/2] kobject: drop newline from msg string

2019-01-07 Thread Bo YU
There is currently a missing terminating newline in non-switch case
match,when msg == NULL

Signed-off-by: Bo YU 
---
Changes in V4:
Recovery  originly declaration, requested by Greg.

Changes in V3:
Improve the commit log, requested by rafael.

Changes in V2:
According to Joe's suggestion, drop newline from msg string
---
 lib/kobject_uevent.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 499dfcdafcb0..118226a02707 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -200,7 +200,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
 
r = kobject_action_type(buf, count, , _args);
if (r) {
-   msg = "unknown uevent action string\n";
+   msg = "unknown uevent action string";
goto out;
}
 
@@ -212,7 +212,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
r = kobject_action_args(action_args,
count - (action_args - buf), );
if (r == -EINVAL) {
-   msg = "incorrect uevent action arguments\n";
+   msg = "incorrect uevent action arguments";
goto out;
}
 
@@ -224,7 +224,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
 out:
if (r) {
devpath = kobject_get_path(kobj, GFP_KERNEL);
-   pr_warn("synth uevent: %s: %s",
+   pr_warn("synth uevent: %s: %s\n",
   devpath ?: "unknown device",
   msg ?: "failed to send uevent");
kfree(devpath);
-- 
2.11.0



[PATCH v4 0/2] kobject: trival fix

2019-01-07 Thread Bo YU
This is trival fix for lib/kobject_uevent.c file.

Bo YU (2):
  kobject: use pr_warn to replace printk
  kobject: drop newline from msg string

 lib/kobject_uevent.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--
2.11.0



[PATCH v4 1/2] kobject: use pr_warn to replace printk

2019-01-07 Thread Bo YU
This is a fix to replace printk with pr_warn

Signed-off-by: Bo YU 
---
 lib/kobject_uevent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 27c6118afd1c..499dfcdafcb0 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -224,7 +224,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
 out:
if (r) {
devpath = kobject_get_path(kobj, GFP_KERNEL);
-   printk(KERN_WARNING "synth uevent: %s: %s",
+   pr_warn("synth uevent: %s: %s",
   devpath ?: "unknown device",
   msg ?: "failed to send uevent");
kfree(devpath);
-- 
2.11.0



[PATCH v3 2/2] kobject: drop newline from msg string

2018-12-07 Thread Bo YU
There is currently a missing terminating newline in non-switch case
match, when msg == NULL.

Signed-off-by: Bo YU 
---
Changes in v3:
Improve the commit log,requested by rafael.

Changes in v2:
According to Joe's suggestion,drop newline from msg

 lib/kobject_uevent.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index b7c088c902a2..1837765ebf01 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -195,12 +195,12 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
enum kobject_action action;
const char *action_args;
struct kobj_uevent_env *env;
-   const char *msg = NULL, *devpath;
+   const char *msg = NULL;
int r;

r = kobject_action_type(buf, count, , _args);
if (r) {
-   msg = "unknown uevent action string\n";
+   msg = "unknown uevent action string";
goto out;
}

@@ -212,7 +212,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
r = kobject_action_args(action_args,
count - (action_args - buf), );
if (r == -EINVAL) {
-   msg = "incorrect uevent action arguments\n";
+   msg = "incorrect uevent action arguments";
goto out;
}

@@ -223,8 +223,9 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
kfree(env);
 out:
if (r) {
-   devpath = kobject_get_path(kobj, GFP_KERNEL);
-   pr_warn("synth uevent: %s: %s",
+   char *devpath = kobject_get_path(kobj, GFP_KERNEL);
+
+   pr_warn("synth uevent: %s: %s\n",
   devpath ?: "unknown device",
   msg ?: "failed to send uevent");
kfree(devpath);
--
2.11.0



[PATCH v3 2/2] kobject: drop newline from msg string

2018-12-07 Thread Bo YU
There is currently a missing terminating newline in non-switch case
match, when msg == NULL.

Signed-off-by: Bo YU 
---
Changes in v3:
Improve the commit log,requested by rafael.

Changes in v2:
According to Joe's suggestion,drop newline from msg

 lib/kobject_uevent.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index b7c088c902a2..1837765ebf01 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -195,12 +195,12 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
enum kobject_action action;
const char *action_args;
struct kobj_uevent_env *env;
-   const char *msg = NULL, *devpath;
+   const char *msg = NULL;
int r;

r = kobject_action_type(buf, count, , _args);
if (r) {
-   msg = "unknown uevent action string\n";
+   msg = "unknown uevent action string";
goto out;
}

@@ -212,7 +212,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
r = kobject_action_args(action_args,
count - (action_args - buf), );
if (r == -EINVAL) {
-   msg = "incorrect uevent action arguments\n";
+   msg = "incorrect uevent action arguments";
goto out;
}

@@ -223,8 +223,9 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
kfree(env);
 out:
if (r) {
-   devpath = kobject_get_path(kobj, GFP_KERNEL);
-   pr_warn("synth uevent: %s: %s",
+   char *devpath = kobject_get_path(kobj, GFP_KERNEL);
+
+   pr_warn("synth uevent: %s: %s\n",
   devpath ?: "unknown device",
   msg ?: "failed to send uevent");
kfree(devpath);
--
2.11.0



[PATCH v3 1/2] kobject: use pr_warn to replace printk

2018-12-07 Thread Bo YU
This is a fix to replace printk with pr_warn

Signed-off-by: Bo YU 
---
 lib/kobject_uevent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 63d0816ab23b..b7c088c902a2 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -224,7 +224,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
 out:
if (r) {
devpath = kobject_get_path(kobj, GFP_KERNEL);
-   printk(KERN_WARNING "synth uevent: %s: %s",
+   pr_warn("synth uevent: %s: %s",
   devpath ?: "unknown device",
   msg ?: "failed to send uevent");
kfree(devpath);
-- 
2.11.0



[PATCH v3 1/2] kobject: use pr_warn to replace printk

2018-12-07 Thread Bo YU
This is a fix to replace printk with pr_warn

Signed-off-by: Bo YU 
---
 lib/kobject_uevent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 63d0816ab23b..b7c088c902a2 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -224,7 +224,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
 out:
if (r) {
devpath = kobject_get_path(kobj, GFP_KERNEL);
-   printk(KERN_WARNING "synth uevent: %s: %s",
+   pr_warn("synth uevent: %s: %s",
   devpath ?: "unknown device",
   msg ?: "failed to send uevent");
kfree(devpath);
-- 
2.11.0



[PATCH v3 0/2] kobject: trival fix

2018-12-07 Thread Bo YU
This is trival fix for lib/kobject_uevent.c file.

Bo YU (2):
  kobject: use pr_warn to replace printk
  kobject: drop newline from msg string

 lib/kobject_uevent.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

--
2.11.0



[PATCH v3 0/2] kobject: trival fix

2018-12-07 Thread Bo YU
This is trival fix for lib/kobject_uevent.c file.

Bo YU (2):
  kobject: use pr_warn to replace printk
  kobject: drop newline from msg string

 lib/kobject_uevent.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

--
2.11.0



[PATCH v2] kobject: to use pr_warn replace KERN_WARNING

2018-11-05 Thread Bo YU
Fix warning form checkpatch, use pr_warn replace KERN_WARNING

Signed-off-by: Bo YU 
---
changes in v2:
According to Joe's suggestion,drop newline from msg, otherwise
it can be unterminated with newline.
---
 lib/kobject_uevent.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 63d0816ab23b..1837765ebf01 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -195,12 +195,12 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
enum kobject_action action;
const char *action_args;
struct kobj_uevent_env *env;
-   const char *msg = NULL, *devpath;
+   const char *msg = NULL;
int r;
 
r = kobject_action_type(buf, count, , _args);
if (r) {
-   msg = "unknown uevent action string\n";
+   msg = "unknown uevent action string";
goto out;
}
 
@@ -212,7 +212,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
r = kobject_action_args(action_args,
count - (action_args - buf), );
if (r == -EINVAL) {
-   msg = "incorrect uevent action arguments\n";
+   msg = "incorrect uevent action arguments";
goto out;
}
 
@@ -223,8 +223,9 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
kfree(env);
 out:
if (r) {
-   devpath = kobject_get_path(kobj, GFP_KERNEL);
-   printk(KERN_WARNING "synth uevent: %s: %s",
+   char *devpath = kobject_get_path(kobj, GFP_KERNEL);
+
+   pr_warn("synth uevent: %s: %s\n",
   devpath ?: "unknown device",
   msg ?: "failed to send uevent");
kfree(devpath);
-- 
2.11.0



[PATCH v2] kobject: to use pr_warn replace KERN_WARNING

2018-11-05 Thread Bo YU
Fix warning form checkpatch, use pr_warn replace KERN_WARNING

Signed-off-by: Bo YU 
---
changes in v2:
According to Joe's suggestion,drop newline from msg, otherwise
it can be unterminated with newline.
---
 lib/kobject_uevent.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 63d0816ab23b..1837765ebf01 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -195,12 +195,12 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
enum kobject_action action;
const char *action_args;
struct kobj_uevent_env *env;
-   const char *msg = NULL, *devpath;
+   const char *msg = NULL;
int r;
 
r = kobject_action_type(buf, count, , _args);
if (r) {
-   msg = "unknown uevent action string\n";
+   msg = "unknown uevent action string";
goto out;
}
 
@@ -212,7 +212,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
r = kobject_action_args(action_args,
count - (action_args - buf), );
if (r == -EINVAL) {
-   msg = "incorrect uevent action arguments\n";
+   msg = "incorrect uevent action arguments";
goto out;
}
 
@@ -223,8 +223,9 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
kfree(env);
 out:
if (r) {
-   devpath = kobject_get_path(kobj, GFP_KERNEL);
-   printk(KERN_WARNING "synth uevent: %s: %s",
+   char *devpath = kobject_get_path(kobj, GFP_KERNEL);
+
+   pr_warn("synth uevent: %s: %s\n",
   devpath ?: "unknown device",
   msg ?: "failed to send uevent");
kfree(devpath);
-- 
2.11.0



[PATCH 2/3] kobject: Fix warnings in lib/kobject_uevent.c

2018-10-30 Thread Bo YU
Add a blank after declaration.

Signed-off-by: Bo YU 
---
 lib/kobject_uevent.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 402765c3a9cb..27c6118afd1c 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -240,6 +240,7 @@ static int kobj_usermode_filter(struct kobject *kobj)
ops = kobj_ns_ops(kobj);
if (ops) {
const void *init_ns, *ns;
+
ns = kobj->ktype->namespace(kobj);
init_ns = ops->initial_ns();
return ns != init_ns;
@@ -390,6 +391,7 @@ static int kobject_uevent_net_broadcast(struct kobject 
*kobj,
ops = kobj_ns_ops(kobj);
if (!ops && kobj->kset) {
struct kobject *ksobj = >kset->kobj;
+
if (ksobj->parent != NULL)
ops = kobj_ns_ops(ksobj->parent);
}
-- 
2.11.0



[PATCH 2/3] kobject: Fix warnings in lib/kobject_uevent.c

2018-10-30 Thread Bo YU
Add a blank after declaration.

Signed-off-by: Bo YU 
---
 lib/kobject_uevent.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 402765c3a9cb..27c6118afd1c 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -240,6 +240,7 @@ static int kobj_usermode_filter(struct kobject *kobj)
ops = kobj_ns_ops(kobj);
if (ops) {
const void *init_ns, *ns;
+
ns = kobj->ktype->namespace(kobj);
init_ns = ops->initial_ns();
return ns != init_ns;
@@ -390,6 +391,7 @@ static int kobject_uevent_net_broadcast(struct kobject 
*kobj,
ops = kobj_ns_ops(kobj);
if (!ops && kobj->kset) {
struct kobject *ksobj = >kset->kobj;
+
if (ksobj->parent != NULL)
ops = kobj_ns_ops(ksobj->parent);
}
-- 
2.11.0



[PATCH 3/3] kobject: fix warnings use pr_* to replace printk

2018-10-30 Thread Bo YU
Fix warning from checkpatch.pl use pr_* to replace printk

Signed-off-by: Bo YU 
---
 lib/kobject_uevent.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 27c6118afd1c..c87a96c4800e 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -224,7 +224,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
 out:
if (r) {
devpath = kobject_get_path(kobj, GFP_KERNEL);
-   printk(KERN_WARNING "synth uevent: %s: %s",
+   pr_warn("synth uevent: %s: %s",
   devpath ?: "unknown device",
   msg ?: "failed to send uevent");
kfree(devpath);
@@ -765,8 +765,7 @@ static int uevent_net_init(struct net *net)

ue_sk->sk = netlink_kernel_create(net, NETLINK_KOBJECT_UEVENT, );
if (!ue_sk->sk) {
-   printk(KERN_ERR
-  "kobject_uevent: unable to create netlink socket!\n");
+   pr_err("kobject_uevent: unable to create netlink socket!\n");
kfree(ue_sk);
return -ENODEV;
}
--
2.11.0



[PATCH 3/3] kobject: fix warnings use pr_* to replace printk

2018-10-30 Thread Bo YU
Fix warning from checkpatch.pl use pr_* to replace printk

Signed-off-by: Bo YU 
---
 lib/kobject_uevent.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 27c6118afd1c..c87a96c4800e 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -224,7 +224,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char 
*buf, size_t count)
 out:
if (r) {
devpath = kobject_get_path(kobj, GFP_KERNEL);
-   printk(KERN_WARNING "synth uevent: %s: %s",
+   pr_warn("synth uevent: %s: %s",
   devpath ?: "unknown device",
   msg ?: "failed to send uevent");
kfree(devpath);
@@ -765,8 +765,7 @@ static int uevent_net_init(struct net *net)

ue_sk->sk = netlink_kernel_create(net, NETLINK_KOBJECT_UEVENT, );
if (!ue_sk->sk) {
-   printk(KERN_ERR
-  "kobject_uevent: unable to create netlink socket!\n");
+   pr_err("kobject_uevent: unable to create netlink socket!\n");
kfree(ue_sk);
return -ENODEV;
}
--
2.11.0



[PATCH 1/3] kobject: drop unnecessary cast "%llu" for u64

2018-10-30 Thread Bo YU
There is no searon for u64 var cast to unsigned long long type.

Signed-off-by: Bo YU 
---
 lib/kobject_uevent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 63d0816ab23b..402765c3a9cb 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -579,7 +579,7 @@ int kobject_uevent_env(struct kobject *kobj, enum 
kobject_action action,

mutex_lock(_sock_mutex);
/* we will send an event, so request a new sequence number */
-   retval = add_uevent_var(env, "SEQNUM=%llu", (unsigned long 
long)++uevent_seqnum);
+   retval = add_uevent_var(env, "SEQNUM=%llu", ++uevent_seqnum);
if (retval) {
mutex_unlock(_sock_mutex);
goto exit;
--
2.11.0



[PATCH 1/3] kobject: drop unnecessary cast "%llu" for u64

2018-10-30 Thread Bo YU
There is no searon for u64 var cast to unsigned long long type.

Signed-off-by: Bo YU 
---
 lib/kobject_uevent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 63d0816ab23b..402765c3a9cb 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -579,7 +579,7 @@ int kobject_uevent_env(struct kobject *kobj, enum 
kobject_action action,

mutex_lock(_sock_mutex);
/* we will send an event, so request a new sequence number */
-   retval = add_uevent_var(env, "SEQNUM=%llu", (unsigned long 
long)++uevent_seqnum);
+   retval = add_uevent_var(env, "SEQNUM=%llu", ++uevent_seqnum);
if (retval) {
mutex_unlock(_sock_mutex);
goto exit;
--
2.11.0



[PATCH 0/3] kobject: fix warnings from ehcekpatch.pl

2018-10-30 Thread Bo YU
Hi,this is a series of patches which fix warning from checkpatch.pl.
I do not know which tree should apply these patches,so i git format-patch
from linus' s kernel tree.

Bo YU (3):
  kobject: drop unnecessary cast "%llu" for u64
  kobject: Fix warnings in lib/kobject_uevent.c
  kobject: fix warnings use pr_* to replace  printk

 lib/kobject_uevent.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

--
2.11.0



[PATCH 0/3] kobject: fix warnings from ehcekpatch.pl

2018-10-30 Thread Bo YU
Hi,this is a series of patches which fix warning from checkpatch.pl.
I do not know which tree should apply these patches,so i git format-patch
from linus' s kernel tree.

Bo YU (3):
  kobject: drop unnecessary cast "%llu" for u64
  kobject: Fix warnings in lib/kobject_uevent.c
  kobject: fix warnings use pr_* to replace  printk

 lib/kobject_uevent.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

--
2.11.0



Re: [V9fs-developer] [PATCH] fs/9p: don't set SB_NOATIME by default

2018-02-25 Thread Bo YU

Hi,
I think you would better to modify the subject line without
[V9fs-developers].
On Mon, Feb 26, 2018 at 09:34:49AM +0800, jiangyiwen wrote:

On 2018/2/24 10:47, jiangyiwen wrote:

On 2018/2/9 14:13, jiangyiwen wrote:

User use some syscall, for example mmap(v9fs_file_mmap), it will not
update atime even if user's mnt_flags have MNT_NOATIME, because
v9fs default set SB_NOATIME in v9fs_set_super.

For supporting access time is updated when user mount with relatime,
we should clear SB_NOATIME by default.

Signed-off-by: Yiwen Jiang 
---
 fs/9p/vfs_super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index af03c2a..48ce504 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -94,7 +94,7 @@ static int v9fs_set_super(struct super_block *s, void *data)
if (v9ses->cache)
sb->s_bdi->ra_pages = (VM_MAX_READAHEAD * 1024)/PAGE_SIZE;

-   sb->s_flags |= SB_ACTIVE | SB_DIRSYNC | SB_NOATIME;
+   sb->s_flags |= SB_ACTIVE | SB_DIRSYNC;
if (!v9ses->cache)
sb->s_flags |= SB_SYNCHRONOUS;


Hi Alexander Viro and Eric,

My patch has already sent two weeks, but nobody help me
to review, I have a question about now who is the v9fs's
maintainer? Or who can help me review the patch?

I hope v9fs's maintainer can give me some advices or
merge into the mainline if it has no problem.

Thanks,
Yiwen.


Hi Andrew,

My patch has already sent more than two weeks, but nobody
help me to review, I have a question about now who is the
v9fs's maintainer? Or who can help me review the patch?


There is no maintainer with V9fs  in get_maintain.pl and V9fs git tree
laterest commit before two years.so,situation become bad.
Maybe you eamil linus directly,although this is't good

I hope v9fs's maintainer can give me some advices or
merge into the mainline if it has no problem.

Thanks,
Yiwen.

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [V9fs-developer] [PATCH] fs/9p: don't set SB_NOATIME by default

2018-02-25 Thread Bo YU

Hi,
I think you would better to modify the subject line without
[V9fs-developers].
On Mon, Feb 26, 2018 at 09:34:49AM +0800, jiangyiwen wrote:

On 2018/2/24 10:47, jiangyiwen wrote:

On 2018/2/9 14:13, jiangyiwen wrote:

User use some syscall, for example mmap(v9fs_file_mmap), it will not
update atime even if user's mnt_flags have MNT_NOATIME, because
v9fs default set SB_NOATIME in v9fs_set_super.

For supporting access time is updated when user mount with relatime,
we should clear SB_NOATIME by default.

Signed-off-by: Yiwen Jiang 
---
 fs/9p/vfs_super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index af03c2a..48ce504 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -94,7 +94,7 @@ static int v9fs_set_super(struct super_block *s, void *data)
if (v9ses->cache)
sb->s_bdi->ra_pages = (VM_MAX_READAHEAD * 1024)/PAGE_SIZE;

-   sb->s_flags |= SB_ACTIVE | SB_DIRSYNC | SB_NOATIME;
+   sb->s_flags |= SB_ACTIVE | SB_DIRSYNC;
if (!v9ses->cache)
sb->s_flags |= SB_SYNCHRONOUS;


Hi Alexander Viro and Eric,

My patch has already sent two weeks, but nobody help me
to review, I have a question about now who is the v9fs's
maintainer? Or who can help me review the patch?

I hope v9fs's maintainer can give me some advices or
merge into the mainline if it has no problem.

Thanks,
Yiwen.


Hi Andrew,

My patch has already sent more than two weeks, but nobody
help me to review, I have a question about now who is the
v9fs's maintainer? Or who can help me review the patch?


There is no maintainer with V9fs  in get_maintain.pl and V9fs git tree
laterest commit before two years.so,situation become bad.
Maybe you eamil linus directly,although this is't good

I hope v9fs's maintainer can give me some advices or
merge into the mainline if it has no problem.

Thanks,
Yiwen.

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] netlink: put module reference if dump start fails

2018-02-21 Thread Bo YU

Hi,
On Wed, Feb 21, 2018 at 04:41:05PM +0100, Jason A. Donenfeld wrote:

Fixes: 41c87425a1ac ("netlink: do not set cb_running if dump's start() errs")

I think you Would better to resend it.

Bo,


Re: [PATCH] netlink: put module reference if dump start fails

2018-02-21 Thread Bo YU

Hi,
On Wed, Feb 21, 2018 at 04:41:05PM +0100, Jason A. Donenfeld wrote:

Fixes: 41c87425a1ac ("netlink: do not set cb_running if dump's start() errs")

I think you Would better to resend it.

Bo,


Re: [PATCH] netxen: Fix a sleep-in-atomic bug in netxen_nic_pci_mem_access_direct

2017-06-21 Thread Bo Yu

Hi,
On Wed, Jun 21, 2017 at 02:33:03PM +0800, Jia-Ju Bai wrote:

On 06/21/2017 02:11 PM, Kalle Valo wrote:

David Miller  writes:


From: Jia-Ju Bai
Date: Mon, 19 Jun 2017 10:48:53 +0800


The driver may sleep under a spin lock, and the function call path is:
netxen_nic_pci_mem_access_direct (acquire the lock by spin_lock)
  ioremap -->  may sleep

To fix it, the lock is released before "ioremap", and the lock is
acquired again after this function.

Signed-off-by: Jia-Ju Bai

This style of change you are making is really starting to be a
problem.

You can't just drop locks like this, especially without explaining
why it's ok, and why the mutual exclusion this code was trying to
achieve is still going to be OK afterwards.

In fact, I see zero analysis of the locking situation here, why
it was needed in the first place, and why your change is OK in
that context.

Any locking change is delicate, and you must put the greatest of
care and consideration into it.

Just putting "unlock/lock" around the sleeping operation shows a
very low level of consideration for the implications of the change
you are making.

This isn't like making whitespace fixes, sorry...

We already tried to explain this to Jia-Ju during review of a wireless
patch:

https://patchwork.kernel.org/patch/9756585/

Jia-Ju, you should listen to feedback. If you continue submitting random
patches like this makes it hard for maintainers to trust your patches
anymore.


Hi,

I am quite sorry for my incorrect patches, and I will listen carefully
to your advice.
In fact, for some bugs and patches which I have reported before, I
have not received the feedback of them, so I resent them a few days
ago, including this patch.
Sorry for my mistake again.


Once your patch be accepted, maintainer will reply you by mail sent by
automatic or themselves.But for your patch(es),i think most of them will
be dropped silently, because (un)lock related operations is very
criticality, especially in kernel code. Maintainers will not accept
unsafe (un)lock code.

Best Regards


Thanks,
Jia-Ju Bai



Re: [PATCH] netxen: Fix a sleep-in-atomic bug in netxen_nic_pci_mem_access_direct

2017-06-21 Thread Bo Yu

Hi,
On Wed, Jun 21, 2017 at 02:33:03PM +0800, Jia-Ju Bai wrote:

On 06/21/2017 02:11 PM, Kalle Valo wrote:

David Miller  writes:


From: Jia-Ju Bai
Date: Mon, 19 Jun 2017 10:48:53 +0800


The driver may sleep under a spin lock, and the function call path is:
netxen_nic_pci_mem_access_direct (acquire the lock by spin_lock)
  ioremap -->  may sleep

To fix it, the lock is released before "ioremap", and the lock is
acquired again after this function.

Signed-off-by: Jia-Ju Bai

This style of change you are making is really starting to be a
problem.

You can't just drop locks like this, especially without explaining
why it's ok, and why the mutual exclusion this code was trying to
achieve is still going to be OK afterwards.

In fact, I see zero analysis of the locking situation here, why
it was needed in the first place, and why your change is OK in
that context.

Any locking change is delicate, and you must put the greatest of
care and consideration into it.

Just putting "unlock/lock" around the sleeping operation shows a
very low level of consideration for the implications of the change
you are making.

This isn't like making whitespace fixes, sorry...

We already tried to explain this to Jia-Ju during review of a wireless
patch:

https://patchwork.kernel.org/patch/9756585/

Jia-Ju, you should listen to feedback. If you continue submitting random
patches like this makes it hard for maintainers to trust your patches
anymore.


Hi,

I am quite sorry for my incorrect patches, and I will listen carefully
to your advice.
In fact, for some bugs and patches which I have reported before, I
have not received the feedback of them, so I resent them a few days
ago, including this patch.
Sorry for my mistake again.


Once your patch be accepted, maintainer will reply you by mail sent by
automatic or themselves.But for your patch(es),i think most of them will
be dropped silently, because (un)lock related operations is very
criticality, especially in kernel code. Maintainers will not accept
unsafe (un)lock code.

Best Regards


Thanks,
Jia-Ju Bai



Re: [PATCH V3 net-next 1/8] net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC

2017-06-18 Thread Bo Yu

Hi,
On Sat, Jun 17, 2017 at 06:24:24PM +0100, Salil Mehta wrote:

+   struct notifier_block notifier_block;
+   /* Vxlan/Geneve information */
+   struct hns3_udp_tunnel udp_tnl[HNS3_UDP_TNL_MAX];
+};
+
+/* the distance between [begin, end) in a ring buffer
+ * note: there is a unuse slot between the begin and the end
+ */
+static inline int ring_dist(struct hns3_enet_ring *ring, int begin, int end)
+{
+   return (end - begin + ring->desc_num) % ring->desc_num;
+}
+
+static inline int ring_space(struct hns3_enet_ring *ring)
+{
+   return ring->desc_num -
+   ring_dist(ring, ring->next_to_clean, ring->next_to_use) - 1;
+}
+
+static inline int is_ring_empty(struct hns3_enet_ring *ring)
+{
+   return ring->next_to_use == ring->next_to_clean;
+}
+
+static inline void hns3_write_reg(void __iomem *base, u32 reg, u32 value)
+{
+   u8 __iomem *reg_addr = READ_ONCE(base);
+
+   writel(value, reg_addr + reg);
+}
+
+#define hns3_write_dev(a, reg, value) \
+   hns3_write_reg((a)->io_base, (reg), (value))
+
+#define hnae_queue_xmit(tqp, buf_num) writel_relaxed(buf_num, \
+   (tqp)->io_base + HNS3_RING_TX_RING_TAIL_REG)
+
+#define ring_to_dev(ring) (&(ring)->tqp->handle->pdev->dev)
+
+#define ring_to_dma_dir(ring) (HNAE3_IS_TX_RING(ring) ? \
+   DMA_TO_DEVICE : DMA_FROM_DEVICE)
+
+#define tx_ring_data(priv, idx) ((priv)->ring_data[idx])
+
+#define hnae_buf_size(_ring) ((_ring)->buf_size)
+#define hnae_page_order(_ring) (get_order(hnae_buf_size(_ring)))
+#define hnae_page_size(_ring) (PAGE_SIZE << hnae_page_order(_ring))
+
+/* iterator for handling rings in ring group */
+#define hns3_for_each_ring(pos, head) \
+   for (pos = (head).ring; pos != NULL; pos = pos->next)


Only a pos? Comparsion to NULL could be written "pos" noticed by
checkpatch.



+
+void hns3_ethtool_set_ops(struct net_device *ndev);
+
+int hns3_nic_net_xmit_hw(
+   struct net_device *ndev,
+   struct sk_buff *skb,
+   struct hns3_nic_ring_data *ring_data);
+int hns3_clean_tx_ring(struct hns3_enet_ring *ring, int budget);
+int hns3_clean_rx_ring_ex(
+   struct hns3_enet_ring *ring,
+   struct sk_buff **skb_ex,
+   int budget);
+#endif
--
2.7.4




Re: [PATCH V3 net-next 1/8] net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC

2017-06-18 Thread Bo Yu

Hi,
On Sat, Jun 17, 2017 at 06:24:24PM +0100, Salil Mehta wrote:

+   struct notifier_block notifier_block;
+   /* Vxlan/Geneve information */
+   struct hns3_udp_tunnel udp_tnl[HNS3_UDP_TNL_MAX];
+};
+
+/* the distance between [begin, end) in a ring buffer
+ * note: there is a unuse slot between the begin and the end
+ */
+static inline int ring_dist(struct hns3_enet_ring *ring, int begin, int end)
+{
+   return (end - begin + ring->desc_num) % ring->desc_num;
+}
+
+static inline int ring_space(struct hns3_enet_ring *ring)
+{
+   return ring->desc_num -
+   ring_dist(ring, ring->next_to_clean, ring->next_to_use) - 1;
+}
+
+static inline int is_ring_empty(struct hns3_enet_ring *ring)
+{
+   return ring->next_to_use == ring->next_to_clean;
+}
+
+static inline void hns3_write_reg(void __iomem *base, u32 reg, u32 value)
+{
+   u8 __iomem *reg_addr = READ_ONCE(base);
+
+   writel(value, reg_addr + reg);
+}
+
+#define hns3_write_dev(a, reg, value) \
+   hns3_write_reg((a)->io_base, (reg), (value))
+
+#define hnae_queue_xmit(tqp, buf_num) writel_relaxed(buf_num, \
+   (tqp)->io_base + HNS3_RING_TX_RING_TAIL_REG)
+
+#define ring_to_dev(ring) (&(ring)->tqp->handle->pdev->dev)
+
+#define ring_to_dma_dir(ring) (HNAE3_IS_TX_RING(ring) ? \
+   DMA_TO_DEVICE : DMA_FROM_DEVICE)
+
+#define tx_ring_data(priv, idx) ((priv)->ring_data[idx])
+
+#define hnae_buf_size(_ring) ((_ring)->buf_size)
+#define hnae_page_order(_ring) (get_order(hnae_buf_size(_ring)))
+#define hnae_page_size(_ring) (PAGE_SIZE << hnae_page_order(_ring))
+
+/* iterator for handling rings in ring group */
+#define hns3_for_each_ring(pos, head) \
+   for (pos = (head).ring; pos != NULL; pos = pos->next)


Only a pos? Comparsion to NULL could be written "pos" noticed by
checkpatch.



+
+void hns3_ethtool_set_ops(struct net_device *ndev);
+
+int hns3_nic_net_xmit_hw(
+   struct net_device *ndev,
+   struct sk_buff *skb,
+   struct hns3_nic_ring_data *ring_data);
+int hns3_clean_tx_ring(struct hns3_enet_ring *ring, int budget);
+int hns3_clean_rx_ring_ex(
+   struct hns3_enet_ring *ring,
+   struct sk_buff **skb_ex,
+   int budget);
+#endif
--
2.7.4




Re: [PATCH V3 net-next 2/8] net: hns3: Add support of the HNAE3 framework

2017-06-18 Thread Bo Yu

Hi,
On Sat, Jun 17, 2017 at 06:24:25PM +0100, Salil Mehta wrote:

+ *   Unregister client from ae_dev
+ * start()
+ *   Enable the hardware
+ * stop()
+ *   Disable the hardware
+ * get_status()
+ *   Get the carrier state of the back channel of the handle, 1 for ok, 0 for
+ *   non-ok
+ * get_ksettings_an_result()
+ *   Get negotiation status,speed and duplex
+ * update_speed_duplex_h()
+ *   Update hardware speed and duplex
+ * get_media_type()
+ *   Get media type of MAC
+ * adjust_link()
+ *   Adjust link status
+ * set_loopback()
+ *   Set loopback
+ * set_promisc_mode
+ *   Set promisc mode
+ * set_mtu()
+ *   set mtu
+ * get_pauseparam()
+ *   get tx and rx of pause frame use
+ * set_pauseparam()
+ *   set tx and rx of pause frame use
+ * set_autoneg()
+ *   set auto autonegotiation of pause frame use
+ * get_autoneg()
+ *   get auto autonegotiation of pause frame use
+ * get_coalesce_usecs()
+ *   get usecs to delay a TX interrupt after a packet is sent
+ * get_rx_max_coalesced_frames()
+ *   get Maximum number of packets to be sent before a TX interrupt.
+ * set_coalesce_usecs()
+ *   set usecs to delay a TX interrupt after a packet is sent
+ * set_coalesce_frames()
+ *   set Maximum number of packets to be sent before a TX interrupt.
+ * get_mac_addr()
+ *   get mac address
+ * set_mac_addr()
+ *   set mac address
+ * add_uc_addr
+ *   Add unicast addr to mac table
+ * rm_uc_addr
+ *   Remove unicast addr from mac table
+ * set_mc_addr()
+ *   Set multicast address
+ * add_mc_addr
+ *   Add multicast address to mac table
+ * rm_mc_addr
+ *   Remove multicast address from mac table
+ * update_stats()
+ *   Update Old network device statistics
+ * get_ethtool_stats()
+ *   Get ethtool network device statistics
+ * get_strings()
+ *   Get a set of strings that describe the requested objects
+ * get_sset_count()
+ *   Get number of strings that @get_strings will write
+ * update_led_status()
+ *   Update the led status
+ * set_led_id()
+ *   Set led id
+ * get_regs()
+ *   Get regs dump
+ * get_regs_len()
+ *   Get the len of the regs dump
+ * get_rss_key_size()
+ *   Get rss key size
+ * get_rss_indir_size()
+ *   Get rss indirection table size
+ * get_rss()
+ *   Get rss table
+ * set_rss()
+ *   Set rss table
+ * get_tc_size()
+ *   Get tc size of handle
+ * get_vector()
+ *   Get vector number and vector infomation


Just another spealling : information

Checkpatch will report it also.


+ * map_ring_to_vector()
+ *   Map rings to vector
+ * unmap_ring_from_vector()
+ *   Unmap rings from vector
+ * add_tunnel_udp()
+ *   Add tunnel information to hardware
+ * del_tunnel_udp()
+ *   Delete tunnel information from hardware
+ * reset_queue()
+ *   Reset queue
+ * get_fw_version()
+ *   Get firmware version
+ * get_mdix_mode()
+ *   Get media typr of phy
+ * set_vlan_filter()
+ *   Set vlan filter config of Ports
+ * set_vf_vlan_filter()
+ *   Set vlan filter config of vf
+ */
+struct hnae3_ae_ops {
+   int (*init_ae_dev)(struct hnae3_ae_dev *ae_dev);
+   void (*uninit_ae_dev)(struct hnae3_ae_dev *ae_dev);
+
+   int (*register_client)(struct hnae3_client *client,
+  struct hnae3_ae_dev *ae_dev);
+   void (*unregister_client)(struct hnae3_client *client,
+ struct hnae3_ae_dev *ae_dev);
+   int (*start)(struct hnae3_handle *handle);
+   void (*stop)(struct hnae3_handle *handle);
+   int (*get_status)(struct hnae3_handle *handle);
+   void (*get_ksettings_an_result)(struct hnae3_handle *handle,
+   u8 *auto_neg, u32 *speed, u8 *duplex);
+
+   int (*update_speed_duplex_h)(struct hnae3_handle *handle);
+   int (*cfg_mac_speed_dup_h)(struct hnae3_handle *handle, int speed,
+  u8 duplex);
+
+   void (*get_media_type)(struct hnae3_handle *handle, u8 *media_type);
+   void (*adjust_link)(struct hnae3_handle *handle, int speed, int duplex);
+   int (*set_loopback)(struct hnae3_handle *handle,
+   enum hnae3_loop loop_mode, bool en);
+
+   void (*set_promisc_mode)(struct hnae3_handle *handle, u32 en);
+   int (*set_mtu)(struct hnae3_handle *handle, int new_mtu);
+
+   void (*get_pauseparam)(struct hnae3_handle *handle,
+  u32 *auto_neg, u32 *rx_en, u32 *tx_en);
+   int (*set_pauseparam)(struct hnae3_handle *handle,
+ u32 auto_neg, u32 rx_en, u32 tx_en);
+
+   int (*set_autoneg)(struct hnae3_handle *handle, bool enable);
+   int (*get_autoneg)(struct hnae3_handle *handle);
+
+   void (*get_coalesce_usecs)(struct hnae3_handle *handle,
+  u32 *tx_usecs, u32 *rx_usecs);
+   void (*get_rx_max_coalesced_frames)(struct hnae3_handle *handle,
+   u32 *tx_frames, u32 *rx_frames);
+   int (*set_coalesce_usecs)(struct hnae3_handle *handle, u32 timeout);
+ 

Re: [PATCH V3 net-next 2/8] net: hns3: Add support of the HNAE3 framework

2017-06-18 Thread Bo Yu

Hi,
On Sat, Jun 17, 2017 at 06:24:25PM +0100, Salil Mehta wrote:

+ *   Unregister client from ae_dev
+ * start()
+ *   Enable the hardware
+ * stop()
+ *   Disable the hardware
+ * get_status()
+ *   Get the carrier state of the back channel of the handle, 1 for ok, 0 for
+ *   non-ok
+ * get_ksettings_an_result()
+ *   Get negotiation status,speed and duplex
+ * update_speed_duplex_h()
+ *   Update hardware speed and duplex
+ * get_media_type()
+ *   Get media type of MAC
+ * adjust_link()
+ *   Adjust link status
+ * set_loopback()
+ *   Set loopback
+ * set_promisc_mode
+ *   Set promisc mode
+ * set_mtu()
+ *   set mtu
+ * get_pauseparam()
+ *   get tx and rx of pause frame use
+ * set_pauseparam()
+ *   set tx and rx of pause frame use
+ * set_autoneg()
+ *   set auto autonegotiation of pause frame use
+ * get_autoneg()
+ *   get auto autonegotiation of pause frame use
+ * get_coalesce_usecs()
+ *   get usecs to delay a TX interrupt after a packet is sent
+ * get_rx_max_coalesced_frames()
+ *   get Maximum number of packets to be sent before a TX interrupt.
+ * set_coalesce_usecs()
+ *   set usecs to delay a TX interrupt after a packet is sent
+ * set_coalesce_frames()
+ *   set Maximum number of packets to be sent before a TX interrupt.
+ * get_mac_addr()
+ *   get mac address
+ * set_mac_addr()
+ *   set mac address
+ * add_uc_addr
+ *   Add unicast addr to mac table
+ * rm_uc_addr
+ *   Remove unicast addr from mac table
+ * set_mc_addr()
+ *   Set multicast address
+ * add_mc_addr
+ *   Add multicast address to mac table
+ * rm_mc_addr
+ *   Remove multicast address from mac table
+ * update_stats()
+ *   Update Old network device statistics
+ * get_ethtool_stats()
+ *   Get ethtool network device statistics
+ * get_strings()
+ *   Get a set of strings that describe the requested objects
+ * get_sset_count()
+ *   Get number of strings that @get_strings will write
+ * update_led_status()
+ *   Update the led status
+ * set_led_id()
+ *   Set led id
+ * get_regs()
+ *   Get regs dump
+ * get_regs_len()
+ *   Get the len of the regs dump
+ * get_rss_key_size()
+ *   Get rss key size
+ * get_rss_indir_size()
+ *   Get rss indirection table size
+ * get_rss()
+ *   Get rss table
+ * set_rss()
+ *   Set rss table
+ * get_tc_size()
+ *   Get tc size of handle
+ * get_vector()
+ *   Get vector number and vector infomation


Just another spealling : information

Checkpatch will report it also.


+ * map_ring_to_vector()
+ *   Map rings to vector
+ * unmap_ring_from_vector()
+ *   Unmap rings from vector
+ * add_tunnel_udp()
+ *   Add tunnel information to hardware
+ * del_tunnel_udp()
+ *   Delete tunnel information from hardware
+ * reset_queue()
+ *   Reset queue
+ * get_fw_version()
+ *   Get firmware version
+ * get_mdix_mode()
+ *   Get media typr of phy
+ * set_vlan_filter()
+ *   Set vlan filter config of Ports
+ * set_vf_vlan_filter()
+ *   Set vlan filter config of vf
+ */
+struct hnae3_ae_ops {
+   int (*init_ae_dev)(struct hnae3_ae_dev *ae_dev);
+   void (*uninit_ae_dev)(struct hnae3_ae_dev *ae_dev);
+
+   int (*register_client)(struct hnae3_client *client,
+  struct hnae3_ae_dev *ae_dev);
+   void (*unregister_client)(struct hnae3_client *client,
+ struct hnae3_ae_dev *ae_dev);
+   int (*start)(struct hnae3_handle *handle);
+   void (*stop)(struct hnae3_handle *handle);
+   int (*get_status)(struct hnae3_handle *handle);
+   void (*get_ksettings_an_result)(struct hnae3_handle *handle,
+   u8 *auto_neg, u32 *speed, u8 *duplex);
+
+   int (*update_speed_duplex_h)(struct hnae3_handle *handle);
+   int (*cfg_mac_speed_dup_h)(struct hnae3_handle *handle, int speed,
+  u8 duplex);
+
+   void (*get_media_type)(struct hnae3_handle *handle, u8 *media_type);
+   void (*adjust_link)(struct hnae3_handle *handle, int speed, int duplex);
+   int (*set_loopback)(struct hnae3_handle *handle,
+   enum hnae3_loop loop_mode, bool en);
+
+   void (*set_promisc_mode)(struct hnae3_handle *handle, u32 en);
+   int (*set_mtu)(struct hnae3_handle *handle, int new_mtu);
+
+   void (*get_pauseparam)(struct hnae3_handle *handle,
+  u32 *auto_neg, u32 *rx_en, u32 *tx_en);
+   int (*set_pauseparam)(struct hnae3_handle *handle,
+ u32 auto_neg, u32 rx_en, u32 tx_en);
+
+   int (*set_autoneg)(struct hnae3_handle *handle, bool enable);
+   int (*get_autoneg)(struct hnae3_handle *handle);
+
+   void (*get_coalesce_usecs)(struct hnae3_handle *handle,
+  u32 *tx_usecs, u32 *rx_usecs);
+   void (*get_rx_max_coalesced_frames)(struct hnae3_handle *handle,
+   u32 *tx_frames, u32 *rx_frames);
+   int (*set_coalesce_usecs)(struct hnae3_handle *handle, u32 timeout);
+ 

Re: [PATCH V3 net-next 1/8] net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC

2017-06-18 Thread Bo Yu

Hi,
On Sat, Jun 17, 2017 at 06:24:24PM +0100, Salil Mehta wrote:

+static int hns3_fill_desc(struct hns3_enet_ring *ring, void *priv,
+ int size, dma_addr_t dma, int frag_end,
+ enum hns_desc_type type)
+{
+   struct hns3_desc_cb *desc_cb = >desc_cb[ring->next_to_use];
+   struct hns3_desc *desc = >desc[ring->next_to_use];
+   u32 ol_type_vlan_len_msec = 0;
+   u16 bdtp_fe_sc_vld_ra_ri = 0;
+   u32 type_cs_vlan_tso = 0;
+   struct sk_buff *skb;
+   u32 paylen = 0;
+   u16 mss = 0;
+   __be16 protocol;
+   u8 ol4_proto;
+   u8 il4_proto;
+   int ret;
+
+   /* The txbd's baseinfo of DESC_TYPE_PAGE & DESC_TYPE_SKB */
+   desc_cb->priv = priv;
+   desc_cb->length = size;
+   desc_cb->dma = dma;
+   desc_cb->type = type;
+
+   /* now, fill the descriptor */
+   desc->addr = cpu_to_le64(dma);
+   desc->tx.send_size = cpu_to_le16((u16)size);
+   hns3_set_txbd_baseinfo(_fe_sc_vld_ra_ri, frag_end);
+   desc->tx.bdtp_fe_sc_vld_ra_ri = cpu_to_le16(bdtp_fe_sc_vld_ra_ri);
+
+   if (type == DESC_TYPE_SKB) {
+   skb = (struct sk_buff *)priv;
+   paylen = cpu_to_le16(skb->len);
+
+   if (skb->ip_summed == CHECKSUM_PARTIAL) {
+   skb_reset_mac_len(skb);
+   protocol = skb->protocol;
+
+   /* vlan packe t*/


Just a spealling:   /* vlan packet */


+   if (protocol == htons(ETH_P_8021Q)) {
+   protocol = vlan_get_protocol(skb);
+   skb->protocol = protocol;
+   }
+   hns3_get_l4_protocol(skb, _proto, _proto);
+   hns3_set_l2l3l4_len(skb, ol4_proto, il4_proto,
+   _cs_vlan_tso,
+   _type_vlan_len_msec);
+   ret = hns3_set_l3l4_type_csum(skb, ol4_proto, il4_proto,
+ _cs_vlan_tso,
+ _type_vlan_len_msec);
+   if (ret)
+   return ret;
+
+   ret = hns3_set_tso(skb, , ,
+  _cs_vlan_tso);
+   if (ret)
+   return ret;
+   }
+
+   /* Set txbd */
+   desc->tx.ol_type_vlan_len_msec =
+   cpu_to_le32(ol_type_vlan_len_msec);
+   desc->tx.type_cs_vlan_tso_len =
+   cpu_to_le32(type_cs_vlan_tso);
+   desc->tx.paylen = cpu_to_le16(paylen);
+   desc->tx.mss = cpu_to_le16(mss);
+   }
+
+   /* move ring pointer to next.*/
+   ring_ptr_move_fw(ring, next_to_use);
+
+   return 0;
+}
+
+static int hns3_fill_desc_tso(struct hns3_enet_ring *ring, void *priv,
+ int size, dma_addr_t dma, int frag_end,
+ enum hns_desc_type type)
+{
+   int frag_buf_num;
+   int sizeoflast;
+   int ret, k;
+
+   frag_buf_num = (size + HNS3_MAX_BD_SIZE - 1) / HNS3_MAX_BD_SIZE;
+   sizeoflast = size % HNS3_MAX_BD_SIZE;
+   sizeoflast = sizeoflast ? sizeoflast : HNS3_MAX_BD_SIZE;
+
+   /* When the frag size is bigger than hardware, split this frag */
+   for (k = 0; k < frag_buf_num; k++) {
+   ret = hns3_fill_desc(ring, priv,
+(k == frag_buf_num - 1) ?
+   sizeoflast : HNS3_MAX_BD_SIZE,
+   dma + HNS3_MAX_BD_SIZE * k,
+   frag_end && (k == frag_buf_num - 1) ? 1 : 0,
+   (type == DESC_TYPE_SKB && !k) ?
+   DESC_TYPE_SKB : DESC_TYPE_PAGE);
+   if (ret)
+   return ret;
+   }
+
+   return 0;
+}
+
+static int hns3_nic_maybe_stop_tso(struct sk_buff **out_skb, int *bnum,
+  struct hns3_enet_ring *ring)
+{
+   struct sk_buff *skb = *out_skb;
+   struct skb_frag_struct *frag;
+   int bdnum_for_frag;
+   int frag_num;
+   int buf_num;
+   int size;
+   int i;
+
+   size = skb_headlen(skb);
+   buf_num = (size + HNS3_MAX_BD_SIZE - 1) / HNS3_MAX_BD_SIZE;
+
+   frag_num = skb_shinfo(skb)->nr_frags;
+   for (i = 0; i < frag_num; i++) {
+   frag = _shinfo(skb)->frags[i];
+   size = skb_frag_size(frag);
+   bdnum_for_frag =
+   (size + HNS3_MAX_BD_SIZE - 1) / HNS3_MAX_BD_SIZE;
+   if (bdnum_for_frag > HNS3_MAX_BD_PER_FRAG)
+   return -ENOMEM;
+
+   buf_num += bdnum_for_frag;
+   }
+
+   if (buf_num > ring_space(ring))
+   

Re: [PATCH V3 net-next 1/8] net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC

2017-06-18 Thread Bo Yu

Hi,
On Sat, Jun 17, 2017 at 06:24:24PM +0100, Salil Mehta wrote:

+static int hns3_fill_desc(struct hns3_enet_ring *ring, void *priv,
+ int size, dma_addr_t dma, int frag_end,
+ enum hns_desc_type type)
+{
+   struct hns3_desc_cb *desc_cb = >desc_cb[ring->next_to_use];
+   struct hns3_desc *desc = >desc[ring->next_to_use];
+   u32 ol_type_vlan_len_msec = 0;
+   u16 bdtp_fe_sc_vld_ra_ri = 0;
+   u32 type_cs_vlan_tso = 0;
+   struct sk_buff *skb;
+   u32 paylen = 0;
+   u16 mss = 0;
+   __be16 protocol;
+   u8 ol4_proto;
+   u8 il4_proto;
+   int ret;
+
+   /* The txbd's baseinfo of DESC_TYPE_PAGE & DESC_TYPE_SKB */
+   desc_cb->priv = priv;
+   desc_cb->length = size;
+   desc_cb->dma = dma;
+   desc_cb->type = type;
+
+   /* now, fill the descriptor */
+   desc->addr = cpu_to_le64(dma);
+   desc->tx.send_size = cpu_to_le16((u16)size);
+   hns3_set_txbd_baseinfo(_fe_sc_vld_ra_ri, frag_end);
+   desc->tx.bdtp_fe_sc_vld_ra_ri = cpu_to_le16(bdtp_fe_sc_vld_ra_ri);
+
+   if (type == DESC_TYPE_SKB) {
+   skb = (struct sk_buff *)priv;
+   paylen = cpu_to_le16(skb->len);
+
+   if (skb->ip_summed == CHECKSUM_PARTIAL) {
+   skb_reset_mac_len(skb);
+   protocol = skb->protocol;
+
+   /* vlan packe t*/


Just a spealling:   /* vlan packet */


+   if (protocol == htons(ETH_P_8021Q)) {
+   protocol = vlan_get_protocol(skb);
+   skb->protocol = protocol;
+   }
+   hns3_get_l4_protocol(skb, _proto, _proto);
+   hns3_set_l2l3l4_len(skb, ol4_proto, il4_proto,
+   _cs_vlan_tso,
+   _type_vlan_len_msec);
+   ret = hns3_set_l3l4_type_csum(skb, ol4_proto, il4_proto,
+ _cs_vlan_tso,
+ _type_vlan_len_msec);
+   if (ret)
+   return ret;
+
+   ret = hns3_set_tso(skb, , ,
+  _cs_vlan_tso);
+   if (ret)
+   return ret;
+   }
+
+   /* Set txbd */
+   desc->tx.ol_type_vlan_len_msec =
+   cpu_to_le32(ol_type_vlan_len_msec);
+   desc->tx.type_cs_vlan_tso_len =
+   cpu_to_le32(type_cs_vlan_tso);
+   desc->tx.paylen = cpu_to_le16(paylen);
+   desc->tx.mss = cpu_to_le16(mss);
+   }
+
+   /* move ring pointer to next.*/
+   ring_ptr_move_fw(ring, next_to_use);
+
+   return 0;
+}
+
+static int hns3_fill_desc_tso(struct hns3_enet_ring *ring, void *priv,
+ int size, dma_addr_t dma, int frag_end,
+ enum hns_desc_type type)
+{
+   int frag_buf_num;
+   int sizeoflast;
+   int ret, k;
+
+   frag_buf_num = (size + HNS3_MAX_BD_SIZE - 1) / HNS3_MAX_BD_SIZE;
+   sizeoflast = size % HNS3_MAX_BD_SIZE;
+   sizeoflast = sizeoflast ? sizeoflast : HNS3_MAX_BD_SIZE;
+
+   /* When the frag size is bigger than hardware, split this frag */
+   for (k = 0; k < frag_buf_num; k++) {
+   ret = hns3_fill_desc(ring, priv,
+(k == frag_buf_num - 1) ?
+   sizeoflast : HNS3_MAX_BD_SIZE,
+   dma + HNS3_MAX_BD_SIZE * k,
+   frag_end && (k == frag_buf_num - 1) ? 1 : 0,
+   (type == DESC_TYPE_SKB && !k) ?
+   DESC_TYPE_SKB : DESC_TYPE_PAGE);
+   if (ret)
+   return ret;
+   }
+
+   return 0;
+}
+
+static int hns3_nic_maybe_stop_tso(struct sk_buff **out_skb, int *bnum,
+  struct hns3_enet_ring *ring)
+{
+   struct sk_buff *skb = *out_skb;
+   struct skb_frag_struct *frag;
+   int bdnum_for_frag;
+   int frag_num;
+   int buf_num;
+   int size;
+   int i;
+
+   size = skb_headlen(skb);
+   buf_num = (size + HNS3_MAX_BD_SIZE - 1) / HNS3_MAX_BD_SIZE;
+
+   frag_num = skb_shinfo(skb)->nr_frags;
+   for (i = 0; i < frag_num; i++) {
+   frag = _shinfo(skb)->frags[i];
+   size = skb_frag_size(frag);
+   bdnum_for_frag =
+   (size + HNS3_MAX_BD_SIZE - 1) / HNS3_MAX_BD_SIZE;
+   if (bdnum_for_frag > HNS3_MAX_BD_PER_FRAG)
+   return -ENOMEM;
+
+   buf_num += bdnum_for_frag;
+   }
+
+   if (buf_num > ring_space(ring))
+   

[PATCH] Staging: iio: return expression instead of return ret

2017-03-09 Thread Bo Yu

The following Coccinelle script was used to detect this:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
  e;
-return ret;

Signed-off-by: Bo YU <tsu.y...@gmail.com>
---
  drivers/staging/iio/meter/ade7754.c |3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7754.c 
b/drivers/staging/iio/meter/ade7754.c
index 024463a11c47..19f8cb144768 100644
--- a/drivers/staging/iio/meter/ade7754.c
+++ b/drivers/staging/iio/meter/ade7754.c
@@ -349,9 +349,8 @@ static int ade7754_set_irq(struct device *dev, bool enable)
else
irqen &= ~BIT(14);

-   ret = ade7754_spi_write_reg_16(dev, ADE7754_IRQEN, irqen);
+   return ade7754_spi_write_reg_16(dev, ADE7754_IRQEN, irqen);

-   return ret;
  }

  /* Power down the device */
--
1.7.10.4



[PATCH] Staging: iio: return expression instead of return ret

2017-03-09 Thread Bo Yu

The following Coccinelle script was used to detect this:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
  e;
-return ret;

Signed-off-by: Bo YU 
---
  drivers/staging/iio/meter/ade7754.c |3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7754.c 
b/drivers/staging/iio/meter/ade7754.c
index 024463a11c47..19f8cb144768 100644
--- a/drivers/staging/iio/meter/ade7754.c
+++ b/drivers/staging/iio/meter/ade7754.c
@@ -349,9 +349,8 @@ static int ade7754_set_irq(struct device *dev, bool enable)
else
irqen &= ~BIT(14);

-   ret = ade7754_spi_write_reg_16(dev, ADE7754_IRQEN, irqen);
+   return ade7754_spi_write_reg_16(dev, ADE7754_IRQEN, irqen);

-   return ret;
  }

  /* Power down the device */
--
1.7.10.4



[PATCH v2] Staging: wlan-ng: fixed block comments should align the * on each line

2017-02-17 Thread Bo YU

Right-shift a space key to align the * on each line.

Signed-off-by: Bo YU <tsu.y...@gmail.com>
---
 drivers/staging/wlan-ng/p80211metastruct.h |   88 ++--
 1 file changed, 44 insertions(+), 44 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211metastruct.h 
b/drivers/staging/wlan-ng/p80211metastruct.h
index 850d897fc163..c2ffec4daa90 100644
--- a/drivers/staging/wlan-ng/p80211metastruct.h
+++ b/drivers/staging/wlan-ng/p80211metastruct.h
@@ -1,48 +1,48 @@
 /* This file is GENERATED AUTOMATICALLY.  DO NOT EDIT OR MODIFY.
-* 
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*/
+ * 
+ *
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The contents of this file are subject to the Mozilla Public
+ *   License Version 1.1 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.mozilla.org/MPL/
+ *
+ *   Software distributed under the License is distributed on an "AS
+ *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ *   implied. See the License for the specific language governing
+ *   rights and limitations under the License.
+ *
+ *   Alternatively, the contents of this file may be used under the
+ *   terms of the GNU Public License version 2 (the "GPL"), in which
+ *   case the provisions of the GPL are applicable instead of the
+ *   above.  If you wish to allow the use of your version of this file
+ *   only under the terms of the GPL and not to allow others to use
+ *   your version of this file under the MPL, indicate your decision
+ *   by deleting the provisions above and replace them with the notice
+ *   and other provisions required by the GPL.  If you do not delete
+ *   the provisions above, a recipient may use your version of this
+ *   file under either the MPL or the GPL.
+ *
+ * 
+ *
+ * Inquiries regarding the linux-wlan Open Source project can be
+ * made directly to:
+ *
+ * AbsoluteValue Systems Inc.
+ * i...@linux-wlan.com
+ * http://www.linux-wlan.com
+ *
+ * 
+ *
+ * Portions of the development of this software were funded by
+ * Intersil Corporation as part of PRISM(R) chipset product development.
+ *
+ * 
+ */

 #ifndef _P80211MKMETASTRUCT_H
 #define _P80211MKMETASTRUCT_H
--
1.7.10.4



[PATCH v2] Staging: wlan-ng: fixed block comments should align the * on each line

2017-02-17 Thread Bo YU

Right-shift a space key to align the * on each line.

Signed-off-by: Bo YU 
---
 drivers/staging/wlan-ng/p80211metastruct.h |   88 ++--
 1 file changed, 44 insertions(+), 44 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211metastruct.h 
b/drivers/staging/wlan-ng/p80211metastruct.h
index 850d897fc163..c2ffec4daa90 100644
--- a/drivers/staging/wlan-ng/p80211metastruct.h
+++ b/drivers/staging/wlan-ng/p80211metastruct.h
@@ -1,48 +1,48 @@
 /* This file is GENERATED AUTOMATICALLY.  DO NOT EDIT OR MODIFY.
-* 
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*/
+ * 
+ *
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The contents of this file are subject to the Mozilla Public
+ *   License Version 1.1 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.mozilla.org/MPL/
+ *
+ *   Software distributed under the License is distributed on an "AS
+ *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ *   implied. See the License for the specific language governing
+ *   rights and limitations under the License.
+ *
+ *   Alternatively, the contents of this file may be used under the
+ *   terms of the GNU Public License version 2 (the "GPL"), in which
+ *   case the provisions of the GPL are applicable instead of the
+ *   above.  If you wish to allow the use of your version of this file
+ *   only under the terms of the GPL and not to allow others to use
+ *   your version of this file under the MPL, indicate your decision
+ *   by deleting the provisions above and replace them with the notice
+ *   and other provisions required by the GPL.  If you do not delete
+ *   the provisions above, a recipient may use your version of this
+ *   file under either the MPL or the GPL.
+ *
+ * 
+ *
+ * Inquiries regarding the linux-wlan Open Source project can be
+ * made directly to:
+ *
+ * AbsoluteValue Systems Inc.
+ * i...@linux-wlan.com
+ * http://www.linux-wlan.com
+ *
+ * 
+ *
+ * Portions of the development of this software were funded by
+ * Intersil Corporation as part of PRISM(R) chipset product development.
+ *
+ * 
+ */

 #ifndef _P80211MKMETASTRUCT_H
 #define _P80211MKMETASTRUCT_H
--
1.7.10.4



[PATCH] Staging: bcm2835-audio: fixed a code style issue:

2017-02-16 Thread Bo YU

Missing a blank line after declarations

Signed-off-by: Bo YU <tsu.y...@gmail.com>
---
 drivers/staging/bcm2835-audio/bcm2835-pcm.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/bcm2835-audio/bcm2835-pcm.c 
b/drivers/staging/bcm2835-audio/bcm2835-pcm.c
index 014bf7ab69f4..16127e062661 100644
--- a/drivers/staging/bcm2835-audio/bcm2835-pcm.c
+++ b/drivers/staging/bcm2835-audio/bcm2835-pcm.c
@@ -450,6 +450,7 @@ static int snd_bcm2835_pcm_lib_ioctl(struct 
snd_pcm_substream *substream,
unsigned int cmd, void *arg)
 {
int ret = snd_pcm_lib_ioctl(substream, cmd, arg);
+
audio_info(" .. substream=%p, cmd=%d, arg=%p (%x) ret=%d\n", substream,
cmd, arg, arg ? *(unsigned *) arg : 0, ret);
return ret;
--
1.7.10.4



[PATCH] Staging: bcm2835-audio: fixed a code style issue:

2017-02-16 Thread Bo YU

Missing a blank line after declarations

Signed-off-by: Bo YU 
---
 drivers/staging/bcm2835-audio/bcm2835-pcm.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/bcm2835-audio/bcm2835-pcm.c 
b/drivers/staging/bcm2835-audio/bcm2835-pcm.c
index 014bf7ab69f4..16127e062661 100644
--- a/drivers/staging/bcm2835-audio/bcm2835-pcm.c
+++ b/drivers/staging/bcm2835-audio/bcm2835-pcm.c
@@ -450,6 +450,7 @@ static int snd_bcm2835_pcm_lib_ioctl(struct 
snd_pcm_substream *substream,
unsigned int cmd, void *arg)
 {
int ret = snd_pcm_lib_ioctl(substream, cmd, arg);
+
audio_info(" .. substream=%p, cmd=%d, arg=%p (%x) ret=%d\n", substream,
cmd, arg, arg ? *(unsigned *) arg : 0, ret);
return ret;
--
1.7.10.4



[PATCH] Staging: wlan-ng: Fixed the code style issue:

2017-02-14 Thread Bo YU

WARNING: Block comments should align the * on each line

Signed-off-by: Bo YU <tsu.y...@gmail.com>
---
 drivers/staging/wlan-ng/p80211metastruct.h |   88 ++--
 1 file changed, 44 insertions(+), 44 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211metastruct.h 
b/drivers/staging/wlan-ng/p80211metastruct.h
index 850d897fc163..c2ffec4daa90 100644
--- a/drivers/staging/wlan-ng/p80211metastruct.h
+++ b/drivers/staging/wlan-ng/p80211metastruct.h
@@ -1,48 +1,48 @@
 /* This file is GENERATED AUTOMATICALLY.  DO NOT EDIT OR MODIFY.
-* 
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*/
+ * 
+ *
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The contents of this file are subject to the Mozilla Public
+ *   License Version 1.1 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.mozilla.org/MPL/
+ *
+ *   Software distributed under the License is distributed on an "AS
+ *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ *   implied. See the License for the specific language governing
+ *   rights and limitations under the License.
+ *
+ *   Alternatively, the contents of this file may be used under the
+ *   terms of the GNU Public License version 2 (the "GPL"), in which
+ *   case the provisions of the GPL are applicable instead of the
+ *   above.  If you wish to allow the use of your version of this file
+ *   only under the terms of the GPL and not to allow others to use
+ *   your version of this file under the MPL, indicate your decision
+ *   by deleting the provisions above and replace them with the notice
+ *   and other provisions required by the GPL.  If you do not delete
+ *   the provisions above, a recipient may use your version of this
+ *   file under either the MPL or the GPL.
+ *
+ * 
+ *
+ * Inquiries regarding the linux-wlan Open Source project can be
+ * made directly to:
+ *
+ * AbsoluteValue Systems Inc.
+ * i...@linux-wlan.com
+ * http://www.linux-wlan.com
+ *
+ * 
+ *
+ * Portions of the development of this software were funded by
+ * Intersil Corporation as part of PRISM(R) chipset product development.
+ *
+ * 
+ */

 #ifndef _P80211MKMETASTRUCT_H
 #define _P80211MKMETASTRUCT_H
--
1.7.10.4



[PATCH] Staging: wlan-ng: Fixed the code style issue:

2017-02-14 Thread Bo YU

WARNING: Block comments should align the * on each line

Signed-off-by: Bo YU 
---
 drivers/staging/wlan-ng/p80211metastruct.h |   88 ++--
 1 file changed, 44 insertions(+), 44 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211metastruct.h 
b/drivers/staging/wlan-ng/p80211metastruct.h
index 850d897fc163..c2ffec4daa90 100644
--- a/drivers/staging/wlan-ng/p80211metastruct.h
+++ b/drivers/staging/wlan-ng/p80211metastruct.h
@@ -1,48 +1,48 @@
 /* This file is GENERATED AUTOMATICALLY.  DO NOT EDIT OR MODIFY.
-* 
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*/
+ * 
+ *
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The contents of this file are subject to the Mozilla Public
+ *   License Version 1.1 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.mozilla.org/MPL/
+ *
+ *   Software distributed under the License is distributed on an "AS
+ *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ *   implied. See the License for the specific language governing
+ *   rights and limitations under the License.
+ *
+ *   Alternatively, the contents of this file may be used under the
+ *   terms of the GNU Public License version 2 (the "GPL"), in which
+ *   case the provisions of the GPL are applicable instead of the
+ *   above.  If you wish to allow the use of your version of this file
+ *   only under the terms of the GPL and not to allow others to use
+ *   your version of this file under the MPL, indicate your decision
+ *   by deleting the provisions above and replace them with the notice
+ *   and other provisions required by the GPL.  If you do not delete
+ *   the provisions above, a recipient may use your version of this
+ *   file under either the MPL or the GPL.
+ *
+ * 
+ *
+ * Inquiries regarding the linux-wlan Open Source project can be
+ * made directly to:
+ *
+ * AbsoluteValue Systems Inc.
+ * i...@linux-wlan.com
+ * http://www.linux-wlan.com
+ *
+ * 
+ *
+ * Portions of the development of this software were funded by
+ * Intersil Corporation as part of PRISM(R) chipset product development.
+ *
+ * 
+ */

 #ifndef _P80211MKMETASTRUCT_H
 #define _P80211MKMETASTRUCT_H
--
1.7.10.4



[PATCH] Staging: wlan-ng: Fixed code style issue:

2017-02-13 Thread Bo YU

Statements should start on a tabstop

Signed-off-by: YU Bo 
---
 drivers/staging/wlan-ng/prism2mgmt.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2mgmt.c 
b/drivers/staging/wlan-ng/prism2mgmt.c
index c558ad656c49..b641a59052ac 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -1307,8 +1307,7 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void 
*msgp)
&& (msg->prismheader.data == P80211ENUM_truth_true)) {
hw->sniffhdr = 0;
wlandev->netdev->type = ARPHRD_IEEE80211_PRISM;
-   } else
-   if ((msg->wlanheader.status ==
+   } else if ((msg->wlanheader.status ==
 P80211ENUM_msgitem_status_data_ok)
&& (msg->wlanheader.data == P80211ENUM_truth_true)) {
hw->sniffhdr = 1;
--
1.7.10.4



[PATCH] Staging: wlan-ng: Fixed code style issue:

2017-02-13 Thread Bo YU

Statements should start on a tabstop

Signed-off-by: YU Bo 
---
 drivers/staging/wlan-ng/prism2mgmt.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2mgmt.c 
b/drivers/staging/wlan-ng/prism2mgmt.c
index c558ad656c49..b641a59052ac 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -1307,8 +1307,7 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void 
*msgp)
&& (msg->prismheader.data == P80211ENUM_truth_true)) {
hw->sniffhdr = 0;
wlandev->netdev->type = ARPHRD_IEEE80211_PRISM;
-   } else
-   if ((msg->wlanheader.status ==
+   } else if ((msg->wlanheader.status ==
 P80211ENUM_msgitem_status_data_ok)
&& (msg->wlanheader.data == P80211ENUM_truth_true)) {
hw->sniffhdr = 1;
--
1.7.10.4



Re: [PATCH] staging: xgifb: Fix comment style

2016-03-22 Thread Bo Yu

On Mon, Mar 21, 2016 at 03:38:21PM -0400, Kroah-Hartman wrote:
hi,

On Sat, Mar 12, 2016 at 03:40:35AM -0500, YU Bo wrote:

Fix comments to use trailing */ on separste lines.

Signed-off-by: YU BO 
---
drivers/staging/xgifb/vb_init.c|3 ++-
drivers/staging/xgifb/vb_setmode.c |3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)


You sent me 2 different patches with the identical subject: line, which
I can't accept.  Please fix them up and send a patch series, with unique
subjects.

yes, you are right:) I will fix them up and resend a patch series.
Sorry for the noise.
Thanks.


thanks,

greg k-h


Re: [PATCH] staging: xgifb: Fix comment style

2016-03-22 Thread Bo Yu

On Mon, Mar 21, 2016 at 03:38:21PM -0400, Kroah-Hartman wrote:
hi,

On Sat, Mar 12, 2016 at 03:40:35AM -0500, YU Bo wrote:

Fix comments to use trailing */ on separste lines.

Signed-off-by: YU BO 
---
drivers/staging/xgifb/vb_init.c|3 ++-
drivers/staging/xgifb/vb_setmode.c |3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)


You sent me 2 different patches with the identical subject: line, which
I can't accept.  Please fix them up and send a patch series, with unique
subjects.

yes, you are right:) I will fix them up and resend a patch series.
Sorry for the noise.
Thanks.


thanks,

greg k-h


Re: [PATCH] staging: xgifb: Fix comment style

2016-02-21 Thread Bo YU
Hi,
On Sun, Feb 21, 2016 at 11:33:48AM -0800, Kroah-Hartman wrote:
>On Sun, Feb 21, 2016 at 04:59:17PM +0800, Bo YU wrote:
>> Hello,
>>
>> On Sat, Feb 20, 2016 at 03:38:15PM -0800, Kroah-Hartman wrote:

>> >Patch doesn't apply :(
>> I don't know that whether i am doing wrong something with git.
>> Because when i run `git am the-codingfixed-patch` ,it reports error.
>
>Yes, that is the problem, please work on fixing that.  I don't have the
>time to determine exactly what the error is, sorry.
>
I will fix that :)
Thanks a lot for your patience and help.
>greg k-h

--
Best Regards


Re: [PATCH] staging: xgifb: Fix comment style

2016-02-21 Thread Bo YU
Hi,
On Sun, Feb 21, 2016 at 11:33:48AM -0800, Kroah-Hartman wrote:
>On Sun, Feb 21, 2016 at 04:59:17PM +0800, Bo YU wrote:
>> Hello,
>>
>> On Sat, Feb 20, 2016 at 03:38:15PM -0800, Kroah-Hartman wrote:

>> >Patch doesn't apply :(
>> I don't know that whether i am doing wrong something with git.
>> Because when i run `git am the-codingfixed-patch` ,it reports error.
>
>Yes, that is the problem, please work on fixing that.  I don't have the
>time to determine exactly what the error is, sorry.
>
I will fix that :)
Thanks a lot for your patience and help.
>greg k-h

--
Best Regards


Re: [PATCH] staging: xgifb: Fix comment style

2016-02-21 Thread Bo YU
Hello,

On Sat, Feb 20, 2016 at 03:38:15PM -0800, Kroah-Hartman wrote:
>On Wed, Feb 17, 2016 at 02:53:34PM +0800, Bo YU wrote:
>> Fix comments to use trailing */ on separate lines.
>>
>> Signed-off-by: YU BO <tsu.y...@gmail.com>
>> ---
>>   drivers/staging/xgifb/vb_init.c |   10 +-
>>   1 file changed, 5 insertions(+), 5 deletions(-)
>
>Patch doesn't apply :(
I don't know that whether i am doing wrong something with git.
Because when i run `git am the-codingfixed-patch` ,it reports error.
But run `patch -p1 the-codingfixed-patch` it is ok.

Perhaps i am wrong with others.

Could you tell me a little hit?

Sorry for the noisy.:)
--
Best Regards


Re: [PATCH] staging: xgifb: Fix comment style

2016-02-21 Thread Bo YU
Hello,

On Sat, Feb 20, 2016 at 03:38:15PM -0800, Kroah-Hartman wrote:
>On Wed, Feb 17, 2016 at 02:53:34PM +0800, Bo YU wrote:
>> Fix comments to use trailing */ on separate lines.
>>
>> Signed-off-by: YU BO 
>> ---
>>   drivers/staging/xgifb/vb_init.c |   10 +-
>>   1 file changed, 5 insertions(+), 5 deletions(-)
>
>Patch doesn't apply :(
I don't know that whether i am doing wrong something with git.
Because when i run `git am the-codingfixed-patch` ,it reports error.
But run `patch -p1 the-codingfixed-patch` it is ok.

Perhaps i am wrong with others.

Could you tell me a little hit?

Sorry for the noisy.:)
--
Best Regards


[PATCH] staging: xgifb: Fix comment style

2016-02-16 Thread Bo YU
Fix comments to use trailing */ on separate lines.

Signed-off-by: YU BO 
---
  drivers/staging/xgifb/vb_init.c |   10 +-
  1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index 26b539b..c7f02c7 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -699,11 +699,11 @@ static void XGINew_CheckChannel(struct
xgi_hw_device_info *HwDeviceExtension,
  break;
  case XG42:
  /*
- XG42 SR14 D[3] Reserve
- D[2] = 1, Dual Channel
- = 0, Single Channel
-
- It's Different from Other XG40 Series.
+ * XG42 SR14 D[3] Reserve
+ * D[2] = 1, Dual Channel
+ * = 0, Single Channel
+ *
+ * It's Different from Other XG40 Series.
  */
  if (XGINew_CheckFrequence(pVBInfo) == 1) { /* DDRII, DDR2x */
  pVBInfo->ram_bus = 32; /* 32 bits */
--
1.7.10.4


--
Best Regards


[PATCH] staging: xgifb: Fix comment style

2016-02-16 Thread Bo YU
Fix comments to use trailing */ on separate lines.

Signed-off-by: YU BO 
---
  drivers/staging/xgifb/vb_init.c |   10 +-
  1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index 26b539b..c7f02c7 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -699,11 +699,11 @@ static void XGINew_CheckChannel(struct
xgi_hw_device_info *HwDeviceExtension,
  break;
  case XG42:
  /*
- XG42 SR14 D[3] Reserve
- D[2] = 1, Dual Channel
- = 0, Single Channel
-
- It's Different from Other XG40 Series.
+ * XG42 SR14 D[3] Reserve
+ * D[2] = 1, Dual Channel
+ * = 0, Single Channel
+ *
+ * It's Different from Other XG40 Series.
  */
  if (XGINew_CheckFrequence(pVBInfo) == 1) { /* DDRII, DDR2x */
  pVBInfo->ram_bus = 32; /* 32 bits */
--
1.7.10.4


--
Best Regards


Re: [PATCH] Staging: xgifb: vgatypes.h: Coding style warning fix for block comments

2016-02-15 Thread Bo YU
Hi,

Sorry for the delay to reply.I have send the patch to Arnaud,but he
didn't reply me...Maybe i was wrong with something.

Thanks again.

On Mon, Feb 8, 2016 at 12:14 PM, Kroah-Hartman
 wrote:
> On Fri, Jan 15, 2016 at 05:30:02PM +0800, YU Bo wrote:
>> This patch is to vgatypes.h file that fixes up following warnings
>> reported by checkpatch.pl tool
>>
>> Signed-off-by: YU Bo 
>> ---
>>  drivers/staging/xgifb/vgatypes.h |   12 
>>  1 file changed, 8 insertions(+), 4 deletions(-)
>
> None of your patches applied, are you sure you are sending them
> properly?
>


Re: [PATCH] Staging: xgifb: vgatypes.h: Coding style warning fix for block comments

2016-02-15 Thread Bo YU
Hi,

Sorry for the delay to reply.I have send the patch to Arnaud,but he
didn't reply me...Maybe i was wrong with something.

Thanks again.

On Mon, Feb 8, 2016 at 12:14 PM, Kroah-Hartman
 wrote:
> On Fri, Jan 15, 2016 at 05:30:02PM +0800, YU Bo wrote:
>> This patch is to vgatypes.h file that fixes up following warnings
>> reported by checkpatch.pl tool
>>
>> Signed-off-by: YU Bo 
>> ---
>>  drivers/staging/xgifb/vgatypes.h |   12 
>>  1 file changed, 8 insertions(+), 4 deletions(-)
>
> None of your patches applied, are you sure you are sending them
> properly?
>