[PATCH -next v3] bcache: use DEFINE_MUTEX() for mutex lock

2021-04-07 Thread Zheng Yongjun
mutex lock can be initialized automatically with DEFINE_MUTEX() rather
than explicitly calling mutex_init().

this patch will reduce the size of bcache.ko about 16 bytes, the reason
as follows:

though this patch will increase the size of .data segment about 32 bytes,
it will also reduce the size of .init.text and .rodata.str1.1(at x86_64),
.rodata_str1.8(at arm64) and .bss segment total about 48 bytes which reduce
 the size more than .data segment;

here is the statistics:
Sections: (arm64 platform)
Idx namesize
-.init.text 0240
+.init.text 0228

-.rodata.str1.8 12cd
+.rodata.str1.8 12b5

-.data  0c60
+.data  0c80

Sections: (x86 platform)
Idx namesize
-.init.text 01d9
+.init.text 01bf

-.rodata.str1.1 0c80
+.rodata.str1.1 0c6d

-.data  0cc0
+.data  0ce0

Reported-by: Hulk Robot 
Signed-off-by: Zheng Yongjun 
---

v3:
- change commit log, delete statistic about .bss segment.
v2:
- add commit log about the reason why bcache.ko size reduced.

 drivers/md/bcache/super.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 03e1fe4de53d..3635f454309e 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -40,7 +40,7 @@ static const char invalid_uuid[] = {
 };
 
 static struct kobject *bcache_kobj;
-struct mutex bch_register_lock;
+DEFINE_MUTEX(bch_register_lock);
 bool bcache_is_reboot;
 LIST_HEAD(bch_cache_sets);
 static LIST_HEAD(uncached_devices);
@@ -2869,7 +2869,6 @@ static int __init bcache_init(void)
 
check_module_parameters();
 
-   mutex_init(_register_lock);
init_waitqueue_head(_wait);
register_reboot_notifier();
 
-- 
2.25.1



[PATCH -next v2] bcache: use DEFINE_MUTEX() for mutex lock

2021-04-07 Thread Zheng Yongjun
mutex lock can be initialized automatically with DEFINE_MUTEX() rather
than explicitly calling mutex_init().

this patch will reduce the size of bcache.ko about 64 bytes, the reason
as follows:

though this patch will increase the size of .data segment about 32 bytes,
it will also reduce the size of .init.text and .rodata.str1.1(at x86_64),
.rodata_str1.8(at arm64) and .bss segment total about 96 bytes which reduce
 the size more than .data segment;

here is the statistics:
Sections: (arm64 platform)
Idx namesize
-.init.text 0240
+.init.text 0228

-.rodata.str1.8 12cd
+.rodata.str1.8 12b5

-.data  0c60
+.data  0c80

-.bss   0080
+.bss   0060

Sections: (x86 platform)
Idx namesize
-.init.text 01d9
+.init.text 01bf

-.rodata.str1.1 0c80
+.rodata.str1.1 0c6d

-.data  0cc0
+.data  0ce0

-.bss   0080
+.bss   0070

Reported-by: Hulk Robot 
Signed-off-by: Zheng Yongjun 
---
 drivers/md/bcache/super.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 03e1fe4de53d..3635f454309e 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -40,7 +40,7 @@ static const char invalid_uuid[] = {
 };
 
 static struct kobject *bcache_kobj;
-struct mutex bch_register_lock;
+DEFINE_MUTEX(bch_register_lock);
 bool bcache_is_reboot;
 LIST_HEAD(bch_cache_sets);
 static LIST_HEAD(uncached_devices);
@@ -2869,7 +2869,6 @@ static int __init bcache_init(void)
 
check_module_parameters();
 
-   mutex_init(_register_lock);
init_waitqueue_head(_wait);
register_reboot_notifier();
 
-- 
2.25.1



[PATCH v2] net: tipc: Fix spelling errors in net/tipc module

2021-04-06 Thread Zheng Yongjun
These patches fix a series of spelling errors in net/tipc module.

Reported-by: Hulk Robot 
Signed-off-by: Zheng Yongjun 
---
 net/tipc/bearer.h | 6 +++---
 net/tipc/net.c| 2 +-
 net/tipc/node.c   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h
