All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/8] a set of fixes of coding style
@ 2021-02-11  6:43 Lijun Pan
  2021-02-11  6:43 ` [PATCH net-next v2 1/8] ibmvnic: prefer 'unsigned long' over 'unsigned long int' Lijun Pan
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Lijun Pan @ 2021-02-11  6:43 UTC (permalink / raw)
  To: netdev; +Cc: Lijun Pan

This series address several coding style problems.

v2: rebased on top of tree. Add the Reviewed-by tag from v1 reviews.
    patch 8/8 is new.

Lijun Pan (8):
  ibmvnic: prefer 'unsigned long' over 'unsigned long int'
  ibmvnic: fix block comments
  ibmvnic: fix braces
  ibmvnic: avoid multiple line dereference
  ibmvnic: fix miscellaneous checks
  ibmvnic: add comments for spinlock_t definitions
  ibmvnic: remove unused spinlock_t stats_lock definition
  ibmvnic: prefer strscpy over strlcpy

 drivers/net/ethernet/ibm/ibmvnic.c | 71 ++++++++++++++----------------
 drivers/net/ethernet/ibm/ibmvnic.h | 11 ++---
 2 files changed, 38 insertions(+), 44 deletions(-)

-- 
2.23.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH net-next v2 1/8] ibmvnic: prefer 'unsigned long' over 'unsigned long int'
  2021-02-11  6:43 [PATCH net-next v2 0/8] a set of fixes of coding style Lijun Pan
@ 2021-02-11  6:43 ` Lijun Pan
  2021-02-11  6:43 ` [PATCH net-next v2 2/8] ibmvnic: fix block comments Lijun Pan
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Lijun Pan @ 2021-02-11  6:43 UTC (permalink / raw)
  To: netdev; +Cc: Lijun Pan, Saeed Mahameed

Fix the following checkpatch warnings:
WARNING: Prefer 'unsigned long' over 'unsigned long int' as the int is unnecessary
WARNING: Prefer 'long' over 'long int' as the int is unnecessary

Signed-off-by: Lijun Pan <lijunp213@gmail.com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index a1579cd4bfe1..55970f02d9da 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -3654,8 +3654,8 @@ static int ibmvnic_send_crq(struct ibmvnic_adapter *adapter,
 	int rc;
 
 	netdev_dbg(adapter->netdev, "Sending CRQ: %016lx %016lx\n",
-		   (unsigned long int)cpu_to_be64(u64_crq[0]),
-		   (unsigned long int)cpu_to_be64(u64_crq[1]));
+		   (unsigned long)cpu_to_be64(u64_crq[0]),
+		   (unsigned long)cpu_to_be64(u64_crq[1]));
 
 	if (!adapter->crq.active &&
 	    crq->generic.first != IBMVNIC_CRQ_INIT_CMD) {
@@ -3884,7 +3884,7 @@ static int send_login(struct ibmvnic_adapter *adapter)
 	netdev_dbg(adapter->netdev, "Login Buffer:\n");
 	for (i = 0; i < (adapter->login_buf_sz - 1) / 8 + 1; i++) {
 		netdev_dbg(adapter->netdev, "%016lx\n",
-			   ((unsigned long int *)(adapter->login_buf))[i]);
+			   ((unsigned long *)(adapter->login_buf))[i]);
 	}
 
 	memset(&crq, 0, sizeof(crq));
@@ -4252,7 +4252,7 @@ static void handle_query_ip_offload_rsp(struct ibmvnic_adapter *adapter)
 	netdev_dbg(adapter->netdev, "Query IP Offload Buffer:\n");
 	for (i = 0; i < (sizeof(adapter->ip_offload_buf) - 1) / 8 + 1; i++)
 		netdev_dbg(adapter->netdev, "%016lx\n",
-			   ((unsigned long int *)(buf))[i]);
+			   ((unsigned long *)(buf))[i]);
 
 	netdev_dbg(adapter->netdev, "ipv4_chksum = %d\n", buf->ipv4_chksum);
 	netdev_dbg(adapter->netdev, "ipv6_chksum = %d\n", buf->ipv6_chksum);
@@ -4411,7 +4411,7 @@ static void handle_request_cap_rsp(union ibmvnic_crq *crq,
 	case PARTIALSUCCESS:
 		dev_info(dev, "req=%lld, rsp=%ld in %s queue, retrying.\n",
 			 *req_value,
-			 (long int)be64_to_cpu(crq->request_capability_rsp.
+			 (long)be64_to_cpu(crq->request_capability_rsp.
 					       number), name);
 
 		if (be16_to_cpu(crq->request_capability_rsp.capability) ==
@@ -4482,7 +4482,7 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq,
 	netdev_dbg(adapter->netdev, "Login Response Buffer:\n");
 	for (i = 0; i < (adapter->login_rsp_buf_sz - 1) / 8 + 1; i++) {
 		netdev_dbg(adapter->netdev, "%016lx\n",
-			   ((unsigned long int *)(adapter->login_rsp_buf))[i]);
+			   ((unsigned long *)(adapter->login_rsp_buf))[i]);
 	}
 
 	/* Sanity checks */
@@ -4825,8 +4825,8 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq,
 	long rc;
 
 	netdev_dbg(netdev, "Handling CRQ: %016lx %016lx\n",
-		   (unsigned long int)cpu_to_be64(u64_crq[0]),
-		   (unsigned long int)cpu_to_be64(u64_crq[1]));
+		   (unsigned long)cpu_to_be64(u64_crq[0]),
+		   (unsigned long)cpu_to_be64(u64_crq[1]));
 	switch (gen_crq->first) {
 	case IBMVNIC_CRQ_INIT_RSP:
 		switch (gen_crq->cmd) {
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next v2 2/8] ibmvnic: fix block comments
  2021-02-11  6:43 [PATCH net-next v2 0/8] a set of fixes of coding style Lijun Pan
  2021-02-11  6:43 ` [PATCH net-next v2 1/8] ibmvnic: prefer 'unsigned long' over 'unsigned long int' Lijun Pan