index 6bf4550aa1ac..57c6a1a719e2 100644
--- a/net/tipc/bearer.h
+++ b/net/tipc/bearer.h
@@ -154,9 +154,9 @@ struct tipc_media {
  * care of initializing all other fields.
  */
 struct tipc_bearer {
-   void __rcu *media_ptr;  /* initalized by media */
-   u32 mtu;/* initalized by media */
-   struct tipc_media_addr addr;/* initalized by media */
+   void __rcu *media_ptr;  /* initialized by media */
+   u32 mtu;/* initialized by media */
+   struct tipc_media_addr addr;/* initialized by media */
char name[TIPC_MAX_BEARER_NAME];
struct tipc_media *media;
struct tipc_media_addr bcast_addr;
diff --git a/net/tipc/net.c b/net/tipc/net.c
index a129f661bee3..faf6bf554514 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -89,7 +89,7 @@
  * - A spin lock to protect the registry of kernel/driver users (reg.c)
  * - A global spin_lock (tipc_port_lock), which only task is to ensure
  *   consistency where more than one port is involved in an operation,
- *   i.e., whe a port is part of a linked list of ports.
+ *   i.e., when a port is part of a linked list of ports.
  *   There are two such lists; 'port_list', which is used for management,
  *   and 'wait_list', which is used to queue ports during congestion.
  *
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 008670d1f43e..81430da244b9 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -1734,7 +1734,7 @@ int tipc_node_xmit(struct net *net, struct sk_buff_head 
*list,
 }
 
 /* tipc_node_xmit_skb(): send single buffer to destination
- * Buffers sent via this functon are generally TIPC_SYSTEM_IMPORTANCE
+ * Buffers sent via this function are generally TIPC_SYSTEM_IMPORTANCE
  * messages, which will not be rejected
  * The only exception is datagram messages rerouted after secondary
  * lookup, which are rare and safe to dispose of anyway.
-- 
2.25.1



[PATCH net-next] net: tipc: Fix spelling errors in net/tipc module

2021-04-06 Thread Zheng Yongjun
These patches fix a series of spelling errors in net/tipc module.

Reported-by: Hulk Robot 
Signed-off-by: Zheng Yongjun 
---
 net/tipc/bearer.h | 6 +++---
 net/tipc/net.c| 2 +-
 net/tipc/node.c   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h
index 6bf4550aa1ac..57c6a1a719e2 100644
--- a/net/tipc/bearer.h
+++ b/net/tipc/bearer.h
@@ -154,9 +154,9 @@ struct tipc_media {
  * care of initializing all other fields.
  */
 struct tipc_bearer {
-   void __rcu *media_ptr;  /* initalized by media */
-   u32 mtu;/* initalized by media */
-   struct tipc_media_addr addr;/* initalized by media */
+   void __rcu *media_ptr;  /* initialized by media */
+   u32 mtu;/* initialized by media */
+   struct tipc_media_addr addr;/* initialized by media */
char name[TIPC_MAX_BEARER_NAME];
struct tipc_media *media;
struct tipc_media_addr bcast_addr;
diff --git a/net/tipc/net.c b/net/tipc/net.c
index a129f661bee3..faf6bf554514 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -89,7 +89,7 @@
  * - A spin lock to protect the registry of kernel/driver users (reg.c)
  * - A global spin_lock (tipc_port_lock), which only task is to ensure
  *   consistency where more than one port is involved in an operation,
- *   i.e., whe a port is part of a linked list of ports.
+ *   i.e., when a port is part of a linked list of ports.
  *   There are two such lists; 'port_list', which is used for management,
  *   and 'wait_list', which is used to queue ports during congestion.
  *
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 008670d1f43e..81430da244b9 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -1734,7 +1734,7 @@ int tipc_node_xmit(struct net *net, struct sk_buff_head 
*list,
 }
 
 /* tipc_node_xmit_skb(): send single buffer to destination
- * Buffers sent via this functon are generally TIPC_SYSTEM_IMPORTANCE
+ * Buffers sent via this function are generally TIPC_SYSTEM_IMPORTANCE
  * messages, which will not be rejected
  * The only exception is datagram messages rerouted after secondary
  * lookup, which are rare and safe to dispose of anyway.
-- 
2.25.1



[PATCH] net: nfc: Fix spelling errors in net/nfc module

2021-04-05 Thread Zheng Yongjun
These patches fix a series of spelling errors in net/nfc module.

Reported-by: Hulk Robot 
Signed-off-by: Zheng Yongjun 
---
 net/nfc/digital_dep.c | 2 +-
 net/nfc/nci/core.c| 2 +-
 net/nfc/nci/uart.c| 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/nfc/digital_dep.c b/net/nfc/digital_dep.c
index 5971fb6f51cc..1150731126e2 100644
--- a/net/nfc/digital_dep.c
+++ b/net/nfc/digital_dep.c
@@ -1217,7 +1217,7 @@ static void digital_tg_recv_dep_req(struct 
nfc_digital_dev *ddev, void *arg,
 
/* ACK */
if (ddev->atn_count) {
-   /* The target has previously recevied one or more ATN
+   /* The target has previously received one or more ATN
 * PDUs.
 */
ddev->atn_count = 0;
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 59257400697d..9a585332ea84 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -1507,7 +1507,7 @@ static void nci_rx_work(struct work_struct *work)
}
}
 
-   /* check if a data exchange timout has occurred */
+   /* check if a data exchange timeout has occurred */
if (test_bit(NCI_DATA_EXCHANGE_TO, >flags)) {
/* complete the data exchange transaction, if exists */
if (test_bit(NCI_DATA_EXCHANGE, >flags))
diff --git a/net/nfc/nci/uart.c b/net/nfc/nci/uart.c
index 1204c438e87d..6af5752cde09 100644
--- a/net/nfc/nci/uart.c
+++ b/net/nfc/nci/uart.c
@@ -234,7 +234,7 @@ static void nci_uart_tty_wakeup(struct tty_struct *tty)
  * Called by tty low level driver when receive data is
  * available.
  *
- * Arguments:  tty  pointer to tty isntance data
+ * Arguments:  tty  pointer to tty instance data
  * data pointer to received data
  * flagspointer to flags for data
  * countcount of received data in bytes
@@ -374,7 +374,7 @@ static int nci_uart_default_recv_buf(struct nci_uart *nu, 
const u8 *data,
data += chunk_len;
count -= chunk_len;
 
-   /* Chcek if packet is fully received */
+   /* Check if packet is fully received */
if (nu->rx_packet_len == nu->rx_skb->len) {
/* Pass RX packet to driver */
if (nu->ops.recv(nu, nu->rx_skb) != 0)
-- 
2.25.1



[PATCH -next] drivers/soc/litex: remove duplicated include from litex_soc_ctrl.c

2021-03-26 Thread Zheng Yongjun
Remove duplicated include.

Reported-by: Hulk Robot 
Signed-off-by: Zheng Yongjun 
---
 drivers/soc/litex/litex_soc_ctrl.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/soc/litex/litex_soc_ctrl.c 
b/drivers/soc/litex/litex_soc_ctrl.c
index 6268bfa7f0d6..c3e379a990f2 100644
--- a/drivers/soc/litex/litex_soc_ctrl.c
+++ b/drivers/soc/litex/litex_soc_ctrl.c
@@ -13,7 +13,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 



[PATCH -next] bus: bt1-apb: Remove duplicated include from bt1-apb.c

2021-03-26 Thread Zheng Yongjun
Remove duplicated include.

Reported-by: Hulk Robot 
Signed-off-by: Zheng Yongjun 
---
 drivers/bus/bt1-apb.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/bus/bt1-apb.c b/drivers/bus/bt1-apb.c
index b25ff941e7c7..74b1b712ef3a 100644
--- a/drivers/bus/bt1-apb.c
+++ b/drivers/bus/bt1-apb.c
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #define APB_EHB_ISR0x00



[PATCH -next] ARM: sa11x0: remove duplicated include from hackkit.c

2021-03-26 Thread Zheng Yongjun
Remove duplicated include.

Reported-by: Hulk Robot 
Signed-off-by: Zheng Yongjun 
---
 arch/arm/mach-sa1100/hackkit.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c
index 3085f1c2e586..3fe34ee7c0ab 100644
--- a/arch/arm/mach-sa1100/hackkit.c
+++ b/arch/arm/mach-sa1100/hackkit.c
@@ -18,7 +18,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 



[PATCH -next] drivers/soc/litex: remove duplicated include from litex_soc_ctrl.c

2021-03-26 Thread Zheng Yongjun
Remove duplicated include.

Reported-by: Hulk Robot 
Signed-off-by: Zheng Yongjun 
---
 drivers/soc/litex/litex_soc_ctrl.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/soc/litex/litex_soc_ctrl.c 
b/drivers/soc/litex/litex_soc_ctrl.c
index 6268bfa7f0d6..c3e379a990f2 100644
--- a/drivers/soc/litex/litex_soc_ctrl.c
+++ b/drivers/soc/litex/litex_soc_ctrl.c
@@ -13,7 +13,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 



[PATCH -next] ASoC: cs42l42: Remove unused including

2021-03-26 Thread Zheng Yongjun
Remove including  that don't need it.

Reported-by: Hulk Robot 
Signed-off-by: Zheng Yongjun 
---
 sound/soc/codecs/cs42l42.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c
index bf982e145e94..bd043f5d5d90 100644
--- a/sound/soc/codecs/cs42l42.c
+++ b/sound/soc/codecs/cs42l42.c
@@ -11,7 +11,6 @@
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 



[PATCH -next] ASoC: cs35l35: Remove unused including

2021-03-26 Thread Zheng Yongjun
Remove including  that don't need it.

Reported-by: Hulk Robot 
Signed-off-by: Zheng Yongjun 
---
 sound/soc/codecs/cs35l35.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/sound/soc/codecs/cs35l35.c b/sound/soc/codecs/cs35l35.c
index 55d529aa0011..5d361c74e803 100644
--- a/sound/soc/codecs/cs35l35.c
+++ b/sound/soc/codecs/cs35l35.c
@@ -9,7 +9,6 @@
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 



[PATCH] net: core: Clean code style issues in `neighbour.c`

2021-02-04 Thread Zheng Yongjun
Do code format alignment to clean code style issues.

Signed-off-by: Zheng Yongjun 
---
 net/core/neighbour.c | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 9500d28a43b0..a742c918a09b 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -299,7 +299,7 @@ static void neigh_flush_dev(struct neigh_table *tbl, struct 
net_device *dev,
struct neighbour __rcu **np = >hash_buckets[i];
 
while ((n = rcu_dereference_protected(*np,
-   lockdep_is_held(>lock))) != NULL) {
+ 
lockdep_is_held(>lock))) != NULL) {
if (dev && n->dev != dev) {
np = >next;
continue;
@@ -309,7 +309,7 @@ static void neigh_flush_dev(struct neigh_table *tbl, struct 
net_device *dev,
continue;
}
rcu_assign_pointer(*np,
-  rcu_dereference_protected(n->next,
+  rcu_dereference_protected(n->next,
lockdep_is_held(>lock)));
write_lock(>lock);
neigh_del_timer(n);
@@ -634,7 +634,7 @@ static struct neighbour *___neigh_create(struct neigh_table 
*tbl,
lockdep_is_held(>lock));
 n1 != NULL;
 n1 = rcu_dereference_protected(n1->next,
-   lockdep_is_held(>lock))) {
+   lockdep_is_held(>lock))) {
if (dev == n1->dev && !memcmp(n1->primary_key, n->primary_key, 
key_len)) {
if (want_ref)
neigh_hold(n1);
@@ -962,7 +962,7 @@ static void neigh_periodic_work(struct work_struct *work)
 * BASE_REACHABLE_TIME.
 */
queue_delayed_work(system_power_efficient_wq, >gc_work,
- NEIGH_VAR(>parms, BASE_REACHABLE_TIME) >> 1);
+  NEIGH_VAR(>parms, BASE_REACHABLE_TIME) >> 1);
write_unlock_bh(>lock);
 }
 
@@ -1620,8 +1620,7 @@ struct neigh_parms *neigh_parms_alloc(struct net_device 
*dev,
if (p) {
p->tbl= tbl;
refcount_set(>refcnt, 1);
-   p->reachable_time =
-   neigh_rand_reach_time(NEIGH_VAR(p, 
BASE_REACHABLE_TIME));
+   p->reachable_time = neigh_rand_reach_time(NEIGH_VAR(p, 
BASE_REACHABLE_TIME));
dev_hold(dev);
p->dev = dev;
write_pnet(>net, net);
@@ -1693,7 +1692,7 @@ void neigh_table_init(int index, struct neigh_table *tbl)
 
 #ifdef CONFIG_PROC_FS
if (!proc_create_seq_data(tbl->id, 0, init_net.proc_net_stat,
- _stat_seq_ops, tbl))
+ _stat_seq_ops, tbl))
panic("cannot create neighbour proc dir entry");
 #endif
 
@@ -1714,10 +1713,10 @@ void neigh_table_init(int index, struct neigh_table 
*tbl)
rwlock_init(>lock);
INIT_DEFERRABLE_WORK(>gc_work, neigh_periodic_work);
queue_delayed_work(system_power_efficient_wq, >gc_work,
-   tbl->parms.reachable_time);
+  tbl->parms.reachable_time);
timer_setup(>proxy_timer, neigh_proxy_process, 0);
skb_queue_head_init_class(>proxy_queue,
-   _table_proxy_queue_class);
+ _table_proxy_queue_class);
 
tbl->last_flush = now;
tbl->last_rand  = now + tbl->parms.reachable_time * 20;
-- 
2.22.0



[PATCH net-next] net: Return the correct errno code

2021-02-04 Thread Zheng Yongjun
When kzalloc failed, should return ENOMEM rather than ENOBUFS.

Signed-off-by: Zheng Yongjun 
---
 net/decnet/dn_dev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 15d42353f1a3..50e375dcd5bd 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -469,7 +469,7 @@ int dn_dev_ioctl(unsigned int cmd, void __user *arg)
case SIOCSIFADDR:
if (!ifa) {
if ((ifa = dn_dev_alloc_ifa()) == NULL) {
-   ret = -ENOBUFS;
+   ret = -ENOMEM;
break;
}
memcpy(ifa->ifa_label, dev->name, IFNAMSIZ);
@@ -645,7 +645,7 @@ static int dn_nl_newaddr(struct sk_buff *skb, struct 
nlmsghdr *nlh,
}
 
if ((ifa = dn_dev_alloc_ifa()) == NULL)
-   return -ENOBUFS;
+   return -ENOMEM;
 
if (tb[IFA_ADDRESS] == NULL)
tb[IFA_ADDRESS] = tb[IFA_LOCAL];
@@ -1088,7 +1088,7 @@ static struct dn_dev *dn_dev_create(struct net_device 
*dev, int *err)
if (i == DN_DEV_LIST_SIZE)
return NULL;
 
-   *err = -ENOBUFS;
+   *err = -ENOMEM;
if ((dn_db = kzalloc(sizeof(struct dn_dev), GFP_ATOMIC)) == NULL)
return NULL;
 
-- 
2.22.0



[PATCH -next] KVM: s390: Return the correct errno code

2021-02-04 Thread Zheng Yongjun
When valloc failed, should return ENOMEM rather than ENOBUF.

Signed-off-by: Zheng Yongjun 
---
 arch/s390/kvm/interrupt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 2f177298c663..6b7acc27cfa2 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -2252,7 +2252,7 @@ static int get_all_floating_irqs(struct kvm *kvm, u8 
__user *usrbuf, u64 len)
 */
buf = vzalloc(len);
if (!buf)
-   return -ENOBUFS;
+   return -ENOMEM;
 
max_irqs = len / sizeof(struct kvm_s390_irq);
 
-- 
2.22.0



[PATCH net-next] xfrm: Return the correct errno code

2021-02-03 Thread Zheng Yongjun
When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.

Signed-off-by: Zheng Yongjun 
---
 net/xfrm/xfrm_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index d0c32a8fcc4a..ad63a6c77edd 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2444,7 +2444,7 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct 
nlmsghdr *nlh,
encap = kmemdup(nla_data(attrs[XFRMA_ENCAP]),
sizeof(*encap), GFP_KERNEL);
if (!encap)
-   return 0;
+   return -ENOMEM;
}
 
err = xfrm_migrate(>sel, pi->dir, type, m, n, kmp, net, encap);
-- 
2.22.0



[PATCH net-next] net: sched: Return the correct errno code

2021-02-03 Thread Zheng Yongjun
When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.

Signed-off-by: Zheng Yongjun 
---
 net/sched/em_nbyte.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/em_nbyte.c b/net/sched/em_nbyte.c
index 2c1192a2ee5e..a83b237cbeb0 100644
--- a/net/sched/em_nbyte.c
+++ b/net/sched/em_nbyte.c
@@ -31,7 +31,7 @@ static int em_nbyte_change(struct net *net, void *data, int 
data_len,
em->datalen = sizeof(*nbyte) + nbyte->len;
em->data = (unsigned long)kmemdup(data, em->datalen, GFP_KERNEL);
if (em->data == 0UL)
-   return -ENOBUFS;
+   return -ENOMEM;
 
return 0;
 }
-- 
2.22.0



[PATCH net-next] net: Return the correct errno code

2021-02-03 Thread Zheng Yongjun
When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.

Signed-off-by: Zheng Yongjun 
---
 net/mpls/af_mpls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
index f2868a8a50c3..7e73611c48dd 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -1427,7 +1427,7 @@ static int mpls_dev_sysctl_register(struct net_device 
*dev,
 free:
kfree(table);
 out:
-   return -ENOBUFS;
+   return -ENOMEM;
 }
 
 static void mpls_dev_sysctl_unregister(struct net_device *dev,
-- 
2.22.0



[PATCH net-next] dccp: Return the correct errno code

2021-02-03 Thread Zheng Yongjun
When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.

Signed-off-by: Zheng Yongjun 
---
 net/dccp/feat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/dccp/feat.c b/net/dccp/feat.c
index 788dd629c420..4cb813bee7b4 100644
--- a/net/dccp/feat.c
+++ b/net/dccp/feat.c
@@ -371,7 +371,7 @@ static int dccp_feat_clone_sp_val(dccp_feat_val *fval, u8 
const *val, u8 len)
fval->sp.vec = kmemdup(val, len, gfp_any());
if (fval->sp.vec == NULL) {
fval->sp.len = 0;
-   return -ENOBUFS;
+   return -ENOMEM;
}
}
return 0;
-- 
2.22.0



[PATCH net-next] ipv6: Return the correct errno code

2021-02-03 Thread Zheng Yongjun
When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.

Signed-off-by: Zheng Yongjun 
---
 net/ipv6/addrconf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 8b6eb384bac7..347b95bc00fd 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -6943,7 +6943,7 @@ static int __addrconf_sysctl_register(struct net *net, 
char *dev_name,
 free:
kfree(table);
 out:
-   return -ENOBUFS;
+   return -ENOMEM;
 }
 
 static void __addrconf_sysctl_unregister(struct net *net,
-- 
2.22.0



[PATCH net-next] net: ipv4: Return the correct errno code

2021-02-03 Thread Zheng Yongjun
When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.

Signed-off-by: Zheng Yongjun 
---
 net/ipv4/devinet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 123a6d39438f..fa586e915621 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -2582,7 +2582,7 @@ static int __devinet_sysctl_register(struct net *net, 
char *dev_name,
 free:
kfree(t);
 out:
-   return -ENOBUFS;
+   return -ENOMEM;
 }
 
 static void __devinet_sysctl_unregister(struct net *net,
-- 
2.22.0



[PATCH net-next] net: core: Return the correct errno code

2021-02-03 Thread Zheng Yongjun
When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.

Signed-off-by: Zheng Yongjun 
---
 net/core/rtnetlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 7d7223691783..6df8fb25668b 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -177,7 +177,7 @@ static int rtnl_register_internal(struct module *owner,
struct rtnl_link *link, *old;
struct rtnl_link __rcu **tab;
int msgindex;
-   int ret = -ENOBUFS;
+   int ret = -ENOMEM;
 
BUG_ON(protocol < 0 || protocol > RTNL_FAMILY_MAX);
msgindex = rtm_msgindex(msgtype);
-- 
2.22.0



[PATCH net-next] net: core: Remove extra spaces

2021-02-03 Thread Zheng Yongjun
Do codingstyle clean up to remove extra spaces.

Signed-off-by: Zheng Yongjun 
---
 net/core/neighbour.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 9500d28a43b0..72ea94ec8c4a 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1618,7 +1618,7 @@ struct neigh_parms *neigh_parms_alloc(struct net_device 
*dev,
 
p = kmemdup(>parms, sizeof(*p), GFP_KERNEL);
if (p) {
-   p->tbl= tbl;
+   p->tbl = tbl;
refcount_set(>refcnt, 1);
p->reachable_time =
neigh_rand_reach_time(NEIGH_VAR(p, 
BASE_REACHABLE_TIME));
-- 
2.22.0



[PATCH wireless v2] scsi: megaraid: Remove unnecessary memset

2021-01-14 Thread Zheng Yongjun
memcpy operation is next to memset code, and the size to copy
is equals to the size to memset, so the memset operation is
unnecessary, remove it.

Signed-off-by: Zheng Yongjun 
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c 
b/drivers/net/wireless/ath/wcn36xx/smd.c
index 273fed22711f..5447a6696c35 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -478,7 +478,6 @@ static void init_hal_msg(struct wcn36xx_hal_msg_header *hdr,
 
 #define PREPARE_HAL_BUF(send_buf, msg_body) \
do {\
-   memset(send_buf, 0, msg_body.header.len);   \
memcpy(send_buf, _body, sizeof(msg_body));  \
} while (0) \
 
-- 
2.22.0



[PATCH v2 -next] video: fbdev: pxa3xx_gcu: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/video/fbdev/pxa3xx-gcu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c
index 4279e13a3b58..1d26be9d1f2d 100644
--- a/drivers/video/fbdev/pxa3xx-gcu.c
+++ b/drivers/video/fbdev/pxa3xx-gcu.c
@@ -594,8 +594,8 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
 * container_of(). This isn't really necessary as we have a fixed minor
 * number anyway, but this is to avoid statics. */
 
-   priv->misc_dev.minor= PXA3XX_GCU_MINOR,
-   priv->misc_dev.name = DRV_NAME,
+   priv->misc_dev.minor= PXA3XX_GCU_MINOR;
+   priv->misc_dev.name = DRV_NAME;
priv->misc_dev.fops = _gcu_miscdev_fops;
 
/* handle IO resources */
-- 
2.22.0



[PATCH v2 -next] leds: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/leds/leds-lm3642.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/leds-lm3642.c b/drivers/leds/leds-lm3642.c
index 62c14872caf7..22035a380c4a 100644
--- a/drivers/leds/leds-lm3642.c
+++ b/drivers/leds/leds-lm3642.c
@@ -339,7 +339,7 @@ static int lm3642_probe(struct i2c_client *client,
chip->cdev_flash.max_brightness = 16;
chip->cdev_flash.brightness_set_blocking = lm3642_strobe_brightness_set;
chip->cdev_flash.default_trigger = "flash";
-   chip->cdev_flash.groups = lm3642_flash_groups,
+   chip->cdev_flash.groups = lm3642_flash_groups;
err = led_classdev_register(>dev, >cdev_flash);
if (err < 0) {
dev_err(chip->dev, "failed to register flash\n");
@@ -351,7 +351,7 @@ static int lm3642_probe(struct i2c_client *client,
chip->cdev_torch.max_brightness = 8;
chip->cdev_torch.brightness_set_blocking = lm3642_torch_brightness_set;
chip->cdev_torch.default_trigger = "torch";
-   chip->cdev_torch.groups = lm3642_torch_groups,
+   chip->cdev_torch.groups = lm3642_torch_groups;
err = led_classdev_register(>dev, >cdev_torch);
if (err < 0) {
dev_err(chip->dev, "failed to register torch\n");
-- 
2.22.0



[PATCH v2 -next] [media] m88ds3103: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/media/dvb-frontends/m88ds3103.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/m88ds3103.c 
b/drivers/media/dvb-frontends/m88ds3103.c
index bde0ea64a89b..cfa4cdde99d8 100644
--- a/drivers/media/dvb-frontends/m88ds3103.c
+++ b/drivers/media/dvb-frontends/m88ds3103.c
@@ -1793,8 +1793,8 @@ static int m88ds3103_probe(struct i2c_client *client,
dev->config.lnb_en_pol = pdata->lnb_en_pol;
dev->cfg = >config;
/* create regmap */
-   dev->regmap_config.reg_bits = 8,
-   dev->regmap_config.val_bits = 8,
+   dev->regmap_config.reg_bits = 8;
+   dev->regmap_config.val_bits = 8;
dev->regmap_config.lock_arg = dev;
dev->regmap = devm_regmap_init_i2c(client, >regmap_config);
if (IS_ERR(dev->regmap)) {
-- 
2.22.0



[PATCH v2 -next] media: dvbsky: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/media/usb/dvb-usb-v2/dvbsky.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/media/usb/dvb-usb-v2/dvbsky.c 
b/drivers/media/usb/dvb-usb-v2/dvbsky.c
index 0d9657f7f29d..689829f1b52a 100644
--- a/drivers/media/usb/dvb-usb-v2/dvbsky.c
+++ b/drivers/media/usb/dvb-usb-v2/dvbsky.c
@@ -287,8 +287,8 @@ static int dvbsky_s960_attach(struct dvb_usb_adapter *adap)
m88ds3103_pdata.ts_clk = 16000;
m88ds3103_pdata.ts_clk_pol = 0;
m88ds3103_pdata.agc = 0x99;
-   m88ds3103_pdata.lnb_hv_pol = 1,
-   m88ds3103_pdata.lnb_en_pol = 1,
+   m88ds3103_pdata.lnb_hv_pol = 1;
+   m88ds3103_pdata.lnb_en_pol = 1;
 
state->i2c_client_demod = dvb_module_probe("m88ds3103", NULL,
   >i2c_adap,
@@ -383,15 +383,15 @@ static int dvbsky_s960c_attach(struct dvb_usb_adapter 
*adap)
struct sp2_config sp2_config = {};
 
/* attach demod */
-   m88ds3103_pdata.clk = 2700,
-   m88ds3103_pdata.i2c_wr_max = 33,
-   m88ds3103_pdata.clk_out = 0,
-   m88ds3103_pdata.ts_mode = M88DS3103_TS_CI,
-   m88ds3103_pdata.ts_clk = 1,
-   m88ds3103_pdata.ts_clk_pol = 1,
-   m88ds3103_pdata.agc = 0x99,
-   m88ds3103_pdata.lnb_hv_pol = 0,
-   m88ds3103_pdata.lnb_en_pol = 1,
+   m88ds3103_pdata.clk = 2700;
+   m88ds3103_pdata.i2c_wr_max = 33;
+   m88ds3103_pdata.clk_out = 0;
+   m88ds3103_pdata.ts_mode = M88DS3103_TS_CI;
+   m88ds3103_pdata.ts_clk = 1;
+   m88ds3103_pdata.ts_clk_pol = 1;
+   m88ds3103_pdata.agc = 0x99;
+   m88ds3103_pdata.lnb_hv_pol = 0;
+   m88ds3103_pdata.lnb_en_pol = 1;
 
state->i2c_client_demod = dvb_module_probe("m88ds3103", NULL,
   >i2c_adap,
-- 
2.22.0



[PATCH v2 -next] gpio: tegra186: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/gpio/gpio-tegra186.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c
index 9500074b1f1b..05974b760796 100644
--- a/drivers/gpio/gpio-tegra186.c
+++ b/drivers/gpio/gpio-tegra186.c
@@ -647,7 +647,7 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
gpio->gpio.get_direction = tegra186_gpio_get_direction;
gpio->gpio.direction_input = tegra186_gpio_direction_input;
gpio->gpio.direction_output = tegra186_gpio_direction_output;
-   gpio->gpio.get = tegra186_gpio_get,
+   gpio->gpio.get = tegra186_gpio_get;
gpio->gpio.set = tegra186_gpio_set;
gpio->gpio.set_config = tegra186_gpio_set_config;
gpio->gpio.add_pin_ranges = tegra186_gpio_add_pin_ranges;
-- 
2.22.0



[PATCH v2 -next] gpio: wcove: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/gpio/gpio-wcove.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c
index b5fbba5a783a..97c5f1d01b62 100644
--- a/drivers/gpio/gpio-wcove.c
+++ b/drivers/gpio/gpio-wcove.c
@@ -434,7 +434,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
wg->chip.get_direction = wcove_gpio_get_direction;
wg->chip.get = wcove_gpio_get;
wg->chip.set = wcove_gpio_set;
-   wg->chip.set_config = wcove_gpio_set_config,
+   wg->chip.set_config = wcove_gpio_set_config;
wg->chip.base = -1;
wg->chip.ngpio = WCOVE_VGPIO_NUM;
wg->chip.can_sleep = true;
-- 
2.22.0



[PATCH v2 -next] gpio: max77620: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/gpio/gpio-max77620.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c
index 7c0a9ef0b500..82b3a913005d 100644
--- a/drivers/gpio/gpio-max77620.c
+++ b/drivers/gpio/gpio-max77620.c
@@ -325,7 +325,7 @@ static int max77620_gpio_probe(struct platform_device *pdev)
girq->parents = NULL;
girq->default_type = IRQ_TYPE_NONE;
girq->handler = handle_edge_irq;
-   girq->init_hw = max77620_gpio_irq_init_hw,
+   girq->init_hw = max77620_gpio_irq_init_hw;
girq->threaded = true;
 
platform_set_drvdata(pdev, mgpio);
-- 
2.22.0



[PATCH v2 -next] gpio: vx855: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/gpio/gpio-vx855.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-vx855.c b/drivers/gpio/gpio-vx855.c
index 3bf397b8dfbc..69713fd5485b 100644
--- a/drivers/gpio/gpio-vx855.c
+++ b/drivers/gpio/gpio-vx855.c
@@ -216,7 +216,7 @@ static void vx855gpio_gpio_setup(struct vx855_gpio *vg)
c->direction_output = vx855gpio_direction_output;
c->get = vx855gpio_get;
c->set = vx855gpio_set;
-   c->set_config = vx855gpio_set_config,
+   c->set_config = vx855gpio_set_config;
c->dbg_show = NULL;
c->base = 0;
c->ngpio = NR_VX855_GP;
-- 
2.22.0



[PATCH v2 -next] mtd: rawnand: marvell: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/mtd/nand/raw/marvell_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/marvell_nand.c 
b/drivers/mtd/nand/raw/marvell_nand.c
index f5ca2002d08e..3e01b11c87f8 100644
--- a/drivers/mtd/nand/raw/marvell_nand.c
+++ b/drivers/mtd/nand/raw/marvell_nand.c
@@ -2396,7 +2396,7 @@ static int marvell_nfc_setup_interface(struct nand_chip 
*chip, int chipnr,
 * be greater than that to be sure tCCS delay is respected.
 */
nfc_tmg.tWHR = TO_CYCLES(max_t(int, sdr->tWHR_min, sdr->tCCS_min),
-period_ns) - 2,
+period_ns) - 2;
nfc_tmg.tRHW = TO_CYCLES(max_t(int, sdr->tRHW_min, sdr->tCCS_min),
 period_ns);
 
-- 
2.22.0



[PATCH v2 -next] gpio: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/gpio/gpio-mc33880.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-mc33880.c b/drivers/gpio/gpio-mc33880.c
index f8194f7c6186..704cd4e6171f 100644
--- a/drivers/gpio/gpio-mc33880.c
+++ b/drivers/gpio/gpio-mc33880.c
@@ -99,7 +99,7 @@ static int mc33880_probe(struct spi_device *spi)
 
mc->spi = spi;
 
-   mc->chip.label = DRIVER_NAME,
+   mc->chip.label = DRIVER_NAME;
mc->chip.set = mc33880_set;
mc->chip.base = pdata->base;
mc->chip.ngpio = PIN_NUMBER;
-- 
2.22.0



[PATCH v2 -next] mtd: st_spi_fsm: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/mtd/devices/st_spi_fsm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c
index 1888523d9745..983999c020d6 100644
--- a/drivers/mtd/devices/st_spi_fsm.c
+++ b/drivers/mtd/devices/st_spi_fsm.c
@@ -924,7 +924,7 @@ static int stfsm_read_status(struct stfsm *fsm, uint8_t cmd,
BUG_ON(bytes != 1 && bytes != 2);
 
seq->seq_opc[0] = (SEQ_OPC_PADS_1 | SEQ_OPC_CYCLES(8) |
-  SEQ_OPC_OPCODE(cmd)),
+  SEQ_OPC_OPCODE(cmd));
 
stfsm_load_seq(fsm, seq);
 
-- 
2.22.0



[PATCH v2 -next] mtd: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/mtd/maps/pci.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/maps/pci.c b/drivers/mtd/maps/pci.c
index 377ef0fc4e3e..ca00d211e73e 100644
--- a/drivers/mtd/maps/pci.c
+++ b/drivers/mtd/maps/pci.c
@@ -90,8 +90,8 @@ intel_iq80310_init(struct pci_dev *dev, struct map_pci_info 
*map)
u32 win_base;
 
map->map.bankwidth = 1;
-   map->map.read = mtd_pci_read8,
-   map->map.write = mtd_pci_write8,
+   map->map.read = mtd_pci_read8;
+   map->map.write = mtd_pci_write8;
 
map->map.size = 0x0080;
map->base = ioremap(pci_resource_start(dev, 0),
@@ -185,8 +185,8 @@ intel_dc21285_init(struct pci_dev *dev, struct map_pci_info 
*map)
return -ENXIO;
 
map->map.bankwidth = 4;
-   map->map.read = mtd_pci_read32,
-   map->map.write = mtd_pci_write32,
+   map->map.read = mtd_pci_read32;
+   map->map.write = mtd_pci_write32;
map->map.size = len;
map->base = ioremap(base, len);
 
-- 
2.22.0



[PATCH v2 -next] media: rkvdec: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/staging/media/rkvdec/rkvdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/rkvdec/rkvdec.c 
b/drivers/staging/media/rkvdec/rkvdec.c
index d25c4a37e2af..66572066e7a0 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -130,7 +130,7 @@ static void rkvdec_reset_fmt(struct rkvdec_ctx *ctx, struct 
v4l2_format *f,
memset(f, 0, sizeof(*f));
f->fmt.pix_mp.pixelformat = fourcc;
f->fmt.pix_mp.field = V4L2_FIELD_NONE;
-   f->fmt.pix_mp.colorspace = V4L2_COLORSPACE_REC709,
+   f->fmt.pix_mp.colorspace = V4L2_COLORSPACE_REC709;
f->fmt.pix_mp.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT;
f->fmt.pix_mp.quantization = V4L2_QUANTIZATION_DEFAULT;
f->fmt.pix_mp.xfer_func = V4L2_XFER_FUNC_DEFAULT;
-- 
2.22.0



[PATCH v2 -next] media: hantro: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/staging/media/hantro/hantro_v4l2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/hantro/hantro_v4l2.c 
b/drivers/staging/media/hantro/hantro_v4l2.c
index b668a82d40ad..e1081c16f56a 100644
--- a/drivers/staging/media/hantro/hantro_v4l2.c
+++ b/drivers/staging/media/hantro/hantro_v4l2.c
@@ -316,7 +316,7 @@ hantro_reset_fmt(struct v4l2_pix_format_mplane *fmt,
 
fmt->pixelformat = vpu_fmt->fourcc;
fmt->field = V4L2_FIELD_NONE;
-   fmt->colorspace = V4L2_COLORSPACE_JPEG,
+   fmt->colorspace = V4L2_COLORSPACE_JPEG;
fmt->ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT;
fmt->quantization = V4L2_QUANTIZATION_DEFAULT;
fmt->xfer_func = V4L2_XFER_FUNC_DEFAULT;
-- 
2.22.0



[PATCH v2 -next] media: zoran: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/staging/media/zoran/zoran_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/zoran/zoran_driver.c 
b/drivers/staging/media/zoran/zoran_driver.c
index 808196ea5b81..d60b4c73ea80 100644
--- a/drivers/staging/media/zoran/zoran_driver.c
+++ b/drivers/staging/media/zoran/zoran_driver.c
@@ -1020,7 +1020,7 @@ int zoran_queue_init(struct zoran *zr, struct vb2_queue 
*vq)
vq->buf_struct_size = sizeof(struct zr_buffer);
vq->ops = _video_qops;
vq->mem_ops = _dma_contig_memops;
-   vq->gfp_flags = GFP_DMA32,
+   vq->gfp_flags = GFP_DMA32;
vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
vq->min_buffers_needed = 9;
vq->lock = >lock;
-- 
2.22.0



[PATCH v2 -next] media: atomisp: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/staging/media/atomisp/pci/sh_css_params.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c 
b/drivers/staging/media/atomisp/pci/sh_css_params.c
index 24fc497bd491..9fad28b97201 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_params.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_params.c
@@ -949,7 +949,7 @@ sh_css_set_black_frame(struct ia_css_stream *stream,
 
params = stream->isp_params_configs;
height = raw_black_frame->info.res.height;
-   width = raw_black_frame->info.padded_width,
+   width = raw_black_frame->info.padded_width;
 
ptr = raw_black_frame->data
+ raw_black_frame->planes.raw.offset;
@@ -1442,8 +1442,8 @@ static int sh_css_params_default_morph_table(
 
IA_CSS_ENTER_PRIVATE("");
 
-   step = (ISP_VEC_NELEMS / 16) * 128,
-   width = binary->morph_tbl_width,
+   step = (ISP_VEC_NELEMS / 16) * 128;
+   width = binary->morph_tbl_width;
height = binary->morph_tbl_height;
 
tab = ia_css_morph_table_allocate(width, height);
-- 
2.22.0



[PATCH v2 -next] mfd: convert comma to semicolon

2021-01-08 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun 
---
 drivers/mfd/88pm860x-core.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index c9bae71f643a..a9e0855b4c66 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -916,7 +916,7 @@ static void device_power_init(struct pm860x_chip *chip,
power_devs[0].platform_data = pdata->power;
power_devs[0].pdata_size = sizeof(struct pm860x_power_pdata);
power_devs[0].num_resources = ARRAY_SIZE(battery_resources);
-   power_devs[0].resources = _resources[0],
+   power_devs[0].resources = _resources[0];
ret = mfd_add_devices(chip->dev, 0, _devs[0], 1,
  _resources[0], chip->irq_base, NULL);
if (ret < 0)
@@ -925,7 +925,7 @@ static void device_power_init(struct pm860x_chip *chip,
power_devs[1].platform_data = pdata->power;
power_devs[1].pdata_size = sizeof(struct pm860x_power_pdata);
power_devs[1].num_resources = ARRAY_SIZE(charger_resources);
-   power_devs[1].resources = _resources[0],
+   power_devs[1].resources = _resources[0];
ret = mfd_add_devices(chip->dev, 0, _devs[1], 1,
  _resources[0], chip->irq_base, NULL);
if (ret < 0)
@@ -942,7 +942,7 @@ static void device_power_init(struct pm860x_chip *chip,
pdata->chg_desc->charger_regulators =
_desc_regulator_data[0];
pdata->chg_desc->num_charger_regulators =
-   ARRAY_SIZE(chg_desc_regulator_data),
+   ARRAY_SIZE(chg_desc_regulator_data);
power_devs[3].platform_data = pdata->chg_desc;
power_devs[3].pdata_size = sizeof(*pdata->chg_desc);
ret = mfd_add_devices(chip->dev, 0, _devs[3], 1,
@@ -958,7 +958,7 @@ static void device_onkey_init(struct pm860x_chip *chip,
int ret;
 
onkey_devs[0].num_resources = ARRAY_SIZE(onkey_resources);
-   onkey_devs[0].resources = _resources[0],
+   onkey_devs[0].resources = _resources[0];
ret = mfd_add_devices(chip->dev, 0, _devs[0],
  ARRAY_SIZE(onkey_devs), _resources[0],
  chip->irq_base, NULL);
@@ -972,7 +972,7 @@ static void device_codec_init(struct pm860x_chip *chip,
int ret;
 
codec_devs[0].num_resources = ARRAY_SIZE(codec_resources);
-   codec_devs[0].resources = _resources[0],
+   codec_devs[0].resources = _resources[0];
ret = mfd_add_devices(chip->dev, 0, _devs[0],
  ARRAY_SIZE(codec_devs), _resources[0], 0,
  NULL);
-- 
2.22.0



[PATCH -next] video: fbdev: pxa3xx_gcu: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/video/fbdev/pxa3xx-gcu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c
index 4279e13a3b58..1d26be9d1f2d 100644
--- a/drivers/video/fbdev/pxa3xx-gcu.c
+++ b/drivers/video/fbdev/pxa3xx-gcu.c
@@ -594,8 +594,8 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
 * container_of(). This isn't really necessary as we have a fixed minor
 * number anyway, but this is to avoid statics. */
 
-   priv->misc_dev.minor= PXA3XX_GCU_MINOR,
-   priv->misc_dev.name = DRV_NAME,
+   priv->misc_dev.minor= PXA3XX_GCU_MINOR;
+   priv->misc_dev.name = DRV_NAME;
priv->misc_dev.fops = _gcu_miscdev_fops;
 
/* handle IO resources */
-- 
2.22.0



[PATCH -next] leds: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/leds/leds-lm3642.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/leds-lm3642.c b/drivers/leds/leds-lm3642.c
index 62c14872caf7..22035a380c4a 100644
--- a/drivers/leds/leds-lm3642.c
+++ b/drivers/leds/leds-lm3642.c
@@ -339,7 +339,7 @@ static int lm3642_probe(struct i2c_client *client,
chip->cdev_flash.max_brightness = 16;
chip->cdev_flash.brightness_set_blocking = lm3642_strobe_brightness_set;
chip->cdev_flash.default_trigger = "flash";
-   chip->cdev_flash.groups = lm3642_flash_groups,
+   chip->cdev_flash.groups = lm3642_flash_groups;
err = led_classdev_register(>dev, >cdev_flash);
if (err < 0) {
dev_err(chip->dev, "failed to register flash\n");
@@ -351,7 +351,7 @@ static int lm3642_probe(struct i2c_client *client,
chip->cdev_torch.max_brightness = 8;
chip->cdev_torch.brightness_set_blocking = lm3642_torch_brightness_set;
chip->cdev_torch.default_trigger = "torch";
-   chip->cdev_torch.groups = lm3642_torch_groups,
+   chip->cdev_torch.groups = lm3642_torch_groups;
err = led_classdev_register(>dev, >cdev_torch);
if (err < 0) {
dev_err(chip->dev, "failed to register torch\n");
-- 
2.22.0



[PATCH -next] [media] m88ds3103: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/media/dvb-frontends/m88ds3103.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/m88ds3103.c 
b/drivers/media/dvb-frontends/m88ds3103.c
index bde0ea64a89b..cfa4cdde99d8 100644
--- a/drivers/media/dvb-frontends/m88ds3103.c
+++ b/drivers/media/dvb-frontends/m88ds3103.c
@@ -1793,8 +1793,8 @@ static int m88ds3103_probe(struct i2c_client *client,
dev->config.lnb_en_pol = pdata->lnb_en_pol;
dev->cfg = >config;
/* create regmap */
-   dev->regmap_config.reg_bits = 8,
-   dev->regmap_config.val_bits = 8,
+   dev->regmap_config.reg_bits = 8;
+   dev->regmap_config.val_bits = 8;
dev->regmap_config.lock_arg = dev;
dev->regmap = devm_regmap_init_i2c(client, >regmap_config);
if (IS_ERR(dev->regmap)) {
-- 
2.22.0



[PATCH -next] media: dvbsky: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/media/usb/dvb-usb-v2/dvbsky.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/media/usb/dvb-usb-v2/dvbsky.c 
b/drivers/media/usb/dvb-usb-v2/dvbsky.c
index 0d9657f7f29d..689829f1b52a 100644
--- a/drivers/media/usb/dvb-usb-v2/dvbsky.c
+++ b/drivers/media/usb/dvb-usb-v2/dvbsky.c
@@ -287,8 +287,8 @@ static int dvbsky_s960_attach(struct dvb_usb_adapter *adap)
m88ds3103_pdata.ts_clk = 16000;
m88ds3103_pdata.ts_clk_pol = 0;
m88ds3103_pdata.agc = 0x99;
-   m88ds3103_pdata.lnb_hv_pol = 1,
-   m88ds3103_pdata.lnb_en_pol = 1,
+   m88ds3103_pdata.lnb_hv_pol = 1;
+   m88ds3103_pdata.lnb_en_pol = 1;
 
state->i2c_client_demod = dvb_module_probe("m88ds3103", NULL,
   >i2c_adap,
@@ -383,15 +383,15 @@ static int dvbsky_s960c_attach(struct dvb_usb_adapter 
*adap)
struct sp2_config sp2_config = {};
 
/* attach demod */
-   m88ds3103_pdata.clk = 2700,
-   m88ds3103_pdata.i2c_wr_max = 33,
-   m88ds3103_pdata.clk_out = 0,
-   m88ds3103_pdata.ts_mode = M88DS3103_TS_CI,
-   m88ds3103_pdata.ts_clk = 1,
-   m88ds3103_pdata.ts_clk_pol = 1,
-   m88ds3103_pdata.agc = 0x99,
-   m88ds3103_pdata.lnb_hv_pol = 0,
-   m88ds3103_pdata.lnb_en_pol = 1,
+   m88ds3103_pdata.clk = 2700;
+   m88ds3103_pdata.i2c_wr_max = 33;
+   m88ds3103_pdata.clk_out = 0;
+   m88ds3103_pdata.ts_mode = M88DS3103_TS_CI;
+   m88ds3103_pdata.ts_clk = 1;
+   m88ds3103_pdata.ts_clk_pol = 1;
+   m88ds3103_pdata.agc = 0x99;
+   m88ds3103_pdata.lnb_hv_pol = 0;
+   m88ds3103_pdata.lnb_en_pol = 1;
 
state->i2c_client_demod = dvb_module_probe("m88ds3103", NULL,
   >i2c_adap,
-- 
2.22.0



[PATCH -next] gpio: wcove: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/gpio/gpio-wcove.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c
index b5fbba5a783a..97c5f1d01b62 100644
--- a/drivers/gpio/gpio-wcove.c
+++ b/drivers/gpio/gpio-wcove.c
@@ -434,7 +434,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
wg->chip.get_direction = wcove_gpio_get_direction;
wg->chip.get = wcove_gpio_get;
wg->chip.set = wcove_gpio_set;
-   wg->chip.set_config = wcove_gpio_set_config,
+   wg->chip.set_config = wcove_gpio_set_config;
wg->chip.base = -1;
wg->chip.ngpio = WCOVE_VGPIO_NUM;
wg->chip.can_sleep = true;
-- 
2.22.0



[PATCH -next] gpio: max77620: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/gpio/gpio-max77620.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c
index 7c0a9ef0b500..82b3a913005d 100644
--- a/drivers/gpio/gpio-max77620.c
+++ b/drivers/gpio/gpio-max77620.c
@@ -325,7 +325,7 @@ static int max77620_gpio_probe(struct platform_device *pdev)
girq->parents = NULL;
girq->default_type = IRQ_TYPE_NONE;
girq->handler = handle_edge_irq;
-   girq->init_hw = max77620_gpio_irq_init_hw,
+   girq->init_hw = max77620_gpio_irq_init_hw;
girq->threaded = true;
 
platform_set_drvdata(pdev, mgpio);
-- 
2.22.0



[PATCH -next] gpio: tegra186: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/gpio/gpio-tegra186.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c
index 9500074b1f1b..05974b760796 100644
--- a/drivers/gpio/gpio-tegra186.c
+++ b/drivers/gpio/gpio-tegra186.c
@@ -647,7 +647,7 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
gpio->gpio.get_direction = tegra186_gpio_get_direction;
gpio->gpio.direction_input = tegra186_gpio_direction_input;
gpio->gpio.direction_output = tegra186_gpio_direction_output;
-   gpio->gpio.get = tegra186_gpio_get,
+   gpio->gpio.get = tegra186_gpio_get;
gpio->gpio.set = tegra186_gpio_set;
gpio->gpio.set_config = tegra186_gpio_set_config;
gpio->gpio.add_pin_ranges = tegra186_gpio_add_pin_ranges;
-- 
2.22.0



[PATCH -next] gpio: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/gpio/gpio-mc33880.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-mc33880.c b/drivers/gpio/gpio-mc33880.c
index f8194f7c6186..704cd4e6171f 100644
--- a/drivers/gpio/gpio-mc33880.c
+++ b/drivers/gpio/gpio-mc33880.c
@@ -99,7 +99,7 @@ static int mc33880_probe(struct spi_device *spi)
 
mc->spi = spi;
 
-   mc->chip.label = DRIVER_NAME,
+   mc->chip.label = DRIVER_NAME;
mc->chip.set = mc33880_set;
mc->chip.base = pdata->base;
mc->chip.ngpio = PIN_NUMBER;
-- 
2.22.0



[PATCH -next] gpio: vx855: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/gpio/gpio-vx855.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-vx855.c b/drivers/gpio/gpio-vx855.c
index 3bf397b8dfbc..69713fd5485b 100644
--- a/drivers/gpio/gpio-vx855.c
+++ b/drivers/gpio/gpio-vx855.c
@@ -216,7 +216,7 @@ static void vx855gpio_gpio_setup(struct vx855_gpio *vg)
c->direction_output = vx855gpio_direction_output;
c->get = vx855gpio_get;
c->set = vx855gpio_set;
-   c->set_config = vx855gpio_set_config,
+   c->set_config = vx855gpio_set_config;
c->dbg_show = NULL;
c->base = 0;
c->ngpio = NR_VX855_GP;
-- 
2.22.0



[PATCH -next] mtd: st_spi_fsm: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/mtd/devices/st_spi_fsm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c
index 1888523d9745..983999c020d6 100644
--- a/drivers/mtd/devices/st_spi_fsm.c
+++ b/drivers/mtd/devices/st_spi_fsm.c
@@ -924,7 +924,7 @@ static int stfsm_read_status(struct stfsm *fsm, uint8_t cmd,
BUG_ON(bytes != 1 && bytes != 2);
 
seq->seq_opc[0] = (SEQ_OPC_PADS_1 | SEQ_OPC_CYCLES(8) |
-  SEQ_OPC_OPCODE(cmd)),
+  SEQ_OPC_OPCODE(cmd));
 
stfsm_load_seq(fsm, seq);
 
-- 
2.22.0



[PATCH -next] mtd: rawnand: marvell: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/mtd/nand/raw/marvell_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/marvell_nand.c 
b/drivers/mtd/nand/raw/marvell_nand.c
index f5ca2002d08e..3e01b11c87f8 100644
--- a/drivers/mtd/nand/raw/marvell_nand.c
+++ b/drivers/mtd/nand/raw/marvell_nand.c
@@ -2396,7 +2396,7 @@ static int marvell_nfc_setup_interface(struct nand_chip 
*chip, int chipnr,
 * be greater than that to be sure tCCS delay is respected.
 */
nfc_tmg.tWHR = TO_CYCLES(max_t(int, sdr->tWHR_min, sdr->tCCS_min),
-period_ns) - 2,
+period_ns) - 2;
nfc_tmg.tRHW = TO_CYCLES(max_t(int, sdr->tRHW_min, sdr->tCCS_min),
 period_ns);
 
-- 
2.22.0



[PATCH -next] mtd: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/mtd/maps/pci.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/maps/pci.c b/drivers/mtd/maps/pci.c
index 377ef0fc4e3e..ca00d211e73e 100644
--- a/drivers/mtd/maps/pci.c
+++ b/drivers/mtd/maps/pci.c
@@ -90,8 +90,8 @@ intel_iq80310_init(struct pci_dev *dev, struct map_pci_info 
*map)
u32 win_base;
 
map->map.bankwidth = 1;
-   map->map.read = mtd_pci_read8,
-   map->map.write = mtd_pci_write8,
+   map->map.read = mtd_pci_read8;
+   map->map.write = mtd_pci_write8;
 
map->map.size = 0x0080;
map->base = ioremap(pci_resource_start(dev, 0),
@@ -185,8 +185,8 @@ intel_dc21285_init(struct pci_dev *dev, struct map_pci_info 
*map)
return -ENXIO;
 
map->map.bankwidth = 4;
-   map->map.read = mtd_pci_read32,
-   map->map.write = mtd_pci_write32,
+   map->map.read = mtd_pci_read32;
+   map->map.write = mtd_pci_write32;
map->map.size = len;
map->base = ioremap(base, len);
 
-- 
2.22.0



[PATCH -next] media: rkvdec: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/staging/media/rkvdec/rkvdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/rkvdec/rkvdec.c 
b/drivers/staging/media/rkvdec/rkvdec.c
index d25c4a37e2af..66572066e7a0 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -130,7 +130,7 @@ static void rkvdec_reset_fmt(struct rkvdec_ctx *ctx, struct 
v4l2_format *f,
memset(f, 0, sizeof(*f));
f->fmt.pix_mp.pixelformat = fourcc;
f->fmt.pix_mp.field = V4L2_FIELD_NONE;
-   f->fmt.pix_mp.colorspace = V4L2_COLORSPACE_REC709,
+   f->fmt.pix_mp.colorspace = V4L2_COLORSPACE_REC709;
f->fmt.pix_mp.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT;
f->fmt.pix_mp.quantization = V4L2_QUANTIZATION_DEFAULT;
f->fmt.pix_mp.xfer_func = V4L2_XFER_FUNC_DEFAULT;
-- 
2.22.0



[PATCH -next] media: zoran: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/staging/media/zoran/zoran_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/zoran/zoran_driver.c 
b/drivers/staging/media/zoran/zoran_driver.c
index 808196ea5b81..d60b4c73ea80 100644
--- a/drivers/staging/media/zoran/zoran_driver.c
+++ b/drivers/staging/media/zoran/zoran_driver.c
@@ -1020,7 +1020,7 @@ int zoran_queue_init(struct zoran *zr, struct vb2_queue 
*vq)
vq->buf_struct_size = sizeof(struct zr_buffer);
vq->ops = _video_qops;
vq->mem_ops = _dma_contig_memops;
-   vq->gfp_flags = GFP_DMA32,
+   vq->gfp_flags = GFP_DMA32;
vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
vq->min_buffers_needed = 9;
vq->lock = >lock;
-- 
2.22.0



[PATCH -next] media: hantro: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/staging/media/hantro/hantro_v4l2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/hantro/hantro_v4l2.c 
b/drivers/staging/media/hantro/hantro_v4l2.c
index b668a82d40ad..e1081c16f56a 100644
--- a/drivers/staging/media/hantro/hantro_v4l2.c
+++ b/drivers/staging/media/hantro/hantro_v4l2.c
@@ -316,7 +316,7 @@ hantro_reset_fmt(struct v4l2_pix_format_mplane *fmt,
 
fmt->pixelformat = vpu_fmt->fourcc;
fmt->field = V4L2_FIELD_NONE;
-   fmt->colorspace = V4L2_COLORSPACE_JPEG,
+   fmt->colorspace = V4L2_COLORSPACE_JPEG;
fmt->ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT;
fmt->quantization = V4L2_QUANTIZATION_DEFAULT;
fmt->xfer_func = V4L2_XFER_FUNC_DEFAULT;
-- 
2.22.0



[PATCH -next] media: atomisp: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/staging/media/atomisp/pci/sh_css_params.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c 
b/drivers/staging/media/atomisp/pci/sh_css_params.c
index 24fc497bd491..4a02948e5612 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_params.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_params.c
@@ -949,7 +949,7 @@ sh_css_set_black_frame(struct ia_css_stream *stream,
 
params = stream->isp_params_configs;
height = raw_black_frame->info.res.height;
-   width = raw_black_frame->info.padded_width,
+   width = raw_black_frame->info.padded_width;
 
ptr = raw_black_frame->data
+ raw_black_frame->planes.raw.offset;
@@ -1443,7 +1443,7 @@ static int sh_css_params_default_morph_table(
IA_CSS_ENTER_PRIVATE("");
 
step = (ISP_VEC_NELEMS / 16) * 128,
-   width = binary->morph_tbl_width,
+   width = binary->morph_tbl_width;
height = binary->morph_tbl_height;
 
tab = ia_css_morph_table_allocate(width, height);
-- 
2.22.0



[PATCH -next] mfd: use resource_size

2021-01-06 Thread Zheng Yongjun
Use resource_size rather than a verbose computation on
the end and start fields.

Signed-off-by: Zheng Yongjun 
---
 drivers/mfd/88pm860x-core.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index c9bae71f643a..a9e0855b4c66 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -916,7 +916,7 @@ static void device_power_init(struct pm860x_chip *chip,
power_devs[0].platform_data = pdata->power;
power_devs[0].pdata_size = sizeof(struct pm860x_power_pdata);
power_devs[0].num_resources = ARRAY_SIZE(battery_resources);
-   power_devs[0].resources = _resources[0],
+   power_devs[0].resources = _resources[0];
ret = mfd_add_devices(chip->dev, 0, _devs[0], 1,
  _resources[0], chip->irq_base, NULL);
if (ret < 0)
@@ -925,7 +925,7 @@ static void device_power_init(struct pm860x_chip *chip,
power_devs[1].platform_data = pdata->power;
power_devs[1].pdata_size = sizeof(struct pm860x_power_pdata);
power_devs[1].num_resources = ARRAY_SIZE(charger_resources);
-   power_devs[1].resources = _resources[0],
+   power_devs[1].resources = _resources[0];
ret = mfd_add_devices(chip->dev, 0, _devs[1], 1,
  _resources[0], chip->irq_base, NULL);
if (ret < 0)
@@ -942,7 +942,7 @@ static void device_power_init(struct pm860x_chip *chip,
pdata->chg_desc->charger_regulators =
_desc_regulator_data[0];
pdata->chg_desc->num_charger_regulators =
-   ARRAY_SIZE(chg_desc_regulator_data),
+   ARRAY_SIZE(chg_desc_regulator_data);
power_devs[3].platform_data = pdata->chg_desc;
power_devs[3].pdata_size = sizeof(*pdata->chg_desc);
ret = mfd_add_devices(chip->dev, 0, _devs[3], 1,
@@ -958,7 +958,7 @@ static void device_onkey_init(struct pm860x_chip *chip,
int ret;
 
onkey_devs[0].num_resources = ARRAY_SIZE(onkey_resources);
-   onkey_devs[0].resources = _resources[0],
+   onkey_devs[0].resources = _resources[0];
ret = mfd_add_devices(chip->dev, 0, _devs[0],
  ARRAY_SIZE(onkey_devs), _resources[0],
  chip->irq_base, NULL);
@@ -972,7 +972,7 @@ static void device_codec_init(struct pm860x_chip *chip,
int ret;
 
codec_devs[0].num_resources = ARRAY_SIZE(codec_resources);
-   codec_devs[0].resources = _resources[0],
+   codec_devs[0].resources = _resources[0];
ret = mfd_add_devices(chip->dev, 0, _devs[0],
  ARRAY_SIZE(codec_devs), _resources[0], 0,
  NULL);
-- 
2.22.0



[PATCH v3 -next] staging: vc04_services: use DEFINE_MUTEX() for mutex lock

2021-01-04 Thread Zheng Yongjun
mutex lock can be initialized automatically with DEFINE_MUTEX()
rather than explicitly calling mutex_init().

Signed-off-by: Zheng Yongjun 
---
 .../vc04_services/interface/vchiq_arm/vchiq_connected.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git 
a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
index 79b75efa6868..938307f39b9c 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
@@ -12,15 +12,13 @@ static   intg_connected;
 static   intg_num_deferred_callbacks;
 static   VCHIQ_CONNECTED_CALLBACK_T g_deferred_callback[MAX_CALLBACKS];
 static   intg_once_init;
-static   struct mutex   g_connected_mutex;
+static   DEFINE_MUTEX(g_connected_mutex);
 
 /* Function to initialize our lock */
 static void connected_init(void)
 {
-   if (!g_once_init) {
-   mutex_init(_connected_mutex);
+   if (!g_once_init)
g_once_init = 1;
-   }
 }
 
 /*
-- 
2.22.0



[PATCH v3 net-next] net: kcm: Replace fput with sockfd_put

2020-12-30 Thread Zheng Yongjun
The function sockfd_lookup uses fget on the value that is stored in
the file field of the returned structure, so fput should ultimately be
applied to this value.  This can be done directly, but it seems better
to use the specific macro sockfd_put, which does the same thing.

Perform a source code refactoring by using the following semantic patch.

// 
@@
expression s;
@@

   s = sockfd_lookup(...)
   ...
+ sockfd_put(s);
- fput(s->file);
// 

Signed-off-by: Zheng Yongjun 
---
 net/kcm/kcmsock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
index 56dad9565bc9..a9eb616f5521 100644
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -1496,7 +1496,7 @@ static int kcm_attach_ioctl(struct socket *sock, struct 
kcm_attach *info)
 
return 0;
 out:
-   fput(csock->file);
+   sockfd_put(csock);
return err;
 }
 
@@ -1644,7 +1644,7 @@ static int kcm_unattach_ioctl(struct socket *sock, struct 
kcm_unattach *info)
spin_unlock_bh(>lock);
 
 out:
-   fput(csock->file);
+   sockfd_put(csock);
return err;
 }
 
-- 
2.22.0



[tip: x86/platform] x86/platform/intel-mid: Convert comma to semicolon

2020-12-30 Thread tip-bot2 for Zheng Yongjun
The following commit has been merged into the x86/platform branch of tip:

Commit-ID: bdb154f074a6d73d520b1fdee6b4143e2e311dfb
Gitweb:
https://git.kernel.org/tip/bdb154f074a6d73d520b1fdee6b4143e2e311dfb
Author:Zheng Yongjun 
AuthorDate:Wed, 16 Dec 2020 21:11:07 +08:00
Committer: Borislav Petkov 
CommitterDate: Wed, 30 Dec 2020 09:27:38 +01:00

x86/platform/intel-mid: Convert comma to semicolon

Replace a comma between expression statements with a semicolon.

Signed-off-by: Zheng Yongjun 
Signed-off-by: Borislav Petkov 
Acked-by: Andy Shevchenko 
Link: https://lkml.kernel.org/r/20201216131107.14339-1-zhengyongj...@huawei.com
---
 arch/x86/platform/intel-mid/device_libs/platform_bt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/platform/intel-mid/device_libs/platform_bt.c 
b/arch/x86/platform/intel-mid/device_libs/platform_bt.c
index 31dda18..2930b6e 100644
--- a/arch/x86/platform/intel-mid/device_libs/platform_bt.c
+++ b/arch/x86/platform/intel-mid/device_libs/platform_bt.c
@@ -88,8 +88,8 @@ static int __init bt_sfi_init(void)
memset(, 0, sizeof(info));
info.fwnode = ddata->dev->fwnode;
info.parent = ddata->dev;
-   info.name   = ddata->name,
-   info.id = PLATFORM_DEVID_NONE,
+   info.name   = ddata->name;
+   info.id = PLATFORM_DEVID_NONE;
 
pdev = platform_device_register_full();
if (IS_ERR(pdev))


[PATCH -next] scsi: qedf: Use kzalloc for allocating only one thing

2020-12-30 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/scsi/qedf/qedf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 46d185cb9ea8..3713d3c386a0 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -2752,7 +2752,7 @@ static int qedf_prepare_sb(struct qedf_ctx *qedf)
for (id = 0; id < qedf->num_queues; id++) {
fp = &(qedf->fp_array[id]);
fp->sb_id = QEDF_SB_ID_NULL;
-   fp->sb_info = kcalloc(1, sizeof(*fp->sb_info), GFP_KERNEL);
+   fp->sb_info = kzalloc(sizeof(*fp->sb_info), GFP_KERNEL);
if (!fp->sb_info) {
QEDF_ERR(&(qedf->dbg_ctx), "SB info struct "
  "allocation failed.\n");
-- 
2.22.0



[PATCH net-next] net/mlxfw: Use kzalloc for allocating only one thing

2020-12-30 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c 
b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c
index 5d9ddf36fb4e..e6f677e42007 100644
--- a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c
+++ b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c
@@ -267,7 +267,7 @@ struct mlxfw_mfa2_file *mlxfw_mfa2_file_init(const struct 
firmware *fw)
const void *first_tlv_ptr;
const void *cb_top_ptr;
 
-   mfa2_file = kcalloc(1, sizeof(*mfa2_file), GFP_KERNEL);
+   mfa2_file = kzalloc(sizeof(*mfa2_file), GFP_KERNEL);
if (!mfa2_file)
return ERR_PTR(-ENOMEM);
 
-- 
2.22.0



[tip: x86/cleanups] x86/mtrr: Convert comma to semicolon

2020-12-30 Thread tip-bot2 for Zheng Yongjun
The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID: 3052636aa9aa2492ccac973449be63cae5b93a67
Gitweb:
https://git.kernel.org/tip/3052636aa9aa2492ccac973449be63cae5b93a67
Author:Zheng Yongjun 
AuthorDate:Wed, 16 Dec 2020 21:11:59 +08:00
Committer: Borislav Petkov 
CommitterDate: Wed, 30 Dec 2020 08:56:35 +01:00

x86/mtrr: Convert comma to semicolon

Replace a comma between expression statements with a semicolon.

Signed-off-by: Zheng Yongjun 
Signed-off-by: Borislav Petkov 
Link: https://lkml.kernel.org/r/20201216131159.14393-1-zhengyongj...@huawei.com
---
 arch/x86/kernel/cpu/mtrr/cleanup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c 
b/arch/x86/kernel/cpu/mtrr/cleanup.c
index 5bd0117..9231640 100644
--- a/arch/x86/kernel/cpu/mtrr/cleanup.c
+++ b/arch/x86/kernel/cpu/mtrr/cleanup.c
@@ -537,9 +537,9 @@ static void __init print_out_mtrr_range_state(void)
if (!size_base)
continue;
 
-   size_base = to_size_factor(size_base, _factor),
+   size_base = to_size_factor(size_base, _factor);
start_base = range_state[i].base_pfn << (PAGE_SHIFT - 10);
-   start_base = to_size_factor(start_base, _factor),
+   start_base = to_size_factor(start_base, _factor);
type = range_state[i].type;
 
pr_debug("reg %d, base: %ld%cB, range: %ld%cB, type %s\n",


[PATCH v2 net-next] net: kcm: Replace fput with sockfd_put

2020-12-29 Thread Zheng Yongjun
The function sockfd_lookup uses fget on the value that is stored in
the file field of the returned structure, so fput should ultimately be
applied to this value.  This can be done directly, but it seems better
to use the specific macro sockfd_put, which does the same thing.

The refactoring proposed was found using the following semantic patch.

// 
@@
expression s;
@@

   s = sockfd_lookup(...)
   ...
+  sockfd_put(s);
- fput(s->file);
// 

Signed-off-by: Zheng Yongjun 
---
 net/kcm/kcmsock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
index 56dad9565bc9..a9eb616f5521 100644
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -1496,7 +1496,7 @@ static int kcm_attach_ioctl(struct socket *sock, struct 
kcm_attach *info)
 
return 0;
 out:
-   fput(csock->file);
+   sockfd_put(csock);
return err;
 }
 
@@ -1644,7 +1644,7 @@ static int kcm_unattach_ioctl(struct socket *sock, struct 
kcm_unattach *info)
spin_unlock_bh(>lock);
 
 out:
-   fput(csock->file);
+   sockfd_put(csock);
return err;
 }
 
-- 
2.22.0



[PATCH v2 -next] staging: greybus: light: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/staging/greybus/light.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
index d2672b65c3f4..87d36948c610 100644
--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -290,8 +290,7 @@ static int channel_attr_groups_set(struct gb_channel 
*channel,
channel->attrs = kcalloc(size + 1, sizeof(*channel->attrs), GFP_KERNEL);
if (!channel->attrs)
return -ENOMEM;
-   channel->attr_group = kcalloc(1, sizeof(*channel->attr_group),
- GFP_KERNEL);
+   channel->attr_group = kzalloc(sizeof(*channel->attr_group), GFP_KERNEL);
if (!channel->attr_group)
return -ENOMEM;
channel->attr_groups = kcalloc(2, sizeof(*channel->attr_groups),
-- 
2.22.0



[PATCH -next] drm/i915: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c 
b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
index f88473d396f4..6994b167d0c8 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
@@ -415,7 +415,7 @@ static int igt_evict_contexts(void *arg)
struct reserved *r;
 
mutex_unlock(>vm.mutex);
-   r = kcalloc(1, sizeof(*r), GFP_KERNEL);
+   r = kzalloc(sizeof(*r), GFP_KERNEL);
mutex_lock(>vm.mutex);
if (!r) {
err = -ENOMEM;
-- 
2.22.0



[PATCH -next] scsi: lpfc: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/scsi/lpfc/lpfc_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c
index c9a327b13e5c..f550a52dab4f 100644
--- a/drivers/scsi/lpfc/lpfc_debugfs.c
+++ b/drivers/scsi/lpfc/lpfc_debugfs.c
@@ -3033,7 +3033,7 @@ lpfc_debugfs_hdwqstat_open(struct inode *inode, struct 
file *file)
goto out;
 
 /* Round to page boundary */
-   debug->buffer = kcalloc(1, LPFC_SCSISTAT_SIZE, GFP_KERNEL);
+   debug->buffer = kzalloc(LPFC_SCSISTAT_SIZE, GFP_KERNEL);
if (!debug->buffer) {
kfree(debug);
goto out;
-- 
2.22.0



[PATCH net-next] net/mlx5: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c 
b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c
index df1363a34a42..9837d2e8d687 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c
@@ -1782,7 +1782,7 @@ static int dr_action_create_modify_action(struct 
mlx5dr_domain *dmn,
if (!chunk)
return -ENOMEM;
 
-   hw_actions = kcalloc(1, max_hw_actions * DR_MODIFY_ACTION_SIZE, 
GFP_KERNEL);
+   hw_actions = kzalloc(max_hw_actions * DR_MODIFY_ACTION_SIZE, 
GFP_KERNEL);
if (!hw_actions) {
ret = -ENOMEM;
goto free_chunk;
-- 
2.22.0



[PATCH net-next] octeontx2-af: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c 
b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
index 8f17e26dca53..f2fbea6a1c4e 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
@@ -858,7 +858,7 @@ static int cgx_lmac_init(struct cgx *cgx)
cgx->lmac_count = MAX_LMAC_PER_CGX;
 
for (i = 0; i < cgx->lmac_count; i++) {
-   lmac = kcalloc(1, sizeof(struct lmac), GFP_KERNEL);
+   lmac = kzalloc(sizeof(struct lmac), GFP_KERNEL);
if (!lmac)
return -ENOMEM;
lmac->name = kcalloc(1, sizeof("cgx_fwi_xxx_yyy"), GFP_KERNEL);
-- 
2.22.0



[PATCH net-next] bnxt_en: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c 
b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 0af0af2b70fe..0ed6fc90ebea 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -8600,7 +8600,7 @@ static int bnxt_init_msix(struct bnxt *bp)
 
 static int bnxt_init_inta(struct bnxt *bp)
 {
-   bp->irq_tbl = kcalloc(1, sizeof(struct bnxt_irq), GFP_KERNEL);
+   bp->irq_tbl = kzalloc(sizeof(struct bnxt_irq), GFP_KERNEL);
if (!bp->irq_tbl)
return -ENOMEM;
 
-- 
2.22.0



[PATCH net-next] iavf: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c 
b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
index ed08ace4f05a..647e7fde11b4 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
@@ -911,7 +911,7 @@ static void iavf_print_link_message(struct iavf_adapter 
*adapter)
return;
}
 
-   speed = kcalloc(1, IAVF_MAX_SPEED_STRLEN, GFP_KERNEL);
+   speed = kzalloc(IAVF_MAX_SPEED_STRLEN, GFP_KERNEL);
if (!speed)
return;
 
-- 
2.22.0



[PATCH net-next] liquidio: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/net/ethernet/cavium/liquidio/lio_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c 
b/drivers/net/ethernet/cavium/liquidio/lio_core.c
index 9ef172976b35..e90e3f87ee34 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_core.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_core.c
@@ -1168,7 +1168,7 @@ int octeon_setup_interrupt(struct octeon_device *oct, u32 
num_ioqs)
oct->flags |= LIO_FLAG_MSI_ENABLED;
 
/* allocate storage for the names assigned to the irq */
-   oct->irq_name_storage = kcalloc(1, INTRNAMSIZ, GFP_KERNEL);
+   oct->irq_name_storage = kzalloc(INTRNAMSIZ, GFP_KERNEL);
if (!oct->irq_name_storage)
return -ENOMEM;
 
-- 
2.22.0



[PATCH net-next] net: dsa: sja1105: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/net/dsa/sja1105/sja1105_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/sja1105/sja1105_main.c 
b/drivers/net/dsa/sja1105/sja1105_main.c
index 4ca029650993..59e00d55780b 100644
--- a/drivers/net/dsa/sja1105/sja1105_main.c
+++ b/drivers/net/dsa/sja1105/sja1105_main.c
@@ -317,7 +317,7 @@ static int sja1105_init_static_vlan(struct sja1105_private 
*priv)
table->entry_count = 0;
}
 
-   table->entries = kcalloc(1, table->ops->unpacked_entry_size,
+   table->entries = kzalloc(table->ops->unpacked_entry_size,
 GFP_KERNEL);
if (!table->entries)
return -ENOMEM;
-- 
2.22.0



[PATCH -next] RDMA/rw: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/infiniband/core/rw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c
index 13f43ab7220b..a41413c51609 100644
--- a/drivers/infiniband/core/rw.c
+++ b/drivers/infiniband/core/rw.c
@@ -407,7 +407,7 @@ int rdma_rw_ctx_signature_init(struct rdma_rw_ctx *ctx, 
struct ib_qp *qp,
 
ctx->type = RDMA_RW_SIG_MR;
ctx->nr_ops = 1;
-   ctx->reg = kcalloc(1, sizeof(*ctx->reg), GFP_KERNEL);
+   ctx->reg = kzalloc(sizeof(*ctx->reg), GFP_KERNEL);
if (!ctx->reg) {
ret = -ENOMEM;
goto out_unmap_prot_sg;
-- 
2.22.0



[PATCH -next] iw_cxgb4: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/infiniband/hw/cxgb4/restrack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/cxgb4/restrack.c 
b/drivers/infiniband/hw/cxgb4/restrack.c
index b32e6516d65f..ff645b955a08 100644
--- a/drivers/infiniband/hw/cxgb4/restrack.c
+++ b/drivers/infiniband/hw/cxgb4/restrack.c
@@ -209,7 +209,7 @@ int c4iw_fill_res_cm_id_entry(struct sk_buff *msg,
epcp = (struct c4iw_ep_common *)iw_cm_id->provider_data;
if (!epcp)
return 0;
-   uep = kcalloc(1, sizeof(*uep), GFP_KERNEL);
+   uep = kzalloc(sizeof(*uep), GFP_KERNEL);
if (!uep)
return 0;
 
-- 
2.22.0



[PATCH -next] staging: greybus: light: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/staging/greybus/light.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
index d2672b65c3f4..d227382fca20 100644
--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -290,7 +290,7 @@ static int channel_attr_groups_set(struct gb_channel 
*channel,
channel->attrs = kcalloc(size + 1, sizeof(*channel->attrs), GFP_KERNEL);
if (!channel->attrs)
return -ENOMEM;
-   channel->attr_group = kcalloc(1, sizeof(*channel->attr_group),
+   channel->attr_group = kzalloc(sizeof(*channel->attr_group),
  GFP_KERNEL);
if (!channel->attr_group)
return -ENOMEM;
-- 
2.22.0



[PATCH -next] tpm: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/char/tpm/tpm1-cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/tpm/tpm1-cmd.c b/drivers/char/tpm/tpm1-cmd.c
index ca7158fa6e6c..4d8415e3b778 100644
--- a/drivers/char/tpm/tpm1-cmd.c
+++ b/drivers/char/tpm/tpm1-cmd.c
@@ -794,7 +794,7 @@ int tpm1_pm_suspend(struct tpm_chip *chip, u32 
tpm_suspend_pcr)
  */
 int tpm1_get_pcr_allocation(struct tpm_chip *chip)
 {
-   chip->allocated_banks = kcalloc(1, sizeof(*chip->allocated_banks),
+   chip->allocated_banks = kzalloc(sizeof(*chip->allocated_banks),
GFP_KERNEL);
if (!chip->allocated_banks)
return -ENOMEM;
-- 
2.22.0



[PATCH -next] clk: tegra: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/clk/tegra/clk-tegra124-emc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/tegra/clk-tegra124-emc.c 
b/drivers/clk/tegra/clk-tegra124-emc.c
index 745f9faa98d8..7cc89c234eaa 100644
--- a/drivers/clk/tegra/clk-tegra124-emc.c
+++ b/drivers/clk/tegra/clk-tegra124-emc.c
@@ -483,7 +483,7 @@ struct clk *tegra_clk_register_emc(void __iomem *base, 
struct device_node *np,
struct clk *clk;
int err;
 
-   tegra = kcalloc(1, sizeof(*tegra), GFP_KERNEL);
+   tegra = kzalloc(sizeof(*tegra), GFP_KERNEL);
if (!tegra)
return ERR_PTR(-ENOMEM);
 
-- 
2.22.0



[PATCH -next] bus: ti-sysc: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/bus/ti-sysc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 92ecf1a78ec7..e39b6da64c6d 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -288,7 +288,7 @@ static int sysc_add_named_clock_from_child(struct sysc 
*ddata,
 * limit for clk_get(). If cl ever needs to be freed, it should be done
 * with clkdev_drop().
 */
-   cl = kcalloc(1, sizeof(*cl), GFP_KERNEL);
+   cl = kzalloc(sizeof(*cl), GFP_KERNEL);
if (!cl)
return -ENOMEM;
 
-- 
2.22.0



[PATCH -next] aoe: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/block/aoe/aoedev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
index e2ea2356da06..4d508dddc5ac 100644
--- a/drivers/block/aoe/aoedev.c
+++ b/drivers/block/aoe/aoedev.c
@@ -460,7 +460,7 @@ aoedev_by_aoeaddr(ulong maj, int min, int do_alloc)
}
if (d || !do_alloc || minor_get(, maj, min) < 0)
goto out;
-   d = kcalloc(1, sizeof *d, GFP_ATOMIC);
+   d = kzalloc(sizeof *d, GFP_ATOMIC);
if (!d)
goto out;
d->targets = kcalloc(NTARGETS, sizeof(*d->targets), GFP_ATOMIC);
-- 
2.22.0



[PATCH -next] soundwire: intel: Use kzalloc for allocating only one thing

2020-12-29 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
@@

- kcalloc(1,
+ kzalloc(
  ...)
// 

Signed-off-by: Zheng Yongjun 
---
 drivers/soundwire/intel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c
index 6a1e862b16c3..5cef271079be 100644
--- a/drivers/soundwire/intel.c
+++ b/drivers/soundwire/intel.c
@@ -967,7 +967,7 @@ static int intel_hw_params(struct snd_pcm_substream 
*substream,
}
 
/* Port configuration */
-   pconfig = kcalloc(1, sizeof(*pconfig), GFP_KERNEL);
+   pconfig = kzalloc(sizeof(*pconfig), GFP_KERNEL);
if (!pconfig) {
ret =  -ENOMEM;
goto error;
-- 
2.22.0



[PATCH net-next] cavium/liquidio: Use DEFINE_SPINLOCK() for spinlock

2020-12-29 Thread Zheng Yongjun
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun 
---
 drivers/net/ethernet/cavium/liquidio/octeon_device.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_device.c 
b/drivers/net/ethernet/cavium/liquidio/octeon_device.c
index 387a57cbfb73..e159194d0aef 100644
--- a/drivers/net/ethernet/cavium/liquidio/octeon_device.c
+++ b/drivers/net/ethernet/cavium/liquidio/octeon_device.c
@@ -545,7 +545,7 @@ static atomic_t adapter_fw_states[MAX_OCTEON_DEVICES];
 
 static u32 octeon_device_count;
 /* locks device array (i.e. octeon_device[]) */
-static spinlock_t octeon_devices_lock;
+static DEFINE_SPINLOCK(octeon_devices_lock);
 
 static struct octeon_core_setup core_setup[MAX_OCTEON_DEVICES];
 
@@ -563,7 +563,6 @@ void octeon_init_device_list(int conf_type)
memset(octeon_device, 0, (sizeof(void *) * MAX_OCTEON_DEVICES));
for (i = 0; i <  MAX_OCTEON_DEVICES; i++)
oct_set_config_info(i, conf_type);
-   spin_lock_init(_devices_lock);
 }
 
 static void *__retrieve_octeon_config_info(struct octeon_device *oct,
-- 
2.22.0



[PATCH net-next] net: ixp4xx_eth: Use DEFINE_SPINLOCK() for spinlock

2020-12-29 Thread Zheng Yongjun
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun 
---
 drivers/net/ethernet/xscale/ixp4xx_eth.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c 
b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index 2e5202923510..0152f1e70783 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -247,7 +247,7 @@ static inline void memcpy_swab32(u32 *dest, u32 *src, int 
cnt)
 }
 #endif
 
-static spinlock_t mdio_lock;
+static DEFINE_SPINLOCK(mdio_lock);
 static struct eth_regs __iomem *mdio_regs; /* mdio command and status only */
 static struct mii_bus *mdio_bus;
 static int ports_open;
@@ -528,7 +528,6 @@ static int ixp4xx_mdio_register(struct eth_regs __iomem 
*regs)
 
mdio_regs = regs;
__raw_writel(DEFAULT_CORE_CNTRL, _regs->core_control);
-   spin_lock_init(_lock);
mdio_bus->name = "IXP4xx MII Bus";
mdio_bus->read = _mdio_read;
mdio_bus->write = _mdio_write;
-- 
2.22.0



[PATCH net-next] net: usb: Use DEFINE_SPINLOCK() for spinlock

2020-12-29 Thread Zheng Yongjun
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun 
---
 drivers/net/usb/hso.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 2bb28db89432..ef6dd012b8c4 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -370,7 +370,7 @@ static struct usb_driver hso_driver;
 static struct tty_driver *tty_drv;
 static struct hso_device *serial_table[HSO_SERIAL_TTY_MINORS];
 static struct hso_device *network_table[HSO_MAX_NET_DEVICES];
-static spinlock_t serial_table_lock;
+static DEFINE_SPINLOCK(serial_table_lock);
 
 static const s32 default_port_spec[] = {
HSO_INTF_MUX | HSO_PORT_NETWORK,
@@ -3236,7 +3236,6 @@ static int __init hso_init(void)
pr_info("%s\n", version);
 
/* Initialise the serial table semaphore and table */
-   spin_lock_init(_table_lock);
for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++)
serial_table[i] = NULL;
 
-- 
2.22.0



[PATCH net-next] net: wan: Use DEFINE_SPINLOCK() for spinlock

2020-12-29 Thread Zheng Yongjun
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun 
---
 drivers/net/wan/ixp4xx_hss.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
index 7c5cf77e9ef1..ecea09fd21cb 100644
--- a/drivers/net/wan/ixp4xx_hss.c
+++ b/drivers/net/wan/ixp4xx_hss.c
@@ -323,7 +323,7 @@ struct desc {
 
 static int ports_open;
 static struct dma_pool *dma_pool;
-static spinlock_t npe_lock;
+static DEFINE_SPINLOCK(npe_lock);
 
 static const struct {
int tx, txdone, rx, rxfree;
@@ -1402,8 +1402,6 @@ static int __init hss_init_module(void)
(IXP4XX_FEATURE_HDLC | IXP4XX_FEATURE_HSS))
return -ENODEV;
 
-   spin_lock_init(_lock);
-
return platform_driver_register(_hss_driver);
 }
 
-- 
2.22.0



[PATCH net-next] net: tipc: Replace expression with offsetof()

2020-12-29 Thread Zheng Yongjun
Use the existing offsetof() macro instead of duplicating code.

Signed-off-by: Zheng Yongjun 
---
 net/tipc/monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c
index 6dce2abf436e..48fac3b17e40 100644
--- a/net/tipc/monitor.c
+++ b/net/tipc/monitor.c
@@ -108,7 +108,7 @@ const int tipc_max_domain_size = sizeof(struct 
tipc_mon_domain);
  */
 static int dom_rec_len(struct tipc_mon_domain *dom, u16 mcnt)
 {
-   return ((void *)>members - (void *)dom) + (mcnt * sizeof(u32));
+   return (offsetof(struct tipc_mon_domain, members)) + (mcnt * 
sizeof(u32));
 }
 
 /* dom_size() : calculate size of own domain based on number of peers
-- 
2.22.0



[PATCH net-next] net: wan: Replace simple_strtol by simple_strtoul

2020-12-29 Thread Zheng Yongjun
The simple_strtol() function is deprecated, use simple_strtoul() instead.

Signed-off-by: Zheng Yongjun 
---
 drivers/net/wan/sbni.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
index 2fde439543fb..3092a09d3eaa 100644
--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -1535,7 +1535,7 @@ sbni_setup( char  *p )
goto  bad_param;
 
for( n = 0, parm = 0;  *p  &&  n < 8; ) {
-   (*dest[ parm ])[ n ] = simple_strtol( p, , 0 );
+   (*dest[ parm ])[ n ] = simple_strtoul( p, , 0 );
if( !*p  ||  *p == ')' )
return 1;
if( *p == ';' ) {
-- 
2.22.0



[PATCH net-next] net: kcm: Replace fput with sockfd_put

2020-12-29 Thread Zheng Yongjun
The function sockfd_lookup uses fget on the value that is stored in
the file field of the returned structure, so fput should ultimately be
applied to this value.  This can be done directly, but it seems better
to use the specific macro sockfd_put, which does the same thing.

The problem was fixed using the following semantic patch.
(http://www.emn.fr/x-info/coccinelle/)

// 
@@
expression s;
@@

   s = sockfd_lookup(...)
   ...
+  sockfd_put(s);
?- fput(s->file);
// 

Signed-off-by: Zheng Yongjun 
---
 net/kcm/kcmsock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
index 56dad9565bc9..a9eb616f5521 100644
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -1496,7 +1496,7 @@ static int kcm_attach_ioctl(struct socket *sock, struct 
kcm_attach *info)
 
return 0;
 out:
-   fput(csock->file);
+   sockfd_put(csock);
return err;
 }
 
@@ -1644,7 +1644,7 @@ static int kcm_unattach_ioctl(struct socket *sock, struct 
kcm_unattach *info)
spin_unlock_bh(>lock);
 
 out:
-   fput(csock->file);
+   sockfd_put(csock);
return err;
 }
 
-- 
2.22.0



[PATCH net-next] net: core: Replace fput with sockfd_put

2020-12-29 Thread Zheng Yongjun
The function sockfd_lookup uses fget on the value that is stored in
the file field of the returned structure, so fput should ultimately be
applied to this value.  This can be done directly, but it seems better
to use the specific macro sockfd_put, which does the same thing.

The problem was fixed using the following semantic patch.
(http://www.emn.fr/x-info/coccinelle/)

// 
@@
expression s;
@@

   s = sockfd_lookup(...)
   ...
+  sockfd_put(s);
?- fput(s->file);
// 

Signed-off-by: Zheng Yongjun 
---
 net/core/sock_map.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/sock_map.c b/net/core/sock_map.c
index ddc899e83313..2e59256a06e9 100644
--- a/net/core/sock_map.c
+++ b/net/core/sock_map.c
@@ -611,7 +611,7 @@ int sock_map_update_elem_sys(struct bpf_map *map, void 
*key, void *value,
ret = sock_hash_update_common(map, key, sk, flags);
sock_map_sk_release(sk);
 out:
-   fput(sock->file);
+   sockfd_put(sock);
return ret;
 }
 
-- 
2.22.0



[PATCH -next] media: platform: davinci: Use DEFINE_SPINLOCK() for spinlock

2020-12-28 Thread Zheng Yongjun
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun 
---
 drivers/media/platform/davinci/vpif.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif.c 
b/drivers/media/platform/davinci/vpif.c
index 5e67994e62cc..f1ce10828b8e 100644
--- a/drivers/media/platform/davinci/vpif.c
+++ b/drivers/media/platform/davinci/vpif.c
@@ -41,7 +41,7 @@ MODULE_ALIAS("platform:" VPIF_DRIVER_NAME);
 #define VPIF_CH2_MAX_MODES 15
 #define VPIF_CH3_MAX_MODES 2
 
-spinlock_t vpif_lock;
+DEFINE_SPINLOCK(vpif_lock);
 EXPORT_SYMBOL_GPL(vpif_lock);
 
 void __iomem *vpif_base;
@@ -437,7 +437,6 @@ static int vpif_probe(struct platform_device *pdev)
pm_runtime_enable(>dev);
pm_runtime_get(>dev);
 
-   spin_lock_init(_lock);
dev_info(>dev, "vpif probe success\n");
 
/*
-- 
2.22.0



[PATCH -next] iommu: amd: Use DEFINE_SPINLOCK() for spinlock

2020-12-28 Thread Zheng Yongjun
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun 
---
 drivers/iommu/amd/iommu_v2.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/iommu/amd/iommu_v2.c b/drivers/iommu/amd/iommu_v2.c
index 5ecc0bc608ec..f8d4ad421e07 100644
--- a/drivers/iommu/amd/iommu_v2.c
+++ b/drivers/iommu/amd/iommu_v2.c
@@ -77,7 +77,7 @@ struct fault {
 };
 
 static LIST_HEAD(state_list);
-static spinlock_t state_lock;
+static DEFINE_SPINLOCK(state_lock);
 
 static struct workqueue_struct *iommu_wq;
 
@@ -938,8 +938,6 @@ static int __init amd_iommu_v2_init(void)
return 0;
}
 
-   spin_lock_init(_lock);
-
ret = -ENOMEM;
iommu_wq = alloc_workqueue("amd_iommu_v2", WQ_MEM_RECLAIM, 0);
if (iommu_wq == NULL)
-- 
2.22.0



[PATCH -next] drivers: memory: Use DEFINE_SPINLOCK() for spinlock

2020-12-28 Thread Zheng Yongjun
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun 
---
 drivers/memory/emif.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c
index ddb1879f07d3..f7825eef5894 100644
--- a/drivers/memory/emif.c
+++ b/drivers/memory/emif.c
@@ -70,7 +70,7 @@ struct emif_data {
 };
 
 static struct emif_data *emif1;
-static spinlock_t  emif_lock;
+static DEFINE_SPINLOCK(emif_lock);
 static unsigned long   irq_state;
 static u32 t_ck; /* DDR clock period in ps */
 static LIST_HEAD(device_list);
@@ -1531,7 +1531,6 @@ static int __init_or_module emif_probe(struct 
platform_device *pdev)
/* One-time actions taken on probing the first device */
if (!emif1) {
emif1 = emif;
-   spin_lock_init(_lock);
 
/*
 * TODO: register notifiers for frequency and voltage
-- 
2.22.0



[PATCH -next] fpga: Use DEFINE_SPINLOCK() for spinlock

2020-12-28 Thread Zheng Yongjun
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun 
---
 drivers/fpga/fpga-bridge.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
index 2deccacc3aa7..e9266b2a357f 100644
--- a/drivers/fpga/fpga-bridge.c
+++ b/drivers/fpga/fpga-bridge.c
@@ -17,7 +17,7 @@ static DEFINE_IDA(fpga_bridge_ida);
 static struct class *fpga_bridge_class;
 
 /* Lock for adding/removing bridges to linked lists*/
-static spinlock_t bridge_list_lock;
+static DEFINE_SPINLOCK(bridge_list_lock);
 
 /**
  * fpga_bridge_enable - Enable transactions on the bridge
@@ -479,8 +479,6 @@ static void fpga_bridge_dev_release(struct device *dev)
 
 static int __init fpga_bridge_dev_init(void)
 {
-   spin_lock_init(_list_lock);
-
fpga_bridge_class = class_create(THIS_MODULE, "fpga_bridge");
if (IS_ERR(fpga_bridge_class))
return PTR_ERR(fpga_bridge_class);
-- 
2.22.0



[PATCH -next] drivers: most: Use DEFINE_SPINLOCK() for spinlock

2020-12-28 Thread Zheng Yongjun
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun 
---
 drivers/most/most_cdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/most/most_cdev.c b/drivers/most/most_cdev.c
index 044880760b58..8b69cf3ca60b 100644
--- a/drivers/most/most_cdev.c
+++ b/drivers/most/most_cdev.c
@@ -45,7 +45,7 @@ struct comp_channel {
 
 #define to_channel(d) container_of(d, struct comp_channel, cdev)
 static struct list_head channel_list;
-static spinlock_t ch_list_lock;
+static DEFINE_SPINLOCK(ch_list_lock);
 
 static inline bool ch_has_mbo(struct comp_channel *c)
 {
@@ -495,7 +495,6 @@ static int __init mod_init(void)
return PTR_ERR(comp.class);
 
INIT_LIST_HEAD(_list);
-   spin_lock_init(_list_lock);
ida_init(_id);
 
err = alloc_chrdev_region(, 0, CHRDEV_REGION_SIZE, "cdev");
-- 
2.22.0



[PATCH -next] gpu: drm: gma500: Use DEFINE_SPINLOCK() for spinlock

2020-12-28 Thread Zheng Yongjun
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun 
---
 drivers/gpu/drm/gma500/power.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/gma500/power.c b/drivers/gpu/drm/gma500/power.c
index b361e41c6acd..cfb0a1906950 100644
--- a/drivers/gpu/drm/gma500/power.c
+++ b/drivers/gpu/drm/gma500/power.c
@@ -36,7 +36,7 @@
 #include 
 
 static DEFINE_MUTEX(power_mutex);  /* Serialize power ops */
-static spinlock_t power_ctrl_lock; /* Serialize power claim */
+static DEFINE_SPINLOCK(power_ctrl_lock);   /* Serialize power claim */
 
 /**
  * gma_power_init  -   initialise power manager
@@ -55,7 +55,6 @@ void gma_power_init(struct drm_device *dev)
dev_priv->display_power = true; /* We start active */
dev_priv->display_count = 0;/* Currently no users */
dev_priv->suspended = false;/* And not suspended */
-   spin_lock_init(_ctrl_lock);
 
if (dev_priv->ops->init_pm)
dev_priv->ops->init_pm(dev);
-- 
2.22.0



[PATCH -next] i2c: busses: Use DEFINE_SPINLOCK() for spinlock

2020-12-28 Thread Zheng Yongjun
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun 
---
 drivers/i2c/busses/i2c-elektor.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-elektor.c b/drivers/i2c/busses/i2c-elektor.c
index 140426db28df..671f9ac8387e 100644
--- a/drivers/i2c/busses/i2c-elektor.c
+++ b/drivers/i2c/busses/i2c-elektor.c
@@ -49,7 +49,7 @@ static int mmapped;
 
 static wait_queue_head_t pcf_wait;
 static int pcf_pending;
-static spinlock_t lock;
+static DEFINE_SPINLOCK(lock);
 
 static struct i2c_adapter pcf_isa_ops;
 
@@ -132,7 +132,6 @@ static irqreturn_t pcf_isa_handler(int this_irq, void 
*dev_id) {
 
 static int pcf_isa_init(void)
 {
-   spin_lock_init();
if (!mmapped) {
if (!request_region(base, 2, pcf_isa_ops.name)) {
printk(KERN_ERR "%s: requested I/O region (%#x:2) is "
-- 
2.22.0



[PATCH -next] pnp: pnpbios: Use DEFINE_SPINLOCK() for spinlock

2020-12-28 Thread Zheng Yongjun
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun 
---
 drivers/pnp/pnpbios/bioscalls.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
index ba5cfc3dbe11..ddc6f2163c8e 100644
--- a/drivers/pnp/pnpbios/bioscalls.c
+++ b/drivers/pnp/pnpbios/bioscalls.c
@@ -72,7 +72,7 @@ __visible u32 pnp_bios_fault_esp;
 __visible u32 pnp_bios_fault_eip;
 __visible u32 pnp_bios_is_utter_crap = 0;
 
-static spinlock_t pnp_bios_lock;
+static DEFINE_SPINLOCK(pnp_bios_lock);
 
 /*
  * Support Functions
@@ -473,7 +473,6 @@ void pnpbios_calls_init(union pnp_bios_install_struct 
*header)
 {
int i;
 
-   spin_lock_init(_bios_lock);
pnp_bios_callpoint.offset = header->fields.pm16offset;
pnp_bios_callpoint.segment = PNP_CS16;
 
-- 
2.22.0



[PATCH -next] pci: hotplug: Use DEFINE_SPINLOCK() for spinlock

2020-12-28 Thread Zheng Yongjun
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun 
---
 drivers/pci/hotplug/cpqphp_nvram.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/pci/hotplug/cpqphp_nvram.c 
b/drivers/pci/hotplug/cpqphp_nvram.c
index 00cd2b43364f..7a65d427ac11 100644
--- a/drivers/pci/hotplug/cpqphp_nvram.c
+++ b/drivers/pci/hotplug/cpqphp_nvram.c
@@ -80,7 +80,7 @@ static u8 evbuffer[1024];
 static void __iomem *compaq_int15_entry_point;
 
 /* lock for ordering int15_bios_call() */
-static spinlock_t int15_lock;
+static DEFINE_SPINLOCK(int15_lock);
 
 
 /* This is a series of function that deals with
@@ -415,9 +415,6 @@ void compaq_nvram_init(void __iomem *rom_start)
compaq_int15_entry_point = (rom_start + ROM_INT15_PHY_ADDR - 
ROM_PHY_ADDR);
 
dbg("int15 entry  = %p\n", compaq_int15_entry_point);
-
-   /* initialize our int15 lock */
-   spin_lock_init(_lock);
 }
 
 
-- 
2.22.0



[PATCH v2 -next] vermilion.c: use DEFINE_MUTEX() for mutex lock

2020-12-24 Thread Zheng Yongjun
mutex lock can be initialized automatically with DEFINE_MUTEX()
rather than explicitly calling mutex_init().

Signed-off-by: Zheng Yongjun 
---
 drivers/video/fbdev/vermilion/vermilion.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/vermilion/vermilion.c 
b/drivers/video/fbdev/vermilion/vermilion.c
index ff61605b8764..cf41f3c50af8 100644
--- a/drivers/video/fbdev/vermilion/vermilion.c
+++ b/drivers/video/fbdev/vermilion/vermilion.c
@@ -35,7 +35,7 @@
 
 #define VML_TOHW(_val, _width) _val) << (_width)) + 0x7FFF - (_val)) >> 16)
 
-static struct mutex vml_mutex;
+static DEFINE_MUTEX(vml_mutex);
 static struct list_head global_no_mode;
 static struct list_head global_has_mode;
 static struct fb_ops vmlfb_ops;
@@ -1058,7 +1058,6 @@ static int __init vmlfb_init(void)
 #endif
 
printk(KERN_DEBUG MODULE_NAME ": initializing\n");
-   mutex_init(_mutex);
INIT_LIST_HEAD(_no_mode);
INIT_LIST_HEAD(_has_mode);
 
-- 
2.22.0



[PATCH v2 -next] video: backlight: use DEFINE_MUTEX() for mutex lock

2020-12-24 Thread Zheng Yongjun
mutex lock can be initialized automatically with DEFINE_MUTEX()
rather than explicitly calling mutex_init().

Signed-off-by: Zheng Yongjun 
---
 drivers/video/backlight/backlight.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/video/backlight/backlight.c 
b/drivers/video/backlight/backlight.c
index 537fe1b376ad..d7a09c422547 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -64,7 +64,7 @@
  */
 
 static struct list_head backlight_dev_list;
-static struct mutex backlight_dev_list_mutex;
+static DEFINE_MUTEX(backlight_dev_list_mutex);
 static struct blocking_notifier_head backlight_notifier;
 
 static const char *const backlight_types[] = {
@@ -757,7 +757,6 @@ static int __init backlight_class_init(void)
backlight_class->dev_groups = bl_device_groups;
backlight_class->pm = _class_dev_pm_ops;
INIT_LIST_HEAD(_dev_list);
-   mutex_init(_dev_list_mutex);
BLOCKING_INIT_NOTIFIER_HEAD(_notifier);
 
return 0;
-- 
2.22.0



  1   2   3   4   >