@ 2021-02-11  6:43 ` Lijun Pan
  2021-02-11  6:43 ` [PATCH net-next v2 3/8] ibmvnic: fix braces Lijun Pan
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Lijun Pan @ 2021-02-11  6:43 UTC (permalink / raw)
  To: netdev; +Cc: Lijun Pan, Saeed Mahameed

Fix the following checkpatch warning:
WARNING: networking block comments don't use an empty /* line, use /* Comment...

Signed-off-by: Lijun Pan <lijunp213@gmail.com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 55970f02d9da..5c6f6a7b2e3f 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1221,8 +1221,7 @@ static int ibmvnic_open(struct net_device *netdev)
 	rc = __ibmvnic_open(netdev);
 
 out:
-	/*
-	 * If open fails due to a pending failover, set device state and
+	/* If open fails due to a pending failover, set device state and
 	 * return. Device operation will be handled by reset routine.
 	 */
 	if (rc && adapter->failover_pending) {
@@ -1946,8 +1945,7 @@ static int do_reset(struct ibmvnic_adapter *adapter,
 	if (!(adapter->reset_reason == VNIC_RESET_CHANGE_PARAM))
 		rtnl_lock();
 
-	/*
-	 * Now that we have the rtnl lock, clear any pending failover.
+	/* Now that we have the rtnl lock, clear any pending failover.
 	 * This will ensure ibmvnic_open() has either completed or will
 	 * block until failover is complete.
 	 */
@@ -2249,8 +2247,7 @@ static void __ibmvnic_reset(struct work_struct *work)
 		spin_unlock_irqrestore(&adapter->state_lock, flags);
 
 		if (adapter->force_reset_recovery) {
-			/*
-			 * Since we are doing a hard reset now, clear the
+			/* Since we are doing a hard reset now, clear the
 			 * failover_pending flag so we don't ignore any
 			 * future MOBILITY or other resets.
 			 */
@@ -2322,8 +2319,7 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter,
 	unsigned long flags;
 	int ret;
 
-	/*
-	 * If failover is pending don't schedule any other reset.
+	/* If failover is pending don't schedule any other reset.
 	 * Instead let the failover complete. If there is already a
 	 * a failover reset scheduled, we will detect and drop the
 	 * duplicate reset when walking the ->rwi_list below.
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next v2 3/8] ibmvnic: fix braces
  2021-02-11  6:43 [PATCH net-next v2 0/8] a set of fixes of coding style Lijun Pan
  2021-02-11  6:43 ` [PATCH net-next v2 1/8] ibmvnic: prefer 'unsigned long' over 'unsigned long int' Lijun Pan
  2021-02-11  6:43 ` [PATCH net-next v2 2/8] ibmvnic: fix block comments Lijun Pan
@ 2021-02-11  6:43 ` Lijun Pan
  2021-02-11  6:43 ` [PATCH net-next v2 4/8] ibmvnic: avoid multiple line dereference Lijun Pan
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Lijun Pan @ 2021-02-11  6:43 UTC (permalink / raw)
  To: netdev; +Cc: Lijun Pan, Saeed Mahameed

Fix the following checkpatch warning:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Lijun Pan <lijunp213@gmail.com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 5c6f6a7b2e3f..6c1fc73d66dc 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -2040,9 +2040,8 @@ static int do_reset(struct ibmvnic_adapter *adapter,
 		}
 
 		rc = ibmvnic_login(netdev);
-		if (rc) {
+		if (rc)
 			goto out;
-		}
 
 		if (adapter->reset_reason == VNIC_RESET_CHANGE_PARAM) {
 			rc = init_resources(adapter);
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next v2 4/8] ibmvnic: avoid multiple line dereference
  2021-02-11  6:43 [PATCH net-next v2 0/8] a set of fixes of coding style Lijun Pan
                   ` (2 preceding siblings ...)
  2021-02-11  6:43 ` [PATCH net-next v2 3/8] ibmvnic: fix braces Lijun Pan
@ 2021-02-11  6:43 ` Lijun Pan
  2021-02-11  6:43 ` [PATCH net-next v2 5/8] ibmvnic: fix miscellaneous checks Lijun Pan
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Lijun Pan @ 2021-02-11  6:43 UTC (permalink / raw)
  To: netdev; +Cc: Lijun Pan, Saeed Mahameed

Fix the following checkpatch warning:
WARNING: Avoid multiple line dereference

Signed-off-by: Lijun Pan <lijunp213@gmail.com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 6c1fc73d66dc..67b09a53d7ac 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -2440,9 +2440,8 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget)
 		if (!pending_scrq(adapter, rx_scrq))
 			break;
 		next = ibmvnic_next_scrq(adapter, rx_scrq);
-		rx_buff =
-		    (struct ibmvnic_rx_buff *)be64_to_cpu(next->
-							  rx_comp.correlator);
+		rx_buff = (struct ibmvnic_rx_buff *)
+			  be64_to_cpu(next->rx_comp.correlator);
 		/* do error checking */
 		if (next->rx_comp.rc) {
 			netdev_dbg(netdev, "rx buffer returned with rc %x\n",
@@ -3855,15 +3854,15 @@ static int send_login(struct ibmvnic_adapter *adapter)
 
 	for (i = 0; i < adapter->req_tx_queues; i++) {
 		if (adapter->tx_scrq[i]) {
-			tx_list_p[i] = cpu_to_be64(adapter->tx_scrq[i]->
-						   crq_num);
+			tx_list_p[i] =
+				cpu_to_be64(adapter->tx_scrq[i]->crq_num);
 		}
 	}
 
 	for (i = 0; i < adapter->req_rx_queues; i++) {
 		if (adapter->rx_scrq[i]) {
-			rx_list_p[i] = cpu_to_be64(adapter->rx_scrq[i]->
-						   crq_num);
+			rx_list_p[i] =
+				cpu_to_be64(adapter->rx_scrq[i]->crq_num);
 		}
 	}
 
@@ -4406,8 +4405,8 @@ static void handle_request_cap_rsp(union ibmvnic_crq *crq,
 	case PARTIALSUCCESS:
 		dev_info(dev, "req=%lld, rsp=%ld in %s queue, retrying.\n",
 			 *req_value,
-			 (long)be64_to_cpu(crq->request_capability_rsp.
-					       number), name);
+			 (long)be64_to_cpu(crq->request_capability_rsp.number),
+			 name);
 
 		if (be16_to_cpu(crq->request_capability_rsp.capability) ==
 		    REQ_MTU) {
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next v2 5/8] ibmvnic: fix miscellaneous checks
  2021-02-11  6:43 [PATCH net-next v2 0/8] a set of fixes of coding style Lijun Pan
                   ` (3 preceding siblings ...)
  2021-02-11  6:43 ` [PATCH net-next v2 4/8] ibmvnic: avoid multiple line dereference Lijun Pan
@ 2021-02-11  6:43 ` Lijun Pan
  2021-02-11  6:43 ` [PATCH net-next v2 6/8] ibmvnic: add comments for spinlock_t definitions Lijun Pan
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Lijun Pan @ 2021-02-11  6:43 UTC (permalink / raw)
  To: netdev; +Cc: Lijun Pan, Saeed Mahameed

Fix the following checkpatch checks:
CHECK: Macro argument 'off' may be better as '(off)' to
avoid precedence issues
CHECK: Alignment should match open parenthesis
CHECK: multiple assignments should be avoided
CHECK: Blank lines aren't necessary before a close brace '}'
CHECK: Please use a blank line after function/struct/union/enum
declarations
CHECK: Unnecessary parentheses around 'rc != H_FUNCTION'

Signed-off-by: Lijun Pan <lijunp213@gmail.com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 67b09a53d7ac..0c27a1f9663a 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -115,7 +115,7 @@ struct ibmvnic_stat {
 
 #define IBMVNIC_STAT_OFF(stat) (offsetof(struct ibmvnic_adapter, stats) + \
 			     offsetof(struct ibmvnic_statistics, stat))
-#define IBMVNIC_GET_STAT(a, off) (*((u64 *)(((unsigned long)(a)) + off)))
+#define IBMVNIC_GET_STAT(a, off) (*((u64 *)(((unsigned long)(a)) + (off))))
 
 static const struct ibmvnic_stat ibmvnic_stats[] = {
 	{"rx_packets", IBMVNIC_STAT_OFF(rx_packets)},
@@ -2069,14 +2069,14 @@ static int do_reset(struct ibmvnic_adapter *adapter,
 			rc = reset_tx_pools(adapter);
 			if (rc) {
 				netdev_dbg(adapter->netdev, "reset tx pools failed (%d)\n",
-						rc);
+					   rc);
 				goto out;
 			}
 
 			rc = reset_rx_pools(adapter);
 			if (rc) {
 				netdev_dbg(adapter->netdev, "reset rx pools failed (%d)\n",
-						rc);
+					   rc);
 				goto out;
 			}
 		}
@@ -2333,7 +2333,8 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter,
 
 	if (adapter->state == VNIC_PROBING) {
 		netdev_warn(netdev, "Adapter reset during probe\n");
-		ret = adapter->init_done_rc = EAGAIN;
+		adapter->init_done_rc = EAGAIN;
+		ret = EAGAIN;
 		goto err;
 	}
 
@@ -2746,7 +2747,6 @@ static int ibmvnic_set_channels(struct net_device *netdev,
 			    channels->rx_count, channels->tx_count,
 			    adapter->req_rx_queues, adapter->req_tx_queues);
 	return ret;
-
 }
 
 static void ibmvnic_get_strings(struct net_device *dev, u32 stringset, u8 *data)
@@ -2835,8 +2835,8 @@ static void ibmvnic_get_ethtool_stats(struct net_device *dev,
 		return;
 
 	for (i = 0; i < ARRAY_SIZE(ibmvnic_stats); i++)
-		data[i] = be64_to_cpu(IBMVNIC_GET_STAT(adapter,
-						ibmvnic_stats[i].offset));
+		data[i] = be64_to_cpu(IBMVNIC_GET_STAT
+				      (adapter, ibmvnic_stats[i].offset));
 
 	for (j = 0; j < adapter->req_tx_queues; j++) {
 		data[i] = adapter->tx_stats_buffers[j].packets;
@@ -2876,6 +2876,7 @@ static int ibmvnic_set_priv_flags(struct net_device *netdev, u32 flags)
 
 	return 0;
 }
+
 static const struct ethtool_ops ibmvnic_ethtool_ops = {
 	.get_drvinfo		= ibmvnic_get_drvinfo,
 	.get_msglevel		= ibmvnic_get_msglevel,
@@ -3145,7 +3146,7 @@ static int enable_scrq_irq(struct ibmvnic_adapter *adapter,
 		/* H_EOI would fail with rc = H_FUNCTION when running
 		 * in XIVE mode which is expected, but not an error.
 		 */
-		if (rc && (rc != H_FUNCTION))
+		if (rc && rc != H_FUNCTION)
 			dev_err(dev, "H_EOI FAILED irq 0x%llx. rc=%ld\n",
 				val, rc);
 	}
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next v2 6/8] ibmvnic: add comments for spinlock_t definitions
  2021-02-11  6:43 [PATCH net-next v2 0/8] a set of fixes of coding style Lijun Pan
                   ` (4 preceding siblings ...)
  2021-02-11  6:43 ` [PATCH net-next v2 5/8] ibmvnic: fix miscellaneous checks Lijun Pan
@ 2021-02-11  6:43 ` Lijun Pan
  2021-02-11  6:43 ` [PATCH net-next v2 7/8] ibmvnic: remove unused spinlock_t stats_lock definition Lijun Pan
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Lijun Pan @ 2021-02-11  6:43 UTC (permalink / raw)
  To: netdev; +Cc: Lijun Pan, Saeed Mahameed

There are several spinlock_t definitions without comments.
Add them.

Signed-off-by: Lijun Pan <lijunp213@gmail.com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/ibm/ibmvnic.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h
index c09c3f6bba9f..8f73a30a7593 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.h
+++ b/drivers/net/ethernet/ibm/ibmvnic.h
@@ -845,6 +845,7 @@ struct ibmvnic_crq_queue {
 	union ibmvnic_crq *msgs;
 	int size, cur;
 	dma_addr_t msg_token;
+	/* Used for serialization of msgs, cur */
 	spinlock_t lock;
 	bool active;
 	char name[32];
@@ -876,6 +877,7 @@ struct ibmvnic_sub_crq_queue {
 	unsigned int irq;
 	unsigned int pool_index;
 	int scrq_num;
+	/* Used for serialization of msgs, cur */
 	spinlock_t lock;
 	struct sk_buff *rx_skb_top;
 	struct ibmvnic_adapter *adapter;
@@ -1080,9 +1082,12 @@ struct ibmvnic_adapter {
 
 	struct tasklet_struct tasklet;
 	enum vnic_state state;
+	/* Used for serializatin of state field */
+	spinlock_t state_lock;
 	enum ibmvnic_reset_reason reset_reason;
-	spinlock_t rwi_lock;
 	struct list_head rwi_list;
+	/* Used for serialization of rwi_list */
+	spinlock_t rwi_lock;
 	struct work_struct ibmvnic_reset;
 	struct delayed_work ibmvnic_delayed_reset;
 	unsigned long resetting;
@@ -1096,7 +1101,4 @@ struct ibmvnic_adapter {
 
 	struct ibmvnic_tunables desired;
 	struct ibmvnic_tunables fallback;
-
-	/* Used for serializatin of state field */
-	spinlock_t state_lock;
 };
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next v2 7/8] ibmvnic: remove unused spinlock_t stats_lock definition
  2021-02-11  6:43 [PATCH net-next v2 0/8] a set of fixes of coding style Lijun Pan
                   ` (5 preceding siblings ...)
  2021-02-11  6:43 ` [PATCH net-next v2 6/8] ibmvnic: add comments for spinlock_t definitions Lijun Pan
@ 2021-02-11  6:43 ` Lijun Pan
  2021-02-11  6:43 ` [PATCH net-next v2 8/8] ibmvnic: prefer strscpy over strlcpy Lijun Pan
  2021-02-11 21:10 ` [PATCH net-next v2 0/8] a set of fixes of coding style patchwork-bot+netdevbpf
  8 siblings, 0 replies; 10+ messages in thread
From: Lijun Pan @ 2021-02-11  6:43 UTC (permalink / raw)
  To: netdev; +Cc: Lijun Pan, Saeed Mahameed

stats_lock is no longer used. So remove it.

Signed-off-by: Lijun Pan <lijunp213@gmail.com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 2 --
 drivers/net/ethernet/ibm/ibmvnic.h | 1 -
 2 files changed, 3 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 0c27a1f9663a..778e56e05cd7 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -5295,8 +5295,6 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id)
 	netdev->ethtool_ops = &ibmvnic_ethtool_ops;
 	SET_NETDEV_DEV(netdev, &dev->dev);
 
-	spin_lock_init(&adapter->stats_lock);
-
 	INIT_WORK(&adapter->ibmvnic_reset, __ibmvnic_reset);
 	INIT_DELAYED_WORK(&adapter->ibmvnic_delayed_reset,
 			  __ibmvnic_delayed_reset);
diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h
index 8f73a30a7593..270d1cac86a4 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.h
+++ b/drivers/net/ethernet/ibm/ibmvnic.h
@@ -987,7 +987,6 @@ struct ibmvnic_adapter {
 	struct ibmvnic_statistics stats;
 	dma_addr_t stats_token;
 	struct completion stats_done;
-	spinlock_t stats_lock;
 	int replenish_no_mem;
 	int replenish_add_buff_success;
 	int replenish_add_buff_failure;
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next v2 8/8] ibmvnic: prefer strscpy over strlcpy
  2021-02-11  6:43 [PATCH net-next v2 0/8] a set of fixes of coding style Lijun Pan
                   ` (6 preceding siblings ...)
  2021-02-11  6:43 ` [PATCH net-next v2 7/8] ibmvnic: remove unused spinlock_t stats_lock definition Lijun Pan
@ 2021-02-11  6:43 ` Lijun Pan
  2021-02-11 21:10 ` [PATCH net-next v2 0/8] a set of fixes of coding style patchwork-bot+netdevbpf
  8 siblings, 0 replies; 10+ messages in thread
From: Lijun Pan @ 2021-02-11  6:43 UTC (permalink / raw)
  To: netdev; +Cc: Lijun Pan

Fix this warning:
WARNING: Prefer strscpy over strlcpy - see: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/

Signed-off-by: Lijun Pan <lijunp213@gmail.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 778e56e05cd7..1774fbaab146 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -2633,9 +2633,9 @@ static void ibmvnic_get_drvinfo(struct net_device *netdev,
 {
 	struct ibmvnic_adapter *adapter = netdev_priv(netdev);
 
-	strlcpy(info->driver, ibmvnic_driver_name, sizeof(info->driver));
-	strlcpy(info->version, IBMVNIC_DRIVER_VERSION, sizeof(info->version));
-	strlcpy(info->fw_version, adapter->fw_version,
+	strscpy(info->driver, ibmvnic_driver_name, sizeof(info->driver));
+	strscpy(info->version, IBMVNIC_DRIVER_VERSION, sizeof(info->version));
+	strscpy(info->fw_version, adapter->fw_version,
 		sizeof(info->fw_version));
 }
 
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next v2 0/8] a set of fixes of coding style
  2021-02-11  6:43 [PATCH net-next v2 0/8] a set of fixes of coding style Lijun Pan
                   ` (7 preceding siblings ...)
  2021-02-11  6:43 ` [PATCH net-next v2 8/8] ibmvnic: prefer strscpy over strlcpy Lijun Pan
@ 2021-02-11 21:10 ` patchwork-bot+netdevbpf
  8 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-11 21:10 UTC (permalink / raw)
  To: Lijun Pan; +Cc: netdev

Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Thu, 11 Feb 2021 00:43:17 -0600 you wrote:
> This series address several coding style problems.
> 
> v2: rebased on top of tree. Add the Reviewed-by tag from v1 reviews.
>     patch 8/8 is new.
> 
> Lijun Pan (8):
>   ibmvnic: prefer 'unsigned long' over 'unsigned long int'
>   ibmvnic: fix block comments
>   ibmvnic: fix braces
>   ibmvnic: avoid multiple line dereference
>   ibmvnic: fix miscellaneous checks
>   ibmvnic: add comments for spinlock_t definitions
>   ibmvnic: remove unused spinlock_t stats_lock definition
>   ibmvnic: prefer strscpy over strlcpy
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/8] ibmvnic: prefer 'unsigned long' over 'unsigned long int'
    https://git.kernel.org/netdev/net-next/c/429aa36469f9
  - [net-next,v2,2/8] ibmvnic: fix block comments
    https://git.kernel.org/netdev/net-next/c/bab08bedcdc3
  - [net-next,v2,3/8] ibmvnic: fix braces
    https://git.kernel.org/netdev/net-next/c/f78afaace636
  - [net-next,v2,4/8] ibmvnic: avoid multiple line dereference
    https://git.kernel.org/netdev/net-next/c/914789acaaae
  - [net-next,v2,5/8] ibmvnic: fix miscellaneous checks
    https://git.kernel.org/netdev/net-next/c/91dc5d2553fb
  - [net-next,v2,6/8] ibmvnic: add comments for spinlock_t definitions
    https://git.kernel.org/netdev/net-next/c/a369d96ca554
  - [net-next,v2,7/8] ibmvnic: remove unused spinlock_t stats_lock definition
    https://git.kernel.org/netdev/net-next/c/4bb9f2e48299
  - [net-next,v2,8/8] ibmvnic: prefer strscpy over strlcpy
    https://git.kernel.org/netdev/net-next/c/8a96c80e2774

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-02-11 21:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-11  6:43 [PATCH net-next v2 0/8] a set of fixes of coding style Lijun Pan
2021-02-11  6:43 ` [PATCH net-next v2 1/8] ibmvnic: prefer 'unsigned long' over 'unsigned long int' Lijun Pan
2021-02-11  6:43 ` [PATCH net-next v2 2/8] ibmvnic: fix block comments Lijun Pan
2021-02-11  6:43 ` [PATCH net-next v2 3/8] ibmvnic: fix braces Lijun Pan
2021-02-11  6:43 ` [PATCH net-next v2 4/8] ibmvnic: avoid multiple line dereference Lijun Pan
2021-02-11  6:43 ` [PATCH net-next v2 5/8] ibmvnic: fix miscellaneous checks Lijun Pan
2021-02-11  6:43 ` [PATCH net-next v2 6/8] ibmvnic: add comments for spinlock_t definitions Lijun Pan
2021-02-11  6:43 ` [PATCH net-next v2 7/8] ibmvnic: remove unused spinlock_t stats_lock definition Lijun Pan
2021-02-11  6:43 ` [PATCH net-next v2 8/8] ibmvnic: prefer strscpy over strlcpy Lijun Pan
2021-02-11 21:10 ` [PATCH net-next v2 0/8] a set of fixes of coding style patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.