All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/47] Address issues detected by static analysis tools
@ 2017-10-06 21:32 Bart Van Assche
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:32 UTC (permalink / raw)
  To: Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche

Hello Doug,

As we all know there are several static analysis tools available for the Linux
kernel and these tools are valuable. I'm referring to increasing the gcc
warning level (W=1), sparse and smatch. It is helpful to analyze new code with
these tools before submitting a patch. These tools are most useful if existing
code is clean. Hence this patch series that significantly reduces the number
of complaints reported by static analysis tools. Please consider this patch
series for kernel v4.15.

Thanks,

Bart.

Bart Van Assche (47):
  IB/core: Fix endianness annotation in rdma_is_multicast_addr()
  IB/cm: Suppress gcc 7 fall-through complaints
  RDMA/cma: Avoid triggering undefined behavior
  RDMA/iwcm: Remove a set-but-not-used variable
  RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing
  RDMA/isert: Suppress gcc 7 fall-through complaints
  RDMA/bnxt_re: Suppress gcc 7 fall-through complaints
  RDMA/bnxt_re: Remove set-but-not-used variables
  RDMA/cxgb3: Annotate locking assumptions
  RDMA/cxgb3: Annotate an RCU pointer
  RDMA/cxgb3: Remove a set-but-not-used variable
  RDMA/cxgb4: Fix indentation
  RDMA/cxgb4: Declare a local variable 'static'
  RDMA/cxgb4: Suppress gcc 7 fall-through complaints
  RDMA/cxgb4: Remove a set-but-not-used variable
  IB/hfi1: Suppress gcc 7 fall-through complaints
  IB/hfi1: Remove set-but-not-used variables
  IB/hfi1: Define hfi1_handle_cnp_tbl[] once
  IB/hns: Annotate iomem pointers correctly
  IB/hns: Declare local functions 'static'
  RDMA/i40iw: Fix a race condition
  RDMA/i40iw: Suppress gcc 7 fall-through complaints
  RDMA/i40iw: Remove a set-but-not-used variable
  IB/mthca: Fix indentation
  IB/mlx4: Suppress gcc 7 fall-through complaints
  IB/mlx5: Suppress gcc 7 fall-through complaints
  IB/mlx5: Remove a set-but-not-used variable
  IB/nes: Fix indentation
  IB/nes: Suppress gcc 7 fall-through complaints
  IB/nes: Remove set-but-not-used variables
  IB/nes: Fix a race condition in nes_inetaddr_event()
  RDMA/ocrdma: Use NULL instead of 0 to represent a pointer
  RDMA/ocrdma: Suppress gcc 7 fall-through complaints
  RDMA/ocrdma: Remove set-but-not-used variables
  IB/opa: Fix endianness annotation of opa_is_extended_lid()
  RDMA/qedr: Use NULL instead of 0 to represent a pointer
  RDMA/qedr: Declare local functions static
  RDMA/qedr: Annotate iomem pointers correctly
  RDMA/qedr: Remove set-but-not-used variables
  IB/qib: Make qib_inc_eeprom_err() macro more safe to use
  IB/qib: Suppress gcc 7 fall-through complaints
  IB/qib: Remove set-but-not-used variables
  RDMA/rdmavt: Suppress gcc 7 fall-through complaints
  RDMA/rxe: Suppress gcc 7 fall-through complaints
  RDMA/usnic: Make the compiler check declaration consistency during
    compilation
  RDMA/usnic: Remove a set-but-not-used variable
  RDMA/usnic: Instantiate data structures once

 drivers/infiniband/core/cm.c                  |  1 +
 drivers/infiniband/core/cma.c                 | 11 ++--
 drivers/infiniband/core/iwcm.c                |  3 --
 drivers/infiniband/core/uverbs_ioctl.c        | 20 ++++----
 drivers/infiniband/hw/bnxt_re/ib_verbs.c      | 12 ++---
 drivers/infiniband/hw/bnxt_re/qplib_fp.c      |  7 +--
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.c    |  4 --
 drivers/infiniband/hw/bnxt_re/qplib_sp.c      |  5 +-
 drivers/infiniband/hw/cxgb3/iwch_cm.c         |  6 +--
 drivers/infiniband/hw/cxgb3/iwch_qp.c         |  3 ++
 drivers/infiniband/hw/cxgb4/cm.c              | 14 +++--
 drivers/infiniband/hw/cxgb4/device.c          |  4 +-
 drivers/infiniband/hw/hfi1/driver.c           |  6 +++
 drivers/infiniband/hw/hfi1/file_ops.c         |  4 +-
 drivers/infiniband/hw/hfi1/hfi.h              |  5 --
 drivers/infiniband/hw/hfi1/mad.c              |  3 +-
 drivers/infiniband/hw/hfi1/rc.c               |  2 +-
 drivers/infiniband/hw/hfi1/ruc.c              |  9 ----
 drivers/infiniband/hw/hfi1/sdma.c             |  5 +-
 drivers/infiniband/hw/hfi1/ud.c               |  2 -
 drivers/infiniband/hw/hfi1/verbs.c            | 10 ----
 drivers/infiniband/hw/hns/hns_roce_eq.c       |  6 +--
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c    | 73 +++++++++++++++------------
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c    |  3 +-
 drivers/infiniband/hw/i40iw/i40iw_cm.c        |  3 +-
 drivers/infiniband/hw/i40iw/i40iw_hw.c        |  1 +
 drivers/infiniband/hw/i40iw/i40iw_puda.c      |  1 +
 drivers/infiniband/hw/i40iw/i40iw_utils.c     | 13 +++--
 drivers/infiniband/hw/mlx4/cq.c               |  2 +
 drivers/infiniband/hw/mlx4/mcg.c              |  1 +
 drivers/infiniband/hw/mlx5/cq.c               |  2 +
 drivers/infiniband/hw/mlx5/qp.c               |  3 +-
 drivers/infiniband/hw/mthca/mthca_main.c      | 10 ++--
 drivers/infiniband/hw/nes/nes.c               | 33 +++++++-----
 drivers/infiniband/hw/nes/nes_cm.c            |  9 +---
 drivers/infiniband/hw/nes/nes_hw.c            |  6 +--
 drivers/infiniband/hw/nes/nes_nic.c           | 10 ++--
 drivers/infiniband/hw/nes/nes_utils.c         | 13 +++--
 drivers/infiniband/hw/nes/nes_verbs.c         | 12 ++---
 drivers/infiniband/hw/ocrdma/ocrdma_hw.c      |  6 +--
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c   |  4 +-
 drivers/infiniband/hw/qedr/main.c             | 24 ++++-----
 drivers/infiniband/hw/qedr/qedr_iw_cm.c       | 14 ++---
 drivers/infiniband/hw/qedr/qedr_roce_cm.c     | 29 +++++------
 drivers/infiniband/hw/qedr/verbs.c            |  9 +---
 drivers/infiniband/hw/qib/qib.h               |  2 +-
 drivers/infiniband/hw/qib/qib_diag.c          |  6 ---
 drivers/infiniband/hw/qib/qib_file_ops.c      |  9 ----
 drivers/infiniband/hw/qib/qib_iba6120.c       |  2 -
 drivers/infiniband/hw/qib/qib_iba7220.c       |  3 --
 drivers/infiniband/hw/qib/qib_iba7322.c       | 15 ++----
 drivers/infiniband/hw/qib/qib_mad.c           |  4 +-
 drivers/infiniband/hw/qib/qib_pcie.c          |  3 +-
 drivers/infiniband/hw/qib/qib_rc.c            |  2 +-
 drivers/infiniband/hw/qib/qib_sd7220.c        |  2 -
 drivers/infiniband/hw/qib/qib_sdma.c          |  2 +-
 drivers/infiniband/hw/qib/qib_tx.c            |  4 --
 drivers/infiniband/hw/qib/qib_verbs.c         |  3 +-
 drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c |  2 -
 drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h | 25 +--------
 drivers/infiniband/hw/usnic/usnic_ib_sysfs.c  |  1 +
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c  | 25 +++++++++
 drivers/infiniband/sw/rdmavt/qp.c             |  1 +
 drivers/infiniband/sw/rxe/rxe_comp.c          |  4 +-
 drivers/infiniband/sw/rxe/rxe_task.c          |  2 +-
 drivers/infiniband/sw/rxe/rxe_verbs.c         |  1 +
 drivers/infiniband/ulp/isert/ib_isert.c       | 14 ++---
 drivers/net/ethernet/chelsio/cxgb3/t3cdev.h   |  2 +-
 include/rdma/ib_addr.h                        |  4 +-
 include/rdma/opa_addr.h                       |  2 +-
 70 files changed, 252 insertions(+), 311 deletions(-)

-- 
2.14.2

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

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

* [PATCH 01/47] IB/core: Fix endianness annotation in rdma_is_multicast_addr()
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-06 21:32   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-2-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:32   ` [PATCH 02/47] IB/cm: Suppress gcc 7 fall-through complaints Bart Van Assche
                     ` (46 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:32 UTC (permalink / raw)
  To: Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche

Since ipv4_addr is a big endian 32-bit number, annotate it as such.

Fixes: commit be1d325a3358 ("IB/core: Set RoCEv2 MGID according to spec")
Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
---
 include/rdma/ib_addr.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
index ec5008cf5d51..cfa82d16573d 100644
--- a/include/rdma/ib_addr.h
+++ b/include/rdma/ib_addr.h
@@ -305,12 +305,12 @@ static inline void rdma_get_ll_mac(struct in6_addr *addr, u8 *mac)
 
 static inline int rdma_is_multicast_addr(struct in6_addr *addr)
 {
-	u32 ipv4_addr;
+	__be32 ipv4_addr;
 
 	if (addr->s6_addr[0] == 0xff)
 		return 1;
 
-	memcpy(&ipv4_addr, addr->s6_addr + 12, 4);
+	ipv4_addr = addr->s6_addr32[3];
 	return (ipv6_addr_v4mapped(addr) && ipv4_is_multicast(ipv4_addr));
 }
 
-- 
2.14.2

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

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

* [PATCH 02/47] IB/cm: Suppress gcc 7 fall-through complaints
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:32   ` [PATCH 01/47] IB/core: Fix endianness annotation in rdma_is_multicast_addr() Bart Van Assche
@ 2017-10-06 21:32   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-3-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:32   ` [PATCH 03/47] RDMA/cma: Avoid triggering undefined behavior Bart Van Assche
                     ` (45 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:32 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Sean Hefty

Avoid that gcc 7 reports the following warning when building with W=1:

warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/core/cm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index d80911d4abb7..5927ee4e57ca 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -2808,6 +2808,7 @@ int ib_send_cm_mra(struct ib_cm_id *cm_id,
 			msg_response = CM_MSG_RESPONSE_OTHER;
 			break;
 		}
+		/* fall through */
 	default:
 		ret = -EINVAL;
 		goto error1;
-- 
2.14.2

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

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

* [PATCH 03/47] RDMA/cma: Avoid triggering undefined behavior
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:32   ` [PATCH 01/47] IB/core: Fix endianness annotation in rdma_is_multicast_addr() Bart Van Assche
  2017-10-06 21:32   ` [PATCH 02/47] IB/cm: Suppress gcc 7 fall-through complaints Bart Van Assche
@ 2017-10-06 21:32   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-4-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:32   ` [PATCH 04/47] RDMA/iwcm: Remove a set-but-not-used variable Bart Van Assche
                     ` (44 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:32 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Sean Hefty

According to the C standard the behavior of computations with
integer operands is as follows:
* A computation involving unsigned operands can never overflow,
  because a result that cannot be represented by the resulting
  unsigned integer type is reduced modulo the number that is one
  greater than the largest value that can be represented by the
  resulting type.
* The behavior for signed integer underflow and overflow is
  undefined.

Hence only use unsigned integers when checking for integer
overflow.

This patch is what I came up with after having analyzed the
following smatch warnings:

drivers/infiniband/core/cma.c:3448: cma_resolve_ib_udp() warn: signed overflow undefined. 'offset + conn_param->private_data_len < conn_param->private_data_len'
drivers/infiniband/core/cma.c:3505: cma_connect_ib() warn: signed overflow undefined. 'offset + conn_param->private_data_len < conn_param->private_data_len'

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/core/cma.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 852c8fec8088..fa79c7076ccd 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1540,7 +1540,7 @@ static struct rdma_id_private *cma_id_from_event(struct ib_cm_id *cm_id,
 	return id_priv;
 }
 
-static inline int cma_user_data_offset(struct rdma_id_private *id_priv)
+static inline u8 cma_user_data_offset(struct rdma_id_private *id_priv)
 {
 	return cma_family(id_priv) == AF_IB ? 0 : sizeof(struct cma_hdr);
 }
@@ -1942,7 +1942,8 @@ static int cma_req_handler(struct ib_cm_id *cm_id, struct ib_cm_event *ib_event)
 	struct rdma_id_private *listen_id, *conn_id = NULL;
 	struct rdma_cm_event event;
 	struct net_device *net_dev;
-	int offset, ret;
+	u8 offset;
+	int ret;
 
 	listen_id = cma_id_from_event(cm_id, ib_event, &net_dev);
 	if (IS_ERR(listen_id))
@@ -3440,7 +3441,8 @@ static int cma_resolve_ib_udp(struct rdma_id_private *id_priv,
 	struct ib_cm_sidr_req_param req;
 	struct ib_cm_id	*id;
 	void *private_data;
-	int offset, ret;
+	u8 offset;
+	int ret;
 
 	memset(&req, 0, sizeof req);
 	offset = cma_user_data_offset(id_priv);
@@ -3497,7 +3499,8 @@ static int cma_connect_ib(struct rdma_id_private *id_priv,
 	struct rdma_route *route;
 	void *private_data;
 	struct ib_cm_id	*id;
-	int offset, ret;
+	u8 offset;
+	int ret;
 
 	memset(&req, 0, sizeof req);
 	offset = cma_user_data_offset(id_priv);
-- 
2.14.2

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

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

* [PATCH 04/47] RDMA/iwcm: Remove a set-but-not-used variable
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (2 preceding siblings ...)
  2017-10-06 21:32   ` [PATCH 03/47] RDMA/cma: Avoid triggering undefined behavior Bart Van Assche
@ 2017-10-06 21:32   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-5-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:32   ` [PATCH 05/47] RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing Bart Van Assche
                     ` (43 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:32 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Steve Wise

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---
 drivers/infiniband/core/iwcm.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c
index fcf42f6bb82a..e9e189ec7502 100644
--- a/drivers/infiniband/core/iwcm.c
+++ b/drivers/infiniband/core/iwcm.c
@@ -447,9 +447,6 @@ static void destroy_cm_id(struct iw_cm_id *cm_id)
  */
 void iw_destroy_cm_id(struct iw_cm_id *cm_id)
 {
-	struct iwcm_id_private *cm_id_priv;
-
-	cm_id_priv = container_of(cm_id, struct iwcm_id_private, id);
 	destroy_cm_id(cm_id);
 }
 EXPORT_SYMBOL(iw_destroy_cm_id);
-- 
2.14.2

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

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

* [PATCH 05/47] RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (3 preceding siblings ...)
  2017-10-06 21:32   ` [PATCH 04/47] RDMA/iwcm: Remove a set-but-not-used variable Bart Van Assche
@ 2017-10-06 21:32   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-6-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:32   ` [PATCH 06/47] RDMA/isert: Suppress gcc 7 fall-through complaints Bart Van Assche
                     ` (42 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:32 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Matan Barak,
	Yishai Hadas

This patch reduces the number of #ifdefs and also avoids that
smatch reports the following:

drivers/infiniband/core/uverbs_ioctl.c:276: ib_uverbs_cmd_verbs() warn: if statement not indented
drivers/infiniband/core/uverbs_ioctl.c:280: ib_uverbs_cmd_verbs() warn: possible memory leak of 'ctx'
drivers/infiniband/core/uverbs_ioctl.c:315: ib_uverbs_cmd_verbs() warn: if statement not indented

References: commit fac9658cabb9 ("IB/core: Add new ioctl interface")
Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/core/uverbs_ioctl.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c
index 5286ad57d903..53f780ea49fe 100644
--- a/drivers/infiniband/core/uverbs_ioctl.c
+++ b/drivers/infiniband/core/uverbs_ioctl.c
@@ -234,7 +234,7 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
 	const struct uverbs_method_spec *method_spec;
 	long err = 0;
 	unsigned int i;
-	struct {
+	struct attr_and_bundle {
 		struct ib_uverbs_attr		*uattrs;
 		struct uverbs_attr_bundle	*uverbs_attr_bundle;
 	} *ctx = NULL;
@@ -242,7 +242,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
 	unsigned long *curr_bitmap;
 	size_t ctx_size;
 #ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
-	uintptr_t data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)];
+	uintptr_t __data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)];
+	struct attr_and_bundle *const data = (void *)__data;
+#else
+	struct attr_and_bundle *const data = NULL;
 #endif
 
 	if (hdr->reserved)
@@ -269,13 +272,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
 			(method_spec->num_child_attrs / BITS_PER_LONG +
 			 method_spec->num_buckets);
 
-#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
 	if (ctx_size <= UVERBS_OPTIMIZE_USING_STACK_SZ)
-		ctx = (void *)data;
-
+		ctx = data;
 	if (!ctx)
-#endif
-	ctx = kmalloc(ctx_size, GFP_KERNEL);
+		ctx = kmalloc(ctx_size, GFP_KERNEL);
 	if (!ctx)
 		return -ENOMEM;
 
@@ -311,10 +311,8 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
 	err = uverbs_handle_method(buf, ctx->uattrs, hdr->num_attrs, ib_dev,
 				   file, method_spec, ctx->uverbs_attr_bundle);
 out:
-#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
-	if (ctx_size > UVERBS_OPTIMIZE_USING_STACK_SZ)
-#endif
-	kfree(ctx);
+	if (ctx != data)
+		kfree(ctx);
 	return err;
 }
 
-- 
2.14.2

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

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

* [PATCH 06/47] RDMA/isert: Suppress gcc 7 fall-through complaints
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (4 preceding siblings ...)
  2017-10-06 21:32   ` [PATCH 05/47] RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing Bart Van Assche
@ 2017-10-06 21:32   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-7-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:32   ` [PATCH 07/47] RDMA/bnxt_re: " Bart Van Assche
                     ` (41 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:32 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Sagi Grimberg

Avoid that gcc 7 reports the following warning when building with W=1:

warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
---
 drivers/infiniband/ulp/isert/ib_isert.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index ceabdb85df8b..720dfb3a1ac2 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -788,10 +788,11 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
 		 * the rdma cm id
 		 */
 		return 1;
-	case RDMA_CM_EVENT_REJECTED:       /* FALLTHRU */
+	case RDMA_CM_EVENT_REJECTED:
 		isert_info("Connection rejected: %s\n",
 			   rdma_reject_msg(cma_id, event->status));
-	case RDMA_CM_EVENT_UNREACHABLE:    /* FALLTHRU */
+		/* fall through */
+	case RDMA_CM_EVENT_UNREACHABLE:
 	case RDMA_CM_EVENT_CONNECT_ERROR:
 		ret = isert_connect_error(cma_id);
 		break;
@@ -1569,9 +1570,7 @@ isert_put_cmd(struct isert_cmd *isert_cmd, bool comp_err)
 			transport_generic_free_cmd(&cmd->se_cmd, 0);
 			break;
 		}
-		/*
-		 * Fall-through
-		 */
+		/* fall through */
 	default:
 		iscsit_release_cmd(cmd);
 		break;
@@ -1749,8 +1748,9 @@ isert_do_control_comp(struct work_struct *work)
 	switch (cmd->i_state) {
 	case ISTATE_SEND_TASKMGTRSP:
 		iscsit_tmr_post_handler(cmd, cmd->conn);
-	case ISTATE_SEND_REJECT:   /* FALLTHRU */
-	case ISTATE_SEND_TEXTRSP:  /* FALLTHRU */
+		/* fall through */
+	case ISTATE_SEND_REJECT:
+	case ISTATE_SEND_TEXTRSP:
 		cmd->i_state = ISTATE_SENT_STATUS;
 		isert_completion_put(&isert_cmd->tx_desc, isert_cmd,
 				     ib_dev, false);
-- 
2.14.2

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

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

* [PATCH 07/47] RDMA/bnxt_re: Suppress gcc 7 fall-through complaints
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (5 preceding siblings ...)
  2017-10-06 21:32   ` [PATCH 06/47] RDMA/isert: Suppress gcc 7 fall-through complaints Bart Van Assche
@ 2017-10-06 21:32   ` Bart Van Assche
  2017-10-06 21:32   ` [PATCH 08/47] RDMA/bnxt_re: Remove set-but-not-used variables Bart Van Assche
                     ` (40 subsequent siblings)
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:32 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Somnath Kotur

Avoid that gcc 7 reports the following warning when building with W=1:

warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Somnath Kotur <somnath.kotur-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/bnxt_re/qplib_fp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
index e8afc47f8949..e82644cf1aeb 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
@@ -1360,7 +1360,7 @@ int bnxt_qplib_post_send(struct bnxt_qplib_qp *qp,
 
 			break;
 		}
-		/* else, just fall thru */
+		/* fall thru */
 	case BNXT_QPLIB_SWQE_TYPE_SEND_WITH_IMM:
 	case BNXT_QPLIB_SWQE_TYPE_SEND_WITH_INV:
 	{
-- 
2.14.2

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

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

* [PATCH 08/47] RDMA/bnxt_re: Remove set-but-not-used variables
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (6 preceding siblings ...)
  2017-10-06 21:32   ` [PATCH 07/47] RDMA/bnxt_re: " Bart Van Assche
@ 2017-10-06 21:32   ` Bart Van Assche
  2017-10-06 21:32   ` [PATCH 09/47] RDMA/cxgb3: Annotate locking assumptions Bart Van Assche
                     ` (39 subsequent siblings)
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:32 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Somnath Kotur

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Somnath Kotur <somnath.kotur-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/bnxt_re/ib_verbs.c   | 12 +++++-------
 drivers/infiniband/hw/bnxt_re/qplib_fp.c   |  5 -----
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.c |  4 ----
 drivers/infiniband/hw/bnxt_re/qplib_sp.c   |  5 ++---
 4 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index 0d89621d9fe8..af65f8114379 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -1643,7 +1643,7 @@ static int bnxt_re_build_qp1_send_v2(struct bnxt_re_qp *qp,
 	u8 ip_version = 0;
 	u16 vlan_id = 0xFFFF;
 	void *buf;
-	int i, rc = 0, size;
+	int i, rc = 0;
 
 	memset(&qp->qp1_hdr, 0, sizeof(qp->qp1_hdr));
 
@@ -1760,7 +1760,7 @@ static int bnxt_re_build_qp1_send_v2(struct bnxt_re_qp *qp,
 	/* Pack the QP1 to the transmit buffer */
 	buf = bnxt_qplib_get_qp1_sq_buf(&qp->qplib_qp, &sge);
 	if (buf) {
-		size = ib_ud_header_pack(&qp->qp1_hdr, buf);
+		ib_ud_header_pack(&qp->qp1_hdr, buf);
 		for (i = wqe->num_sge; i; i--) {
 			wqe->sg_list[i].addr = wqe->sg_list[i - 1].addr;
 			wqe->sg_list[i].lkey = wqe->sg_list[i - 1].lkey;
@@ -2216,7 +2216,7 @@ static int bnxt_re_post_recv_shadow_qp(struct bnxt_re_dev *rdev,
 				       struct ib_recv_wr *wr)
 {
 	struct bnxt_qplib_swqe wqe;
-	int rc = 0, payload_sz = 0;
+	int rc = 0;
 
 	memset(&wqe, 0, sizeof(wqe));
 	while (wr) {
@@ -2231,8 +2231,7 @@ static int bnxt_re_post_recv_shadow_qp(struct bnxt_re_dev *rdev,
 			rc = -EINVAL;
 			break;
 		}
-		payload_sz = bnxt_re_build_sgl(wr->sg_list, wqe.sg_list,
-					       wr->num_sge);
+		bnxt_re_build_sgl(wr->sg_list, wqe.sg_list, wr->num_sge);
 		wqe.wr_id = wr->wr_id;
 		wqe.type = BNXT_QPLIB_SWQE_TYPE_RECV;
 
@@ -2569,7 +2568,7 @@ static void bnxt_re_process_req_wc(struct ib_wc *wc, struct bnxt_qplib_cqe *cqe)
 static int bnxt_re_check_packet_type(u16 raweth_qp1_flags,
 				     u16 raweth_qp1_flags2)
 {
-	bool is_udp = false, is_ipv6 = false, is_ipv4 = false;
+	bool is_ipv6 = false, is_ipv4 = false;
 
 	/* raweth_qp1_flags Bit 9-6 indicates itype */
 	if ((raweth_qp1_flags & CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ROCE)
@@ -2580,7 +2579,6 @@ static int bnxt_re_check_packet_type(u16 raweth_qp1_flags,
 	    CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_CS_CALC &&
 	    raweth_qp1_flags2 &
 	    CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_L4_CS_CALC) {
-		is_udp = true;
 		/* raweth_qp1_flags2 Bit 8 indicates ip_type. 0-v4 1 - v6 */
 		(raweth_qp1_flags2 &
 		 CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_TYPE) ?
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
index e82644cf1aeb..a82044dacce0 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
@@ -160,11 +160,6 @@ void bnxt_qplib_add_flush_qp(struct bnxt_qplib_qp *qp)
 
 static void __bnxt_qplib_del_flush_qp(struct bnxt_qplib_qp *qp)
 {
-	struct bnxt_qplib_cq *scq, *rcq;
-
-	scq = qp->scq;
-	rcq = qp->rcq;
-
 	if (qp->sq.flushed) {
 		qp->sq.flushed = false;
 		list_del(&qp->sq_flush);
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
index 2bdb1562bd21..000e6a1940b9 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
@@ -88,7 +88,6 @@ static int __send_message(struct bnxt_qplib_rcfw *rcfw, struct cmdq_base *req,
 	unsigned long flags;
 	u32 size, opcode;
 	u16 cookie, cbit;
-	int pg, idx;
 	u8 *preq;
 
 	opcode = req->opcode;
@@ -149,9 +148,6 @@ static int __send_message(struct bnxt_qplib_rcfw *rcfw, struct cmdq_base *req,
 	preq = (u8 *)req;
 	size = req->cmd_size * BNXT_QPLIB_CMDQE_UNITS;
 	do {
-		pg = 0;
-		idx = 0;
-
 		/* Locate the next cmdq slot */
 		sw_prod = HWQ_CMP(cmdq->prod, cmdq);
 		cmdqe = &cmdq_ptr[get_cmdq_pg(sw_prod)][get_cmdq_idx(sw_prod)];
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.c b/drivers/infiniband/hw/bnxt_re/qplib_sp.c
index e277e54a05eb..9543ce51a28a 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c
@@ -720,13 +720,12 @@ int bnxt_qplib_map_tc2cos(struct bnxt_qplib_res *res, u16 *cids)
 	struct cmdq_map_tc_to_cos req;
 	struct creq_map_tc_to_cos_resp resp;
 	u16 cmd_flags = 0;
-	int rc = 0;
 
 	RCFW_CMD_PREP(req, MAP_TC_TO_COS, cmd_flags);
 	req.cos0 = cpu_to_le16(cids[0]);
 	req.cos1 = cpu_to_le16(cids[1]);
 
-	rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,
-					  (void *)&resp, NULL, 0);
+	bnxt_qplib_rcfw_send_message(rcfw, (void *)&req, (void *)&resp, NULL,
+				     0);
 	return 0;
 }
-- 
2.14.2

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

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

* [PATCH 09/47] RDMA/cxgb3: Annotate locking assumptions
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (7 preceding siblings ...)
  2017-10-06 21:32   ` [PATCH 08/47] RDMA/bnxt_re: Remove set-but-not-used variables Bart Van Assche
@ 2017-10-06 21:32   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-10-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:32   ` [PATCH 10/47] RDMA/cxgb3: Annotate an RCU pointer Bart Van Assche
                     ` (38 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:32 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Steve Wise

Tell sparse what the locking assumptions are for __flush_qp() such
that it does not complain about the locking operations inside that
function.

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---
 drivers/infiniband/hw/cxgb3/iwch_qp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/infiniband/hw/cxgb3/iwch_qp.c b/drivers/infiniband/hw/cxgb3/iwch_qp.c
index 7f633da0185d..3871e1fd8395 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_qp.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_qp.c
@@ -722,10 +722,13 @@ int iwch_post_terminate(struct iwch_qp *qhp, struct respQ_msg_t *rsp_msg)
  */
 static void __flush_qp(struct iwch_qp *qhp, struct iwch_cq *rchp,
 				struct iwch_cq *schp)
+	__releases(&qhp->lock)
+	__acquires(&qhp->lock)
 {
 	int count;
 	int flushed;
 
+	lockdep_assert_held(&qhp->lock);
 
 	pr_debug("%s qhp %p rchp %p schp %p\n", __func__, qhp, rchp, schp);
 	/* take a ref on the qhp since we must release the lock */
-- 
2.14.2

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

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

* [PATCH 10/47] RDMA/cxgb3: Annotate an RCU pointer
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (8 preceding siblings ...)
  2017-10-06 21:32   ` [PATCH 09/47] RDMA/cxgb3: Annotate locking assumptions Bart Van Assche
@ 2017-10-06 21:32   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-11-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:32   ` [PATCH 11/47] RDMA/cxgb3: Remove a set-but-not-used variable Bart Van Assche
                     ` (37 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:32 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Steve Wise

Annotate t3cdev.l2opt with __rcu since it is used as an RCU pointer.

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---
 drivers/net/ethernet/chelsio/cxgb3/t3cdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb3/t3cdev.h b/drivers/net/ethernet/chelsio/cxgb3/t3cdev.h
index 705713b56636..3c3e6cf6aca6 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/t3cdev.h
+++ b/drivers/net/ethernet/chelsio/cxgb3/t3cdev.h
@@ -60,7 +60,7 @@ struct t3cdev {
 	int (*ctl)(struct t3cdev *dev, unsigned int req, void *data);
 	void (*neigh_update)(struct t3cdev *dev, struct neighbour *neigh);
 	void *priv;		/* driver private data */
-	void *l2opt;		/* optional layer 2 data */
+	void __rcu *l2opt;	/* optional layer 2 data */
 	void *l3opt;		/* optional layer 3 data */
 	void *l4opt;		/* optional layer 4 data */
 	void *ulp;		/* ulp stuff */
-- 
2.14.2

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

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

* [PATCH 11/47] RDMA/cxgb3: Remove a set-but-not-used variable
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (9 preceding siblings ...)
  2017-10-06 21:32   ` [PATCH 10/47] RDMA/cxgb3: Annotate an RCU pointer Bart Van Assche
@ 2017-10-06 21:32   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-12-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:32   ` [PATCH 12/47] RDMA/cxgb4: Fix indentation Bart Van Assche
                     ` (36 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:32 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Steve Wise

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---
 drivers/infiniband/hw/cxgb3/iwch_cm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index 86975370a4c0..edc1c549289e 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -1760,8 +1760,8 @@ static void ep_timeout(unsigned long arg)
 
 int iwch_reject_cr(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len)
 {
-	int err;
 	struct iwch_ep *ep = to_ep(cm_id);
+
 	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
 
 	if (state_read(&ep->com) == DEAD) {
@@ -1772,8 +1772,8 @@ int iwch_reject_cr(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len)
 	if (mpa_rev == 0)
 		abort_connection(ep, NULL, GFP_KERNEL);
 	else {
-		err = send_mpa_reject(ep, pdata, pdata_len);
-		err = iwch_ep_disconnect(ep, 0, GFP_KERNEL);
+		send_mpa_reject(ep, pdata, pdata_len);
+		iwch_ep_disconnect(ep, 0, GFP_KERNEL);
 	}
 	put_ep(&ep->com);
 	return 0;
-- 
2.14.2

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

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

* [PATCH 12/47] RDMA/cxgb4: Fix indentation
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (10 preceding siblings ...)
  2017-10-06 21:32   ` [PATCH 11/47] RDMA/cxgb3: Remove a set-but-not-used variable Bart Van Assche
@ 2017-10-06 21:32   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-13-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:32   ` [PATCH 13/47] RDMA/cxgb4: Declare a local variable 'static' Bart Van Assche
                     ` (35 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:32 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Steve Wise

This patch avoids that smatch reports the following:

drivers/infiniband/hw/cxgb4/device.c:1105: copy_gl_to_skb_pkt() warn: inconsistent indenting
drivers/infiniband/hw/cxgb4/cm.c:835: send_connect() warn: inconsistent indenting
drivers/infiniband/hw/cxgb4/cm.c:841: send_connect() warn: inconsistent indenting
drivers/infiniband/hw/cxgb4/cm.c:888: send_connect() warn: inconsistent indenting
drivers/infiniband/hw/cxgb4/cm.c:894: send_connect() warn: inconsistent indenting

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---
 drivers/infiniband/hw/cxgb4/cm.c     | 8 ++++----
 drivers/infiniband/hw/cxgb4/device.c | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index e395afcd7d33..2331e7d57704 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -832,13 +832,13 @@ static int send_connect(struct c4iw_ep *ep)
 				t5req->params =
 					  cpu_to_be64(FILTER_TUPLE_V(params));
 				t5req->rsvd = cpu_to_be32(isn);
-			pr_debug("snd_isn %u\n", t5req->rsvd);
+				pr_debug("snd_isn %u\n", t5req->rsvd);
 				t5req->opt2 = cpu_to_be32(opt2);
 			} else {
 				t6req->params =
 					  cpu_to_be64(FILTER_TUPLE_V(params));
 				t6req->rsvd = cpu_to_be32(isn);
-			pr_debug("snd_isn %u\n", t6req->rsvd);
+				pr_debug("snd_isn %u\n", t6req->rsvd);
 				t6req->opt2 = cpu_to_be32(opt2);
 			}
 		}
@@ -885,13 +885,13 @@ static int send_connect(struct c4iw_ep *ep)
 				t5req6->params =
 					    cpu_to_be64(FILTER_TUPLE_V(params));
 				t5req6->rsvd = cpu_to_be32(isn);
-			pr_debug("snd_isn %u\n", t5req6->rsvd);
+				pr_debug("snd_isn %u\n", t5req6->rsvd);
 				t5req6->opt2 = cpu_to_be32(opt2);
 			} else {
 				t6req6->params =
 					    cpu_to_be64(FILTER_TUPLE_V(params));
 				t6req6->rsvd = cpu_to_be32(isn);
-			pr_debug("snd_isn %u\n", t6req6->rsvd);
+				pr_debug("snd_isn %u\n", t6req6->rsvd);
 				t6req6->opt2 = cpu_to_be32(opt2);
 			}
 
diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
index fa16a4a8c9a4..33bfddf3b064 100644
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@ -1102,8 +1102,8 @@ static inline struct sk_buff *copy_gl_to_skb_pkt(const struct pkt_gl *gl,
 	if (unlikely(!skb))
 		return NULL;
 
-	 __skb_put(skb, gl->tot_len + sizeof(struct cpl_pass_accept_req) +
-		   sizeof(struct rss_header) - pktshift);
+	__skb_put(skb, gl->tot_len + sizeof(struct cpl_pass_accept_req) +
+		  sizeof(struct rss_header) - pktshift);
 
 	/*
 	 * This skb will contain:
-- 
2.14.2

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

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

* [PATCH 13/47] RDMA/cxgb4: Declare a local variable 'static'
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (11 preceding siblings ...)
  2017-10-06 21:32   ` [PATCH 12/47] RDMA/cxgb4: Fix indentation Bart Van Assche
@ 2017-10-06 21:32   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-14-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 14/47] RDMA/cxgb4: Suppress gcc 7 fall-through complaints Bart Van Assche
                     ` (34 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:32 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Steve Wise

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---
 drivers/infiniband/hw/cxgb4/cm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 2331e7d57704..49d9f9b870e5 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -99,7 +99,7 @@ module_param(enable_tcp_window_scaling, int, 0644);
 MODULE_PARM_DESC(enable_tcp_window_scaling,
 		 "Enable tcp window scaling (default=1)");
 
-int c4iw_debug;
+static int c4iw_debug;
 module_param(c4iw_debug, int, 0644);
 MODULE_PARM_DESC(c4iw_debug, "obsolete");
 
-- 
2.14.2

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

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

* [PATCH 14/47] RDMA/cxgb4: Suppress gcc 7 fall-through complaints
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (12 preceding siblings ...)
  2017-10-06 21:32   ` [PATCH 13/47] RDMA/cxgb4: Declare a local variable 'static' Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-15-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 15/47] RDMA/cxgb4: Remove a set-but-not-used variable Bart Van Assche
                     ` (33 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Steve Wise

Avoid that gcc 7 reports the following warning when building with W=1:

warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---
 drivers/infiniband/hw/cxgb4/cm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 49d9f9b870e5..5b5bc7055ddc 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -3642,6 +3642,7 @@ static void active_ofld_conn_reply(struct c4iw_dev *dev, struct sk_buff *skb,
 			send_fw_act_open_req(ep, atid);
 			return;
 		}
+		/* fall through */
 	case FW_EADDRINUSE:
 		set_bit(ACT_RETRY_INUSE, &ep->com.history);
 		if (ep->retry_count++ < ACT_OPEN_RETRY_COUNT) {
-- 
2.14.2

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

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

* [PATCH 15/47] RDMA/cxgb4: Remove a set-but-not-used variable
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (13 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 14/47] RDMA/cxgb4: Suppress gcc 7 fall-through complaints Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-16-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 16/47] IB/hfi1: Suppress gcc 7 fall-through complaints Bart Van Assche
                     ` (32 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Steve Wise

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---
 drivers/infiniband/hw/cxgb4/cm.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 5b5bc7055ddc..04db0aba67b5 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -3881,7 +3881,6 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb)
 	struct net_device *pdev;
 	u16 rss_qid, eth_hdr_len;
 	int step;
-	u32 tx_chan;
 	struct neighbour *neigh;
 
 	/* Drop all non-SYN packets */
@@ -3963,14 +3962,12 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb)
 		e = cxgb4_l2t_get(dev->rdev.lldi.l2t, neigh,
 				    pdev, 0);
 		pi = (struct port_info *)netdev_priv(pdev);
-		tx_chan = cxgb4_port_chan(pdev);
 		dev_put(pdev);
 	} else {
 		pdev = get_real_dev(neigh->dev);
 		e = cxgb4_l2t_get(dev->rdev.lldi.l2t, neigh,
 					pdev, 0);
 		pi = (struct port_info *)netdev_priv(pdev);
-		tx_chan = cxgb4_port_chan(pdev);
 	}
 	neigh_release(neigh);
 	if (!e) {
-- 
2.14.2

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

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

* [PATCH 16/47] IB/hfi1: Suppress gcc 7 fall-through complaints
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (14 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 15/47] RDMA/cxgb4: Remove a set-but-not-used variable Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-17-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 17/47] IB/hfi1: Remove set-but-not-used variables Bart Van Assche
                     ` (31 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Ira Weiny,
	Dennis Dalessandro

Avoid that gcc 7 reports the following warning when building with W=1:

warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/mad.c  | 1 +
 drivers/infiniband/hw/hfi1/rc.c   | 2 +-
 drivers/infiniband/hw/hfi1/sdma.c | 3 ++-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/mad.c b/drivers/infiniband/hw/hfi1/mad.c
index f4c0ffc040cc..f57d893df3e0 100644
--- a/drivers/infiniband/hw/hfi1/mad.c
+++ b/drivers/infiniband/hw/hfi1/mad.c
@@ -711,6 +711,7 @@ static int check_mkey(struct hfi1_ibport *ibp, struct ib_mad_hdr *mad,
 			/* Bad mkey not a violation below level 2 */
 			if (ibp->rvp.mkeyprot < 2)
 				break;
+			/* fall through */
 		case IB_MGMT_METHOD_SET:
 		case IB_MGMT_METHOD_TRAP_REPRESS:
 			if (ibp->rvp.mkey_violations != 0xFFFF)
diff --git a/drivers/infiniband/hw/hfi1/rc.c b/drivers/infiniband/hw/hfi1/rc.c
index e1cf0c08ca6f..8ca26e67a096 100644
--- a/drivers/infiniband/hw/hfi1/rc.c
+++ b/drivers/infiniband/hw/hfi1/rc.c
@@ -2175,7 +2175,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)
 			goto no_immediate_data;
 		if (opcode == OP(SEND_ONLY_WITH_INVALIDATE))
 			goto send_last_inv;
-		/* FALLTHROUGH for SEND_ONLY_WITH_IMMEDIATE */
+		/* FALLTHROUGH -- for SEND_ONLY_WITH_IMMEDIATE */
 	case OP(SEND_LAST_WITH_IMMEDIATE):
 send_last_imm:
 		wc.ex.imm_data = ohdr->u.imm_data;
diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c
index e7df7794c97e..961507bb0391 100644
--- a/drivers/infiniband/hw/hfi1/sdma.c
+++ b/drivers/infiniband/hw/hfi1/sdma.c
@@ -2593,7 +2593,7 @@ static void __sdma_process_event(struct sdma_engine *sde,
 			 * 7220, e.g.
 			 */
 			ss->go_s99_running = 1;
-			/* fall through and start dma engine */
+			/* fall through -- and start dma engine */
 		case sdma_event_e10_go_hw_start:
 			/* This reference means the state machine is started */
 			sdma_get(&sde->state);
@@ -3016,6 +3016,7 @@ static void __sdma_process_event(struct sdma_engine *sde,
 		case sdma_event_e60_hw_halted:
 			need_progress = 1;
 			sdma_err_progress_check_schedule(sde);
+			/* fall through */
 		case sdma_event_e90_sw_halted:
 			/*
 			* SW initiated halt does not perform engines
-- 
2.14.2

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

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

* [PATCH 17/47] IB/hfi1: Remove set-but-not-used variables
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (15 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 16/47] IB/hfi1: Suppress gcc 7 fall-through complaints Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-18-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 18/47] IB/hfi1: Define hfi1_handle_cnp_tbl[] once Bart Van Assche
                     ` (30 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Ira Weiny,
	Dennis Dalessandro

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/file_ops.c |  4 +---
 drivers/infiniband/hw/hfi1/mad.c      |  2 --
 drivers/infiniband/hw/hfi1/ruc.c      |  9 ---------
 drivers/infiniband/hw/hfi1/sdma.c     |  2 --
 drivers/infiniband/hw/hfi1/ud.c       |  2 --
 drivers/infiniband/hw/hfi1/verbs.c    | 10 ----------
 6 files changed, 1 insertion(+), 28 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/file_ops.c b/drivers/infiniband/hw/hfi1/file_ops.c
index 2b7144e0405e..9a829ae95bc2 100644
--- a/drivers/infiniband/hw/hfi1/file_ops.c
+++ b/drivers/infiniband/hw/hfi1/file_ops.c
@@ -776,7 +776,7 @@ static int complete_subctxt(struct hfi1_filedata *fd)
 static int assign_ctxt(struct hfi1_filedata *fd, unsigned long arg, u32 len)
 {
 	int ret;
-	unsigned int swmajor, swminor;
+	unsigned int swmajor;
 	struct hfi1_ctxtdata *uctxt = NULL;
 	struct hfi1_user_info uinfo;
 
@@ -796,8 +796,6 @@ static int assign_ctxt(struct hfi1_filedata *fd, unsigned long arg, u32 len)
 	if (uinfo.subctxt_cnt > HFI1_MAX_SHARED_CTXTS)
 		return -EINVAL;
 
-	swminor = uinfo.userversion & 0xffff;
-
 	/*
 	 * Acquire the mutex to protect against multiple creations of what
 	 * could be a shared base context.
diff --git a/drivers/infiniband/hw/hfi1/mad.c b/drivers/infiniband/hw/hfi1/mad.c
index f57d893df3e0..29da75d89a7c 100644
--- a/drivers/infiniband/hw/hfi1/mad.c
+++ b/drivers/infiniband/hw/hfi1/mad.c
@@ -2889,7 +2889,6 @@ static int pma_get_opa_datacounters(struct opa_pma_mad *pmp,
 	struct _vls_dctrs *vlinfo;
 	size_t response_data_size;
 	u32 num_ports;
-	u8 num_pslm;
 	u8 lq, num_vls;
 	u8 res_lli, res_ler;
 	u64 port_mask;
@@ -2899,7 +2898,6 @@ static int pma_get_opa_datacounters(struct opa_pma_mad *pmp,
 	int vfi;
 
 	num_ports = be32_to_cpu(pmp->mad_hdr.attr_mod) >> 24;
-	num_pslm = hweight64(be64_to_cpu(req->port_select_mask[3]));
 	num_vls = hweight32(be32_to_cpu(req->vl_select_mask));
 	vl_select_mask = be32_to_cpu(req->vl_select_mask);
 	res_lli = (u8)(be32_to_cpu(req->resolution) & MSK_LLI) >> MSK_LLI_SFT;
diff --git a/drivers/infiniband/hw/hfi1/ruc.c b/drivers/infiniband/hw/hfi1/ruc.c
index b3291f0fde9a..d450d4d4bda3 100644
--- a/drivers/infiniband/hw/hfi1/ruc.c
+++ b/drivers/infiniband/hw/hfi1/ruc.c
@@ -825,11 +825,9 @@ static inline void hfi1_make_ruc_header_9B(struct rvt_qp *qp,
 {
 	struct hfi1_qp_priv *priv = qp->priv;
 	struct hfi1_ibport *ibp = ps->ibp;
-	struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
 	u32 bth1 = 0;
 	u16 pkey = hfi1_get_pkey(ibp, qp->s_pkey_index);
 	u16 lrh0 = HFI1_LRH_BTH;
-	u16 slid;
 	u8 extra_bytes = -ps->s_txreq->s_cur_size & 3;
 	u32 nwords = SIZE_OF_CRC + ((ps->s_txreq->s_cur_size +
 					 extra_bytes) >> 2);
@@ -866,13 +864,6 @@ static inline void hfi1_make_ruc_header_9B(struct rvt_qp *qp,
 		bth1 |= (IB_BECN_MASK << IB_BECN_SHIFT);
 	}
 	hfi1_make_ruc_bth(qp, ohdr, bth0, bth1, bth2);
-
-	if (!ppd->lid)
-		slid = be16_to_cpu(IB_LID_PERMISSIVE);
-	else
-		slid = ppd->lid |
-			(rdma_ah_get_path_bits(&qp->remote_ah_attr) &
-			((1 << ppd->lmc) - 1));
 	hfi1_make_ib_hdr(&ps->s_txreq->phdr.hdr.ibh,
 			 lrh0,
 			 qp->s_hdrwords + nwords,
diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c
index 961507bb0391..3ba7f4ea4bc9 100644
--- a/drivers/infiniband/hw/hfi1/sdma.c
+++ b/drivers/infiniband/hw/hfi1/sdma.c
@@ -2144,7 +2144,6 @@ void sdma_dumpstate(struct sdma_engine *sde)
 
 static void dump_sdma_state(struct sdma_engine *sde)
 {
-	struct hw_sdma_desc *descq;
 	struct hw_sdma_desc *descqp;
 	u64 desc[2];
 	u64 addr;
@@ -2155,7 +2154,6 @@ static void dump_sdma_state(struct sdma_engine *sde)
 	head = sde->descq_head & sde->sdma_mask;
 	tail = sde->descq_tail & sde->sdma_mask;
 	cnt = sdma_descq_freecnt(sde);
-	descq = sde->descq;
 
 	dd_dev_err(sde->dd,
 		   "SDMA (%u) descq_head: %u descq_tail: %u freecnt: %u FLE %d\n",
diff --git a/drivers/infiniband/hw/hfi1/ud.c b/drivers/infiniband/hw/hfi1/ud.c
index 2ba74fdd6f15..84c7dbec0c28 100644
--- a/drivers/infiniband/hw/hfi1/ud.c
+++ b/drivers/infiniband/hw/hfi1/ud.c
@@ -854,7 +854,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
 	int mgmt_pkey_idx = -1;
 	struct hfi1_ibport *ibp = rcd_to_iport(packet->rcd);
 	struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
-	struct ib_header *hdr = packet->hdr;
 	void *data = packet->payload;
 	u32 tlen = packet->tlen;
 	struct rvt_qp *qp = packet->qp;
@@ -880,7 +879,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
 		dlid_is_permissive = (dlid == permissive_lid);
 		slid_is_permissive = (slid == permissive_lid);
 	} else {
-		hdr = packet->hdr;
 		pkey = ib_bth_get_pkey(ohdr);
 		dlid_is_permissive = (dlid == be16_to_cpu(IB_LID_PERMISSIVE));
 		slid_is_permissive = (slid == be16_to_cpu(IB_LID_PERMISSIVE));
diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c
index e232f3c608b4..8acdb5dded24 100644
--- a/drivers/infiniband/hw/hfi1/verbs.c
+++ b/drivers/infiniband/hw/hfi1/verbs.c
@@ -812,7 +812,6 @@ static int build_verbs_tx_desc(
 	int ret = 0;
 	struct hfi1_sdma_header *phdr = &tx->phdr;
 	u16 hdrbytes = tx->hdr_dwords << 2;
-	u32 *hdr;
 	u8 extra_bytes = 0;
 	static char trail_buf[12]; /* CRC = 4, LT = 1, Pad = 0 to 7 bytes */
 
@@ -823,9 +822,6 @@ static int build_verbs_tx_desc(
 		 */
 		extra_bytes = hfi1_get_16b_padding(hdrbytes - 8, length) +
 			      (SIZE_OF_CRC << 2) + SIZE_OF_LT;
-		hdr = (u32 *)&phdr->hdr.opah;
-	} else {
-		hdr = (u32 *)&phdr->hdr.ibh;
 	}
 	if (!ahg_info->ahgcount) {
 		ret = sdma_txinit_ahg(
@@ -891,14 +887,12 @@ int hfi1_verbs_send_dma(struct rvt_qp *qp, struct hfi1_pkt_state *ps,
 	u8 sc5 = priv->s_sc;
 	int ret;
 	u32 dwords;
-	bool bypass = false;
 
 	if (ps->s_txreq->phdr.hdr.hdr_type) {
 		u8 extra_bytes = hfi1_get_16b_padding((hdrwords << 2), len);
 
 		dwords = (len + extra_bytes + (SIZE_OF_CRC << 2) +
 			  SIZE_OF_LT) >> 2;
-		bypass = true;
 	} else {
 		dwords = (len + 3) >> 2;
 	}
@@ -1033,8 +1027,6 @@ int hfi1_verbs_send_pio(struct rvt_qp *qp, struct hfi1_pkt_state *ps,
 	int wc_status = IB_WC_SUCCESS;
 	int ret = 0;
 	pio_release_cb cb = NULL;
-	u32 lrh0_16b;
-	bool bypass = false;
 	u8 extra_bytes = 0;
 
 	if (ps->s_txreq->phdr.hdr.hdr_type) {
@@ -1043,8 +1035,6 @@ int hfi1_verbs_send_pio(struct rvt_qp *qp, struct hfi1_pkt_state *ps,
 		extra_bytes = pad_size + (SIZE_OF_CRC << 2) + SIZE_OF_LT;
 		dwords = (len + extra_bytes) >> 2;
 		hdr = (u32 *)&ps->s_txreq->phdr.hdr.opah;
-		lrh0_16b = ps->s_txreq->phdr.hdr.opah.lrh[0];
-		bypass = true;
 	} else {
 		dwords = (len + 3) >> 2;
 		hdr = (u32 *)&ps->s_txreq->phdr.hdr.ibh;
-- 
2.14.2

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

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

* [PATCH 18/47] IB/hfi1: Define hfi1_handle_cnp_tbl[] once
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (16 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 17/47] IB/hfi1: Remove set-but-not-used variables Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-19-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 19/47] IB/hns: Annotate iomem pointers correctly Bart Van Assche
                     ` (29 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Ira Weiny,
	Dennis Dalessandro

This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/driver.c | 6 ++++++
 drivers/infiniband/hw/hfi1/hfi.h    | 5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/driver.c b/drivers/infiniband/hw/hfi1/driver.c
index 85a425ef740e..b4f69c07ca2a 100644
--- a/drivers/infiniband/hw/hfi1/driver.c
+++ b/drivers/infiniband/hw/hfi1/driver.c
@@ -433,6 +433,12 @@ static inline void init_packet(struct hfi1_ctxtdata *rcd,
 	packet->numpkt = 0;
 }
 
+/* We support only two types - 9B and 16B for now */
+static const hfi1_handle_cnp hfi1_handle_cnp_tbl[2] = {
+	[HFI1_PKT_TYPE_9B] = &return_cnp,
+	[HFI1_PKT_TYPE_16B] = &return_cnp_16B
+};
+
 void hfi1_process_ecn_slowpath(struct rvt_qp *qp, struct hfi1_packet *pkt,
 			       bool do_cnp)
 {
diff --git a/drivers/infiniband/hw/hfi1/hfi.h b/drivers/infiniband/hw/hfi1/hfi.h
index cb74ae8b0991..b96a36616c5f 100644
--- a/drivers/infiniband/hw/hfi1/hfi.h
+++ b/drivers/infiniband/hw/hfi1/hfi.h
@@ -1535,11 +1535,6 @@ typedef void (*hfi1_handle_cnp)(struct hfi1_ibport *ibp, struct rvt_qp *qp,
 				u32 remote_qpn, u32 pkey, u32 slid, u32 dlid,
 				u8 sc5, const struct ib_grh *old_grh);
 
-/* We support only two types - 9B and 16B for now */
-static const hfi1_handle_cnp hfi1_handle_cnp_tbl[2] = {
-	[HFI1_PKT_TYPE_9B] = &return_cnp,
-	[HFI1_PKT_TYPE_16B] = &return_cnp_16B
-};
 #define PKEY_CHECK_INVALID -1
 int egress_pkey_check(struct hfi1_pportdata *ppd, u32 slid, u16 pkey,
 		      u8 sc5, int8_t s_pkey_index);
-- 
2.14.2

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

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

* [PATCH 19/47] IB/hns: Annotate iomem pointers correctly
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (17 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 18/47] IB/hfi1: Define hfi1_handle_cnp_tbl[] once Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-20-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 20/47] IB/hns: Declare local functions 'static' Bart Van Assche
                     ` (28 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche,
	Signed-off-by : Lijun Ou, Wei Hu, Shaobo Xu

This patch avoids that sparse complains that there is an address
space mismatch.

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: Wei Hu (Xavier) <xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: Shaobo Xu <xushaobo2-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 drivers/infiniband/hw/hns/hns_roce_eq.c    | 6 +++---
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 9 +++++----
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 3 ++-
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_eq.c b/drivers/infiniband/hw/hns/hns_roce_eq.c
index b0f43735de1a..d184431e2bf5 100644
--- a/drivers/infiniband/hw/hns/hns_roce_eq.c
+++ b/drivers/infiniband/hw/hns/hns_roce_eq.c
@@ -558,7 +558,7 @@ static int hns_roce_create_eq(struct hns_roce_dev *hr_dev,
 	writel(eqshift_val, eqc);
 
 	/* Configure eq extended address 12~44bit */
-	writel((u32)(eq->buf_list[0].map >> 12), (u8 *)eqc + 4);
+	writel((u32)(eq->buf_list[0].map >> 12), eqc + 4);
 
 	/*
 	 * Configure eq extended address 45~49 bit.
@@ -572,13 +572,13 @@ static int hns_roce_create_eq(struct hns_roce_dev *hr_dev,
 	roce_set_field(eqcuridx_val,
 		       ROCEE_CAEP_AEQE_CUR_IDX_CAEP_AEQE_CUR_IDX_M,
 		       ROCEE_CAEP_AEQE_CUR_IDX_CAEP_AEQE_CUR_IDX_S, 0);
-	writel(eqcuridx_val, (u8 *)eqc + 8);
+	writel(eqcuridx_val, eqc + 8);
 
 	/* Configure eq consumer index */
 	roce_set_field(eqconsindx_val,
 		       ROCEE_CAEP_AEQE_CONS_IDX_CAEP_AEQE_CONS_IDX_M,
 		       ROCEE_CAEP_AEQE_CONS_IDX_CAEP_AEQE_CONS_IDX_S, 0);
-	writel(eqconsindx_val, (u8 *)eqc + 0xc);
+	writel(eqconsindx_val, eqc + 0xc);
 
 	return 0;
 
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index 852db18ec128..187241484fa1 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -1639,7 +1639,7 @@ static int hns_roce_v1_post_mbox(struct hns_roce_dev *hr_dev, u64 in_param,
 				 u64 out_param, u32 in_modifier, u8 op_modifier,
 				 u16 op, u16 token, int event)
 {
-	u32 *hcr = (u32 *)(hr_dev->reg_base + ROCEE_MB1_REG);
+	u32 __iomem *hcr = (u32 __iomem *)(hr_dev->reg_base + ROCEE_MB1_REG);
 	unsigned long end;
 	u32 val = 0;
 
@@ -2534,7 +2534,7 @@ static int hns_roce_v1_m_sqp(struct ib_qp *ibqp, const struct ib_qp_attr *attr,
 	int rq_pa_start;
 	u32 reg_val;
 	u64 *mtts;
-	u32 *addr;
+	u32 __iomem *addr;
 
 	context = kzalloc(sizeof(*context), GFP_KERNEL);
 	if (!context)
@@ -2616,8 +2616,9 @@ static int hns_roce_v1_m_sqp(struct ib_qp *ibqp, const struct ib_qp_attr *attr,
 			       QP1C_BYTES_40_SQ_CUR_IDX_S, 0);
 
 		/* Copy context to QP1C register */
-		addr = (u32 *)(hr_dev->reg_base + ROCEE_QP1C_CFG0_0_REG +
-			hr_qp->phy_port * sizeof(*context));
+		addr = (u32 __iomem *)(hr_dev->reg_base +
+				       ROCEE_QP1C_CFG0_0_REG +
+				       hr_qp->phy_port * sizeof(*context));
 
 		writel(context->qp1c_bytes_4, addr);
 		writel(context->sq_rq_bt_l, addr + 1);
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 8378ee118ba6..7a9920468cc6 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -976,7 +976,8 @@ static int hns_roce_v2_post_mbox(struct hns_roce_dev *hr_dev, u64 in_param,
 				 u16 op, u16 token, int event)
 {
 	struct device *dev = hr_dev->dev;
-	u32 *hcr = (u32 *)(hr_dev->reg_base + ROCEE_VF_MB_CFG0_REG);
+	u32 __iomem *hcr = (u32 __iomem *)(hr_dev->reg_base +
+					   ROCEE_VF_MB_CFG0_REG);
 	unsigned long end;
 	u32 val0 = 0;
 	u32 val1 = 0;
-- 
2.14.2

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

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

* [PATCH 20/47] IB/hns: Declare local functions 'static'
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (18 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 19/47] IB/hns: Annotate iomem pointers correctly Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-21-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 21/47] RDMA/i40iw: Fix a race condition Bart Van Assche
                     ` (27 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche,
	Signed-off-by : Lijun Ou, Wei Hu, Shaobo Xu

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: Wei Hu (Xavier) <xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: Shaobo Xu <xushaobo2-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 64 ++++++++++++++++--------------
 1 file changed, 35 insertions(+), 29 deletions(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index 187241484fa1..658e3a7464b3 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -57,8 +57,8 @@ static void set_raddr_seg(struct hns_roce_wqe_raddr_seg *rseg, u64 remote_addr,
 	rseg->len   = 0;
 }
 
-int hns_roce_v1_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
-			  struct ib_send_wr **bad_wr)
+static int hns_roce_v1_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
+				 struct ib_send_wr **bad_wr)
 {
 	struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device);
 	struct hns_roce_ah *ah = to_hr_ah(ud_wr(wr)->ah);
@@ -317,8 +317,8 @@ int hns_roce_v1_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
 	return ret;
 }
 
-int hns_roce_v1_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr,
-			  struct ib_recv_wr **bad_wr)
+static int hns_roce_v1_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr,
+				 struct ib_recv_wr **bad_wr)
 {
 	int ret = 0;
 	int nreq = 0;
@@ -877,7 +877,7 @@ static int hns_roce_db_init(struct hns_roce_dev *hr_dev)
 	return 0;
 }
 
-void hns_roce_v1_recreate_lp_qp_work_fn(struct work_struct *work)
+static void hns_roce_v1_recreate_lp_qp_work_fn(struct work_struct *work)
 {
 	struct hns_roce_recreate_lp_qp_work *lp_qp_work;
 	struct hns_roce_dev *hr_dev;
@@ -1033,7 +1033,8 @@ static void hns_roce_v1_mr_free_work_fn(struct work_struct *work)
 	kfree(mr_work);
 }
 
-int hns_roce_v1_dereg_mr(struct hns_roce_dev *hr_dev, struct hns_roce_mr *mr)
+static int hns_roce_v1_dereg_mr(struct hns_roce_dev *hr_dev,
+				struct hns_roce_mr *mr)
 {
 	struct device *dev = &hr_dev->pdev->dev;
 	struct hns_roce_mr_free_work *mr_work;
@@ -1391,7 +1392,7 @@ static void hns_roce_free_mr_free(struct hns_roce_dev *hr_dev)
  * @enable: true -- drop reset, false -- reset
  * return 0 - success , negative --fail
  */
-int hns_roce_v1_reset(struct hns_roce_dev *hr_dev, bool dereset)
+static int hns_roce_v1_reset(struct hns_roce_dev *hr_dev, bool dereset)
 {
 	struct device_node *dsaf_node;
 	struct device *dev = &hr_dev->pdev->dev;
@@ -1466,7 +1467,7 @@ static void hns_roce_des_qp_free(struct hns_roce_dev *hr_dev)
 	destroy_workqueue(des_qp->qp_wq);
 }
 
-int hns_roce_v1_profile(struct hns_roce_dev *hr_dev)
+static int hns_roce_v1_profile(struct hns_roce_dev *hr_dev)
 {
 	int i = 0;
 	struct hns_roce_caps *caps = &hr_dev->caps;
@@ -1538,7 +1539,7 @@ int hns_roce_v1_profile(struct hns_roce_dev *hr_dev)
 	return 0;
 }
 
-int hns_roce_v1_init(struct hns_roce_dev *hr_dev)
+static int hns_roce_v1_init(struct hns_roce_dev *hr_dev)
 {
 	int ret;
 	u32 val;
@@ -1617,7 +1618,7 @@ int hns_roce_v1_init(struct hns_roce_dev *hr_dev)
 	return ret;
 }
 
-void hns_roce_v1_exit(struct hns_roce_dev *hr_dev)
+static void hns_roce_v1_exit(struct hns_roce_dev *hr_dev)
 {
 	hns_roce_port_enable(hr_dev, HNS_ROCE_PORT_DOWN);
 	hns_roce_free_mr_free(hr_dev);
@@ -1701,8 +1702,8 @@ static int hns_roce_v1_chk_mbox(struct hns_roce_dev *hr_dev,
 	return 0;
 }
 
-void hns_roce_v1_set_gid(struct hns_roce_dev *hr_dev, u8 port, int gid_index,
-			 union ib_gid *gid)
+static void hns_roce_v1_set_gid(struct hns_roce_dev *hr_dev, u8 port,
+				int gid_index, union ib_gid *gid)
 {
 	u32 *p = NULL;
 	u8 gid_idx = 0;
@@ -1765,8 +1766,8 @@ static int hns_roce_v1_set_mac(struct hns_roce_dev *hr_dev, u8 phy_port,
 	return 0;
 }
 
-void hns_roce_v1_set_mtu(struct hns_roce_dev *hr_dev, u8 phy_port,
-			 enum ib_mtu mtu)
+static void hns_roce_v1_set_mtu(struct hns_roce_dev *hr_dev, u8 phy_port,
+				enum ib_mtu mtu)
 {
 	u32 val;
 
@@ -1778,8 +1779,8 @@ void hns_roce_v1_set_mtu(struct hns_roce_dev *hr_dev, u8 phy_port,
 		   val);
 }
 
-int hns_roce_v1_write_mtpt(void *mb_buf, struct hns_roce_mr *mr,
-			   unsigned long mtpt_idx)
+static int hns_roce_v1_write_mtpt(void *mb_buf, struct hns_roce_mr *mr,
+				  unsigned long mtpt_idx)
 {
 	struct hns_roce_v1_mpt_entry *mpt_entry;
 	struct scatterlist *sg;
@@ -1951,7 +1952,7 @@ static struct hns_roce_cqe *next_cqe_sw(struct hns_roce_cq *hr_cq)
 	return get_sw_cqe(hr_cq, hr_cq->cons_index);
 }
 
-void hns_roce_v1_cq_set_ci(struct hns_roce_cq *hr_cq, u32 cons_index)
+static void hns_roce_v1_cq_set_ci(struct hns_roce_cq *hr_cq, u32 cons_index)
 {
 	u32 doorbell[2];
 
@@ -2024,9 +2025,10 @@ static void hns_roce_v1_cq_clean(struct hns_roce_cq *hr_cq, u32 qpn,
 	spin_unlock_irq(&hr_cq->lock);
 }
 
-void hns_roce_v1_write_cqc(struct hns_roce_dev *hr_dev,
-			   struct hns_roce_cq *hr_cq, void *mb_buf, u64 *mtts,
-			   dma_addr_t dma_handle, int nent, u32 vector)
+static void hns_roce_v1_write_cqc(struct hns_roce_dev *hr_dev,
+				  struct hns_roce_cq *hr_cq, void *mb_buf,
+				  u64 *mtts, dma_addr_t dma_handle, int nent,
+				  u32 vector)
 {
 	struct hns_roce_cq_context *cq_context = NULL;
 	struct hns_roce_buf_list *tptr_buf;
@@ -2111,7 +2113,8 @@ void hns_roce_v1_write_cqc(struct hns_roce_dev *hr_dev,
 	cq_context->cqc_byte_32 = cpu_to_le32(cq_context->cqc_byte_32);
 }
 
-int hns_roce_v1_req_notify_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
+static int hns_roce_v1_req_notify_cq(struct ib_cq *ibcq,
+				     enum ib_cq_notify_flags flags)
 {
 	struct hns_roce_cq *hr_cq = to_hr_cq(ibcq);
 	u32 notification_flag;
@@ -2372,8 +2375,9 @@ int hns_roce_v1_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc)
 		return ret;
 }
 
-int hns_roce_v1_clear_hem(struct hns_roce_dev *hr_dev,
-		struct hns_roce_hem_table *table, int obj, int step_idx)
+static int hns_roce_v1_clear_hem(struct hns_roce_dev *hr_dev,
+				 struct hns_roce_hem_table *table, int obj,
+				 int step_idx)
 {
 	struct device *dev = &hr_dev->pdev->dev;
 	struct hns_roce_v1_priv *priv;
@@ -3272,9 +3276,10 @@ static int hns_roce_v1_m_qp(struct ib_qp *ibqp, const struct ib_qp_attr *attr,
 	return ret;
 }
 
-int hns_roce_v1_modify_qp(struct ib_qp *ibqp, const struct ib_qp_attr *attr,
-			  int attr_mask, enum ib_qp_state cur_state,
-			  enum ib_qp_state new_state)
+static int hns_roce_v1_modify_qp(struct ib_qp *ibqp,
+				 const struct ib_qp_attr *attr, int attr_mask,
+				 enum ib_qp_state cur_state,
+				 enum ib_qp_state new_state)
 {
 
 	if (ibqp->qp_type == IB_QPT_GSI || ibqp->qp_type == IB_QPT_SMI)
@@ -3541,8 +3546,9 @@ static int hns_roce_v1_q_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
 	return ret;
 }
 
-int hns_roce_v1_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
-			 int qp_attr_mask, struct ib_qp_init_attr *qp_init_attr)
+static int hns_roce_v1_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
+				int qp_attr_mask,
+				struct ib_qp_init_attr *qp_init_attr)
 {
 	struct hns_roce_qp *hr_qp = to_hr_qp(ibqp);
 
@@ -3893,7 +3899,7 @@ int hns_roce_v1_destroy_qp(struct ib_qp *ibqp)
 	return 0;
 }
 
-int hns_roce_v1_destroy_cq(struct ib_cq *ibcq)
+static int hns_roce_v1_destroy_cq(struct ib_cq *ibcq)
 {
 	struct hns_roce_dev *hr_dev = to_hr_dev(ibcq->device);
 	struct hns_roce_cq *hr_cq = to_hr_cq(ibcq);
-- 
2.14.2

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

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

* [PATCH 21/47] RDMA/i40iw: Fix a race condition
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (19 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 20/47] IB/hns: Declare local functions 'static' Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-22-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 22/47] RDMA/i40iw: Suppress gcc 7 fall-through complaints Bart Van Assche
                     ` (26 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Shiraz Saleem

Use the proper primitives to dereference the RCU pointer
upper_dev->ip_ptr. Compile-tested only.

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Shiraz Saleem <shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/i40iw/i40iw_utils.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/i40iw/i40iw_utils.c b/drivers/infiniband/hw/i40iw/i40iw_utils.c
index e52dbbb4165e..7304189b62ef 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_utils.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_utils.c
@@ -168,11 +168,16 @@ int i40iw_inetaddr_event(struct notifier_block *notifier,
 	if (netdev != event_netdev)
 		return NOTIFY_DONE;
 
-	if (upper_dev)
-		local_ipaddr = ntohl(
-			((struct in_device *)upper_dev->ip_ptr)->ifa_list->ifa_address);
-	else
+	if (upper_dev) {
+		struct in_device *in;
+
+		rcu_read_lock();
+		in = __in_dev_get_rcu(upper_dev);
+		local_ipaddr = ntohl(in->ifa_list->ifa_address);
+		rcu_read_unlock();
+	} else {
 		local_ipaddr = ntohl(ifa->ifa_address);
+	}
 	switch (event) {
 	case NETDEV_DOWN:
 		action = I40IW_ARP_DELETE;
-- 
2.14.2

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

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

* [PATCH 22/47] RDMA/i40iw: Suppress gcc 7 fall-through complaints
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (20 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 21/47] RDMA/i40iw: Fix a race condition Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-23-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 23/47] RDMA/i40iw: Remove a set-but-not-used variable Bart Van Assche
                     ` (25 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Shiraz Saleem

Avoid that gcc 7 reports the following warning when building with W=1:

warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Shiraz Saleem <shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/i40iw/i40iw_cm.c   | 1 +
 drivers/infiniband/hw/i40iw/i40iw_hw.c   | 1 +
 drivers/infiniband/hw/i40iw/i40iw_puda.c | 1 +
 3 files changed, 3 insertions(+)

diff --git a/drivers/infiniband/hw/i40iw/i40iw_cm.c b/drivers/infiniband/hw/i40iw/i40iw_cm.c
index 9017c1cc51d4..617030679a48 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_cm.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_cm.c
@@ -2406,6 +2406,7 @@ static void i40iw_handle_rst_pkt(struct i40iw_cm_node *cm_node,
 	case I40IW_CM_STATE_FIN_WAIT1:
 	case I40IW_CM_STATE_LAST_ACK:
 		cm_node->cm_id->rem_ref(cm_node->cm_id);
+		/* fall through */
 	case I40IW_CM_STATE_TIME_WAIT:
 		cm_node->state = I40IW_CM_STATE_CLOSED;
 		i40iw_rem_ref_cm_node(cm_node);
diff --git a/drivers/infiniband/hw/i40iw/i40iw_hw.c b/drivers/infiniband/hw/i40iw/i40iw_hw.c
index 476867a3f584..7e9de845a350 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_hw.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_hw.c
@@ -410,6 +410,7 @@ void i40iw_process_aeq(struct i40iw_device *iwdev)
 		case I40IW_AE_UDA_XMIT_DGRAM_TOO_LONG:
 		case I40IW_AE_UDA_XMIT_IPADDR_MISMATCH:
 			ctx_info->err_rq_idx_valid = false;
+			/* fall through */
 		default:
 			if (!info->sq && ctx_info->err_rq_idx_valid) {
 				ctx_info->err_rq_idx = info->wqe_idx;
diff --git a/drivers/infiniband/hw/i40iw/i40iw_puda.c b/drivers/infiniband/hw/i40iw/i40iw_puda.c
index c2cab20c4bc5..2a3bf6488b4b 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_puda.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_puda.c
@@ -816,6 +816,7 @@ void i40iw_puda_dele_resources(struct i40iw_sc_vsi *vsi,
 	switch (rsrc->completion) {
 	case PUDA_HASH_CRC_COMPLETE:
 		i40iw_free_hash_desc(rsrc->hash_desc);
+		/* fall through */
 	case PUDA_QP_CREATED:
 		if (!reset)
 			i40iw_puda_free_qp(rsrc);
-- 
2.14.2

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

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

* [PATCH 23/47] RDMA/i40iw: Remove a set-but-not-used variable
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (21 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 22/47] RDMA/i40iw: Suppress gcc 7 fall-through complaints Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-24-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 24/47] IB/mthca: Fix indentation Bart Van Assche
                     ` (24 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Shiraz Saleem

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Shiraz Saleem <shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/i40iw/i40iw_cm.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/infiniband/hw/i40iw/i40iw_cm.c b/drivers/infiniband/hw/i40iw/i40iw_cm.c
index 617030679a48..c5be38468083 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_cm.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_cm.c
@@ -1199,7 +1199,6 @@ static void i40iw_cm_timer_tick(unsigned long pass)
 	struct i40iw_cm_core *cm_core = (struct i40iw_cm_core *)pass;
 	u32 settimer = 0;
 	unsigned long timetosend;
-	struct i40iw_sc_dev *dev;
 	unsigned long flags;
 
 	struct list_head timer_list;
@@ -1271,7 +1270,6 @@ static void i40iw_cm_timer_tick(unsigned long pass)
 		spin_unlock_irqrestore(&cm_node->retrans_list_lock, flags);
 
 		vsi = &cm_node->iwdev->vsi;
-		dev = cm_node->dev;
 		atomic_inc(&send_entry->sqbuf->refcount);
 		i40iw_puda_send_buf(vsi->ilq, send_entry->sqbuf);
 		spin_lock_irqsave(&cm_node->retrans_list_lock, flags);
-- 
2.14.2

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

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

* [PATCH 24/47] IB/mthca: Fix indentation
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (22 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 23/47] RDMA/i40iw: Remove a set-but-not-used variable Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
  2017-10-06 21:33   ` [PATCH 25/47] IB/mlx4: Suppress gcc 7 fall-through complaints Bart Van Assche
                     ` (23 subsequent siblings)
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Leon Romanovsky

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/mthca/mthca_main.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c
index e36a9bc52268..f3e80dec1334 100644
--- a/drivers/infiniband/hw/mthca/mthca_main.c
+++ b/drivers/infiniband/hw/mthca/mthca_main.c
@@ -473,11 +473,11 @@ static int mthca_init_icm(struct mthca_dev *mdev,
 		goto err_unmap_eqp;
 	}
 
-       mdev->cq_table.table = mthca_alloc_icm_table(mdev, init_hca->cqc_base,
-						    dev_lim->cqc_entry_sz,
-						    mdev->limits.num_cqs,
-						    mdev->limits.reserved_cqs,
-						    0, 0);
+	mdev->cq_table.table = mthca_alloc_icm_table(mdev, init_hca->cqc_base,
+						     dev_lim->cqc_entry_sz,
+						     mdev->limits.num_cqs,
+						     mdev->limits.reserved_cqs,
+						     0, 0);
 	if (!mdev->cq_table.table) {
 		mthca_err(mdev, "Failed to map CQ context memory, aborting.\n");
 		err = -ENOMEM;
-- 
2.14.2

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

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

* [PATCH 25/47] IB/mlx4: Suppress gcc 7 fall-through complaints
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (23 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 24/47] IB/mthca: Fix indentation Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-26-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 26/47] IB/mlx5: " Bart Van Assche
                     ` (22 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Leon Romanovsky

Avoid that gcc 7 reports the following warning when building with W=1:

warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/mlx4/cq.c  | 2 ++
 drivers/infiniband/hw/mlx4/mcg.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index cab796341697..6d5f405912dd 100644
--- a/drivers/infiniband/hw/mlx4/cq.c
+++ b/drivers/infiniband/hw/mlx4/cq.c
@@ -768,11 +768,13 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq,
 		switch (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) {
 		case MLX4_OPCODE_RDMA_WRITE_IMM:
 			wc->wc_flags |= IB_WC_WITH_IMM;
+			/* fall through */
 		case MLX4_OPCODE_RDMA_WRITE:
 			wc->opcode    = IB_WC_RDMA_WRITE;
 			break;
 		case MLX4_OPCODE_SEND_IMM:
 			wc->wc_flags |= IB_WC_WITH_IMM;
+			/* fall through */
 		case MLX4_OPCODE_SEND:
 		case MLX4_OPCODE_SEND_INVAL:
 			wc->opcode    = IB_WC_SEND;
diff --git a/drivers/infiniband/hw/mlx4/mcg.c b/drivers/infiniband/hw/mlx4/mcg.c
index 70eb9f917303..81ffc007e0a1 100644
--- a/drivers/infiniband/hw/mlx4/mcg.c
+++ b/drivers/infiniband/hw/mlx4/mcg.c
@@ -944,6 +944,7 @@ int mlx4_ib_mcg_multiplex_handler(struct ib_device *ibdev, int port,
 	switch (sa_mad->mad_hdr.method) {
 	case IB_MGMT_METHOD_SET:
 		may_create = 1;
+		/* fall through */
 	case IB_SA_METHOD_DELETE:
 		req = kzalloc(sizeof *req, GFP_KERNEL);
 		if (!req)
-- 
2.14.2

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

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

* [PATCH 26/47] IB/mlx5: Suppress gcc 7 fall-through complaints
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (24 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 25/47] IB/mlx4: Suppress gcc 7 fall-through complaints Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-27-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 27/47] IB/mlx5: Remove a set-but-not-used variable Bart Van Assche
                     ` (21 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Leon Romanovsky

Avoid that gcc 7 reports the following warning when building with W=1:

warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/mlx5/cq.c | 2 ++
 drivers/infiniband/hw/mlx5/qp.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
index 2aa53f427685..b8a116d0e063 100644
--- a/drivers/infiniband/hw/mlx5/cq.c
+++ b/drivers/infiniband/hw/mlx5/cq.c
@@ -124,11 +124,13 @@ static void handle_good_req(struct ib_wc *wc, struct mlx5_cqe64 *cqe,
 	switch (be32_to_cpu(cqe->sop_drop_qpn) >> 24) {
 	case MLX5_OPCODE_RDMA_WRITE_IMM:
 		wc->wc_flags |= IB_WC_WITH_IMM;
+		/* fall through */
 	case MLX5_OPCODE_RDMA_WRITE:
 		wc->opcode    = IB_WC_RDMA_WRITE;
 		break;
 	case MLX5_OPCODE_SEND_IMM:
 		wc->wc_flags |= IB_WC_WITH_IMM;
+		/* fall through */
 	case MLX5_OPCODE_SEND:
 	case MLX5_OPCODE_SEND_INVAL:
 		wc->opcode    = IB_WC_SEND;
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index acb79d3a4f1d..b0b09febafda 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -4053,6 +4053,7 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
 				*bad_wr = wr;
 				goto out;
 			}
+			/* fall through */
 		case MLX5_IB_QPT_HW_GSI:
 			set_datagram_seg(seg, wr);
 			seg += sizeof(struct mlx5_wqe_datagram_seg);
-- 
2.14.2

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

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

* [PATCH 27/47] IB/mlx5: Remove a set-but-not-used variable
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (25 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 26/47] IB/mlx5: " Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-28-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 28/47] IB/nes: Fix indentation Bart Van Assche
                     ` (20 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Leon Romanovsky

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/mlx5/qp.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index b0b09febafda..37a0976240fd 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -3858,7 +3858,6 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
 	unsigned long flags;
 	unsigned idx;
 	int err = 0;
-	int inl = 0;
 	int num_sge;
 	void *seg;
 	int nreq;
@@ -4117,7 +4116,6 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
 				*bad_wr = wr;
 				goto out;
 			}
-			inl = 1;
 			size += sz;
 		} else {
 			dpseg = seg;
-- 
2.14.2

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

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

* [PATCH 28/47] IB/nes: Fix indentation
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (26 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 27/47] IB/mlx5: Remove a set-but-not-used variable Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
  2017-10-06 21:33   ` [PATCH 29/47] IB/nes: Suppress gcc 7 fall-through complaints Bart Van Assche
                     ` (19 subsequent siblings)
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Faisal Latif

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Faisal Latif <faisal.latif-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/nes/nes.c       | 22 +++++++++++-----------
 drivers/infiniband/hw/nes/nes_hw.c    |  4 ++--
 drivers/infiniband/hw/nes/nes_nic.c   | 10 +++++-----
 drivers/infiniband/hw/nes/nes_utils.c |  8 ++++----
 drivers/infiniband/hw/nes/nes_verbs.c | 12 ++++++------
 5 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c
index 942ca84713c9..ff58dfa071b8 100644
--- a/drivers/infiniband/hw/nes/nes.c
+++ b/drivers/infiniband/hw/nes/nes.c
@@ -757,18 +757,18 @@ static void nes_remove(struct pci_dev *pcidev)
 	int netdev_index = 0;
 	unsigned long flags;
 
-		if (nesdev->netdev_count) {
-			netdev = nesdev->netdev[netdev_index];
-			if (netdev) {
-				netif_stop_queue(netdev);
-				unregister_netdev(netdev);
-				nes_netdev_destroy(netdev);
-
-				nesdev->netdev[netdev_index] = NULL;
-				nesdev->netdev_count--;
-				nesdev->nesadapter->netdev_count--;
-			}
+	if (nesdev->netdev_count) {
+		netdev = nesdev->netdev[netdev_index];
+		if (netdev) {
+			netif_stop_queue(netdev);
+			unregister_netdev(netdev);
+			nes_netdev_destroy(netdev);
+
+			nesdev->netdev[netdev_index] = NULL;
+			nesdev->netdev_count--;
+			nesdev->nesadapter->netdev_count--;
 		}
+	}
 
 	nes_notifiers_registered--;
 	if (nes_notifiers_registered == 0) {
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index b0adf65e4bdb..775c246644cd 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -1861,8 +1861,8 @@ int nes_init_nic_qp(struct nes_device *nesdev, struct net_device *netdev)
 	}
 	if ((nesdev->nesadapter->allow_unaligned_fpdus) &&
 		(nes_init_mgt_qp(nesdev, netdev, nesvnic))) {
-			nes_debug(NES_DBG_INIT, "%s: Out of memory for pau nic\n", netdev->name);
-			nes_destroy_nic_qp(nesvnic);
+		nes_debug(NES_DBG_INIT, "%s: Out of memory for pau nic\n", netdev->name);
+		nes_destroy_nic_qp(nesvnic);
 		return -ENOMEM;
 	}
 
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index 5921ea3d50ae..e8872aa78691 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -926,11 +926,11 @@ static void nes_netdev_set_multicast_list(struct net_device *netdev)
 				nesadapter->pft_mcast_map[mc_index] !=
 					nesvnic->nic_index &&
 					mc_index < max_pft_entries_avaiable) {
-						nes_debug(NES_DBG_NIC_RX,
-					"mc_index=%d skipping nic_index=%d, "
-					"used for=%d \n", mc_index,
-					nesvnic->nic_index,
-					nesadapter->pft_mcast_map[mc_index]);
+				nes_debug(NES_DBG_NIC_RX,
+					  "mc_index=%d skipping nic_index=%d, "
+					  "used for=%d \n", mc_index,
+					  nesvnic->nic_index,
+					  nesadapter->pft_mcast_map[mc_index]);
 				mc_index++;
 			}
 			if (mc_index >= max_pft_entries_avaiable)
diff --git a/drivers/infiniband/hw/nes/nes_utils.c b/drivers/infiniband/hw/nes/nes_utils.c
index 37331e2fdc5f..7b67e9cb57ed 100644
--- a/drivers/infiniband/hw/nes/nes_utils.c
+++ b/drivers/infiniband/hw/nes/nes_utils.c
@@ -888,10 +888,10 @@ void nes_clc(unsigned long parm)
 	struct nes_adapter *nesadapter = nesdev->nesadapter;
 
 	spin_lock_irqsave(&nesadapter->phy_lock, flags);
-    nesadapter->link_interrupt_count[0] = 0;
-    nesadapter->link_interrupt_count[1] = 0;
-    nesadapter->link_interrupt_count[2] = 0;
-    nesadapter->link_interrupt_count[3] = 0;
+	nesadapter->link_interrupt_count[0] = 0;
+	nesadapter->link_interrupt_count[1] = 0;
+	nesadapter->link_interrupt_count[2] = 0;
+	nesadapter->link_interrupt_count[3] = 0;
 	spin_unlock_irqrestore(&nesadapter->phy_lock, flags);
 
 	nesadapter->lc_timer.expires = jiffies + 3600 * HZ;  /* 1 hour */
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index f0dc5f4aa177..6abe90b58c91 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -2865,11 +2865,11 @@ int nes_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 
 				next_iwarp_state = NES_CQP_QP_IWARP_STATE_ERROR;
 				/* next_iwarp_state = (NES_CQP_QP_IWARP_STATE_TERMINATE | 0x02000000); */
-					if (nesqp->hte_added) {
-						nes_debug(NES_DBG_MOD_QP, "set CQP_QP_DEL_HTE\n");
-						next_iwarp_state |= NES_CQP_QP_DEL_HTE;
-						nesqp->hte_added = 0;
-					}
+				if (nesqp->hte_added) {
+					nes_debug(NES_DBG_MOD_QP, "set CQP_QP_DEL_HTE\n");
+					next_iwarp_state |= NES_CQP_QP_DEL_HTE;
+					nesqp->hte_added = 0;
+				}
 				if ((nesqp->hw_tcp_state > NES_AEQE_TCP_STATE_CLOSED) &&
 						(nesdev->iw_status) &&
 						(nesqp->hw_tcp_state != NES_AEQE_TCP_STATE_TIME_WAIT)) {
@@ -3560,7 +3560,7 @@ static int nes_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *entry)
 				entry->byte_len = le32_to_cpu(cqe.cqe_words[NES_CQE_PAYLOAD_LENGTH_IDX]);
 				wrid = ((u64)(le32_to_cpu(nesqp->hwqp.rq_vbase[wqe_index].wqe_words[NES_IWARP_RQ_WQE_COMP_SCRATCH_LOW_IDX]))) |
 					((u64)(le32_to_cpu(nesqp->hwqp.rq_vbase[wqe_index].wqe_words[NES_IWARP_RQ_WQE_COMP_SCRATCH_HIGH_IDX]))<<32);
-					entry->opcode = IB_WC_RECV;
+				entry->opcode = IB_WC_RECV;
 
 				nesqp->hwqp.rq_tail = (wqe_index+1)&(nesqp->hwqp.rq_size - 1);
 				if ((entry->status != IB_WC_SUCCESS) && (nesqp->hwqp.rq_tail != nesqp->hwqp.rq_head)) {
-- 
2.14.2

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

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

* [PATCH 29/47] IB/nes: Suppress gcc 7 fall-through complaints
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (27 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 28/47] IB/nes: Fix indentation Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
  2017-10-06 21:33   ` [PATCH 30/47] IB/nes: Remove set-but-not-used variables Bart Van Assche
                     ` (18 subsequent siblings)
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Faisal Latif

Avoid that gcc 7 reports the following warning when building with W=1:

warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Faisal Latif <faisal.latif-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/nes/nes_cm.c | 1 +
 drivers/infiniband/hw/nes/nes_hw.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index de4025deaa4a..a5f6dffef07a 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -1768,6 +1768,7 @@ static void handle_rst_pkt(struct nes_cm_node *cm_node, struct sk_buff *skb,
 	case NES_CM_STATE_FIN_WAIT1:
 	case NES_CM_STATE_LAST_ACK:
 		cm_node->cm_id->rem_ref(cm_node->cm_id);
+		/* fall through */
 	case NES_CM_STATE_TIME_WAIT:
 		cm_node->state = NES_CM_STATE_CLOSED;
 		rem_ref_cm_node(cm_node->cm_core, cm_node);
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index 775c246644cd..abee39eaa108 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -3631,7 +3631,7 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev,
 				aeq_info |= NES_AEQE_AEID_RDMAP_ROE_UNEXPECTED_OPCODE;
 				aeqe->aeqe_words[NES_AEQE_MISC_IDX] = cpu_to_le32(aeq_info);
 			}
-
+			/* fall through */
 		case NES_AEQE_AEID_RDMAP_ROE_BAD_LLP_CLOSE:
 		case NES_AEQE_AEID_LLP_TOO_MANY_RETRIES:
 		case NES_AEQE_AEID_DDP_UBE_INVALID_MSN_NO_BUFFER_AVAILABLE:
-- 
2.14.2

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

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

* [PATCH 30/47] IB/nes: Remove set-but-not-used variables
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (28 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 29/47] IB/nes: Suppress gcc 7 fall-through complaints Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
  2017-10-06 21:33   ` [PATCH 31/47] IB/nes: Fix a race condition in nes_inetaddr_event() Bart Van Assche
                     ` (17 subsequent siblings)
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Faisal Latif

This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Faisal Latif <faisal.latif-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/nes/nes_cm.c    | 8 --------
 drivers/infiniband/hw/nes/nes_utils.c | 5 ++---
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index a5f6dffef07a..bfe2156813b1 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -1389,7 +1389,6 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
 	struct rtable *rt;
 	struct neighbour *neigh;
 	int rc = arpindex;
-	struct net_device *netdev;
 	struct nes_adapter *nesadapter = nesvnic->nesdev->nesadapter;
 	__be32 dst_ipaddr = htonl(dst_ip);
 
@@ -1400,11 +1399,6 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
 		return rc;
 	}
 
-	if (netif_is_bond_slave(nesvnic->netdev))
-		netdev = netdev_master_upper_dev_get(nesvnic->netdev);
-	else
-		netdev = nesvnic->netdev;
-
 	neigh = dst_neigh_lookup(&rt->dst, &dst_ipaddr);
 
 	rcu_read_lock();
@@ -3075,7 +3069,6 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
 	u32 crc_value;
 	int ret;
 	int passive_state;
-	struct nes_ib_device *nesibdev;
 	struct ib_mr *ibmr = NULL;
 	struct nes_pd *nespd;
 	u64 tagged_offset;
@@ -3158,7 +3151,6 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
 
 	if (raddr->sin_addr.s_addr != laddr->sin_addr.s_addr) {
 		u64temp = (unsigned long)nesqp;
-		nesibdev = nesvnic->nesibdev;
 		nespd = nesqp->nespd;
 		tagged_offset = (u64)(unsigned long)*start_buff;
 		ibmr = nes_reg_phys_mr(&nespd->ibpd,
diff --git a/drivers/infiniband/hw/nes/nes_utils.c b/drivers/infiniband/hw/nes/nes_utils.c
index 7b67e9cb57ed..0613eb5006cc 100644
--- a/drivers/infiniband/hw/nes/nes_utils.c
+++ b/drivers/infiniband/hw/nes/nes_utils.c
@@ -753,7 +753,6 @@ void nes_mh_fix(unsigned long parm)
 	u32 mac_tx_frames_low;
 	u32 mac_tx_frames_high;
 	u32 mac_tx_pauses;
-	u32 serdes_status;
 	u32 reset_value;
 	u32 tx_control;
 	u32 tx_config;
@@ -846,7 +845,7 @@ void nes_mh_fix(unsigned long parm)
 		}
 
 		nes_write_indexed(nesdev, NES_IDX_ETH_SERDES_COMMON_CONTROL0, 0x00000008);
-		serdes_status = nes_read_indexed(nesdev, NES_IDX_ETH_SERDES_COMMON_STATUS0);
+		nes_read_indexed(nesdev, NES_IDX_ETH_SERDES_COMMON_STATUS0);
 
 		nes_write_indexed(nesdev, NES_IDX_ETH_SERDES_TX_EMP0, 0x000bdef7);
 		nes_write_indexed(nesdev, NES_IDX_ETH_SERDES_TX_DRIVE0, 0x9ce73000);
@@ -859,7 +858,7 @@ void nes_mh_fix(unsigned long parm)
 		} else {
 			nes_write_indexed(nesdev, NES_IDX_ETH_SERDES_RX_EQ_CONTROL0, 0xf0042222);
 		}
-		serdes_status = nes_read_indexed(nesdev, NES_IDX_ETH_SERDES_RX_EQ_STATUS0);
+		nes_read_indexed(nesdev, NES_IDX_ETH_SERDES_RX_EQ_STATUS0);
 		nes_write_indexed(nesdev, NES_IDX_ETH_SERDES_CDR_CONTROL0, 0x000000ff);
 
 		nes_write_indexed(nesdev, NES_IDX_MAC_TX_CONTROL, tx_control);
-- 
2.14.2

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

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

* [PATCH 31/47] IB/nes: Fix a race condition in nes_inetaddr_event()
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (29 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 30/47] IB/nes: Remove set-but-not-used variables Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
  2017-10-06 21:33   ` [PATCH 32/47] RDMA/ocrdma: Use NULL instead of 0 to represent a pointer Bart Van Assche
                     ` (16 subsequent siblings)
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Faisal Latif

This patch has been compile-tested only.

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Faisal Latif <faisal.latif-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/nes/nes.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c
index ff58dfa071b8..42b68aa999fc 100644
--- a/drivers/infiniband/hw/nes/nes.c
+++ b/drivers/infiniband/hw/nes/nes.c
@@ -178,11 +178,16 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
 					/* fall through */
 				case NETDEV_CHANGEADDR:
 					/* Add the address to the IP table */
-					if (upper_dev)
-						nesvnic->local_ipaddr =
-							((struct in_device *)upper_dev->ip_ptr)->ifa_list->ifa_address;
-					else
+					if (upper_dev) {
+						struct in_device *in;
+
+						rcu_read_lock();
+						in = __in_dev_get_rcu(upper_dev);
+						nesvnic->local_ipaddr = in->ifa_list->ifa_address;
+						rcu_read_unlock();
+					} else {
 						nesvnic->local_ipaddr = ifa->ifa_address;
+					}
 
 					nes_write_indexed(nesdev,
 							NES_IDX_DST_IP_ADDR+(0x10*PCI_FUNC(nesdev->pcidev->devfn)),
-- 
2.14.2

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

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

* [PATCH 32/47] RDMA/ocrdma: Use NULL instead of 0 to represent a pointer
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (30 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 31/47] IB/nes: Fix a race condition in nes_inetaddr_event() Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
  2017-10-06 21:33   ` [PATCH 33/47] RDMA/ocrdma: Suppress gcc 7 fall-through complaints Bart Van Assche
                     ` (15 subsequent siblings)
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche,
	Selvin Xavier, Devesh Sharma

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Selvin Xavier <selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Cc: Devesh Sharma <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
index 8e2e9bcf1916..eaacb71b0bff 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
@@ -3186,7 +3186,7 @@ void ocrdma_eqd_set_task(struct work_struct *work)
 {
 	struct ocrdma_dev *dev =
 		container_of(work, struct ocrdma_dev, eqd_work.work);
-	struct ocrdma_eq *eq = 0;
+	struct ocrdma_eq *eq = NULL;
 	int i, num = 0, status = -EINVAL;
 	u64 eq_intr;
 
-- 
2.14.2

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

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

* [PATCH 33/47] RDMA/ocrdma: Suppress gcc 7 fall-through complaints
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (31 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 32/47] RDMA/ocrdma: Use NULL instead of 0 to represent a pointer Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
  2017-10-06 21:33   ` [PATCH 34/47] RDMA/ocrdma: Remove set-but-not-used variables Bart Van Assche
                     ` (14 subsequent siblings)
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche,
	Selvin Xavier, Devesh Sharma

Avoid that gcc 7 reports the following warning when building with
W=1:

warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Selvin Xavier <selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Cc: Devesh Sharma <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index 27d5e8d9f08d..3757f1b8cbfc 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
@@ -2247,6 +2247,7 @@ int ocrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
 		case IB_WR_SEND_WITH_IMM:
 			hdr->cw |= (OCRDMA_FLAG_IMM << OCRDMA_WQE_FLAGS_SHIFT);
 			hdr->immdt = ntohl(wr->ex.imm_data);
+			/* fall through */
 		case IB_WR_SEND:
 			hdr->cw |= (OCRDMA_SEND << OCRDMA_WQE_OPCODE_SHIFT);
 			ocrdma_build_send(qp, hdr, wr);
@@ -2260,6 +2261,7 @@ int ocrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
 		case IB_WR_RDMA_WRITE_WITH_IMM:
 			hdr->cw |= (OCRDMA_FLAG_IMM << OCRDMA_WQE_FLAGS_SHIFT);
 			hdr->immdt = ntohl(wr->ex.imm_data);
+			/* fall through */
 		case IB_WR_RDMA_WRITE:
 			hdr->cw |= (OCRDMA_WRITE << OCRDMA_WQE_OPCODE_SHIFT);
 			status = ocrdma_build_write(qp, hdr, wr);
-- 
2.14.2

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

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

* [PATCH 34/47] RDMA/ocrdma: Remove set-but-not-used variables
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (32 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 33/47] RDMA/ocrdma: Suppress gcc 7 fall-through complaints Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
  2017-10-06 21:33   ` [PATCH 35/47] IB/opa: Fix endianness annotation of opa_is_extended_lid() Bart Van Assche
                     ` (13 subsequent siblings)
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche,
	Selvin Xavier, Devesh Sharma

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Selvin Xavier <selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Cc: Devesh Sharma <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/ocrdma/ocrdma_hw.c    | 4 ++--
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
index eaacb71b0bff..f8c14c7baedb 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
@@ -3187,7 +3187,7 @@ void ocrdma_eqd_set_task(struct work_struct *work)
 	struct ocrdma_dev *dev =
 		container_of(work, struct ocrdma_dev, eqd_work.work);
 	struct ocrdma_eq *eq = NULL;
-	int i, num = 0, status = -EINVAL;
+	int i, num = 0;
 	u64 eq_intr;
 
 	for (i = 0; i < dev->eq_cnt; i++) {
@@ -3209,7 +3209,7 @@ void ocrdma_eqd_set_task(struct work_struct *work)
 	}
 
 	if (num)
-		status = ocrdma_modify_eqd(dev, &dev->eq_tbl[0], num);
+		ocrdma_modify_eqd(dev, &dev->eq_tbl[0], num);
 	schedule_delayed_work(&dev->eqd_work, msecs_to_jiffies(1000));
 }
 
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index 3757f1b8cbfc..7866fd8051f6 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
@@ -66,9 +66,7 @@ int ocrdma_query_gid(struct ib_device *ibdev, u8 port,
 		     int index, union ib_gid *sgid)
 {
 	int ret;
-	struct ocrdma_dev *dev;
 
-	dev = get_ocrdma_dev(ibdev);
 	memset(sgid, 0, sizeof(*sgid));
 	if (index >= OCRDMA_MAX_SGID)
 		return -EINVAL;
-- 
2.14.2

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

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

* [PATCH 35/47] IB/opa: Fix endianness annotation of opa_is_extended_lid()
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (33 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 34/47] RDMA/ocrdma: Remove set-but-not-used variables Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-36-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 36/47] RDMA/qedr: Use NULL instead of 0 to represent a pointer Bart Van Assche
                     ` (12 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche,
	Dennis Dalessandro, Niranjana Vishwanathapura

This patch does not change any functionality.

Fixes: commit e92aa00a5189 ("IB/CM: Add OPA Path record support to CM")
Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Niranjana Vishwanathapura <niranjana.vishwanathapura-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 include/rdma/opa_addr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/rdma/opa_addr.h b/include/rdma/opa_addr.h
index e6e90f18e6d5..72995a39cb97 100644
--- a/include/rdma/opa_addr.h
+++ b/include/rdma/opa_addr.h
@@ -97,7 +97,7 @@ static inline u32 opa_get_lid_from_gid(const union ib_gid *gid)
  * @dlid: The DLID
  * @slid: The SLID
  */
-static inline bool opa_is_extended_lid(u32 dlid, u32 slid)
+static inline bool opa_is_extended_lid(__be32 dlid, __be32 slid)
 {
 	if ((be32_to_cpu(dlid) >=
 	     be16_to_cpu(IB_MULTICAST_LID_BASE)) ||
-- 
2.14.2

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

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

* [PATCH 36/47] RDMA/qedr: Use NULL instead of 0 to represent a pointer
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (34 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 35/47] IB/opa: Fix endianness annotation of opa_is_extended_lid() Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
  2017-10-06 21:33   ` [PATCH 37/47] RDMA/qedr: Declare local functions static Bart Van Assche
                     ` (11 subsequent siblings)
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Ram Amrani,
	Michal Kalderon, Ariel Elior

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Ram Amrani <Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
Cc: Michal Kalderon <Michal.Kalderon-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
Cc: Ariel Elior <Ariel.Elior-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
---
 drivers/infiniband/hw/qedr/qedr_roce_cm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/qedr/qedr_roce_cm.c b/drivers/infiniband/hw/qedr/qedr_roce_cm.c
index c3c249ba62b8..2a0346678ddd 100644
--- a/drivers/infiniband/hw/qedr/qedr_roce_cm.c
+++ b/drivers/infiniband/hw/qedr/qedr_roce_cm.c
@@ -660,7 +660,7 @@ int qedr_gsi_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr,
 						  dev->gsi_ll2_handle,
 						  wr->sg_list[0].addr,
 						  wr->sg_list[0].length,
-						  0 /* cookie */,
+						  NULL /* cookie */,
 						  1 /* notify_fw */);
 		if (rc) {
 			DP_ERR(dev,
-- 
2.14.2

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

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

* [PATCH 37/47] RDMA/qedr: Declare local functions static
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (35 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 36/47] RDMA/qedr: Use NULL instead of 0 to represent a pointer Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
  2017-10-06 21:33   ` [PATCH 38/47] RDMA/qedr: Annotate iomem pointers correctly Bart Van Assche
                     ` (10 subsequent siblings)
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Michal Kalderon

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Michal Kalderon <Michal.Kalderon-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
---
 drivers/infiniband/hw/qedr/main.c         | 22 +++++++++++-----------
 drivers/infiniband/hw/qedr/qedr_iw_cm.c   | 14 +++++++-------
 drivers/infiniband/hw/qedr/qedr_roce_cm.c | 27 +++++++++++++--------------
 drivers/infiniband/hw/qedr/verbs.c        |  2 +-
 4 files changed, 32 insertions(+), 33 deletions(-)

diff --git a/drivers/infiniband/hw/qedr/main.c b/drivers/infiniband/hw/qedr/main.c
index 1afc26785049..be282e4915d8 100644
--- a/drivers/infiniband/hw/qedr/main.c
+++ b/drivers/infiniband/hw/qedr/main.c
@@ -54,8 +54,8 @@ MODULE_LICENSE("Dual BSD/GPL");
 
 #define QEDR_WQ_MULTIPLIER_DFT	(3)
 
-void qedr_ib_dispatch_event(struct qedr_dev *dev, u8 port_num,
-			    enum ib_event_type type)
+static void qedr_ib_dispatch_event(struct qedr_dev *dev, u8 port_num,
+				   enum ib_event_type type)
 {
 	struct ib_event ibev;
 
@@ -96,8 +96,8 @@ static struct net_device *qedr_get_netdev(struct ib_device *dev, u8 port_num)
 	return qdev->ndev;
 }
 
-int qedr_roce_port_immutable(struct ib_device *ibdev, u8 port_num,
-			     struct ib_port_immutable *immutable)
+static int qedr_roce_port_immutable(struct ib_device *ibdev, u8 port_num,
+				    struct ib_port_immutable *immutable)
 {
 	struct ib_port_attr attr;
 	int err;
@@ -115,8 +115,8 @@ int qedr_roce_port_immutable(struct ib_device *ibdev, u8 port_num,
 	return 0;
 }
 
-int qedr_iw_port_immutable(struct ib_device *ibdev, u8 port_num,
-			   struct ib_port_immutable *immutable)
+static int qedr_iw_port_immutable(struct ib_device *ibdev, u8 port_num,
+				  struct ib_port_immutable *immutable)
 {
 	struct ib_port_attr attr;
 	int err;
@@ -133,7 +133,7 @@ int qedr_iw_port_immutable(struct ib_device *ibdev, u8 port_num,
 	return 0;
 }
 
-int qedr_iw_register_device(struct qedr_dev *dev)
+static int qedr_iw_register_device(struct qedr_dev *dev)
 {
 	dev->ibdev.node_type = RDMA_NODE_RNIC;
 	dev->ibdev.query_gid = qedr_iw_query_gid;
@@ -159,7 +159,7 @@ int qedr_iw_register_device(struct qedr_dev *dev)
 	return 0;
 }
 
-void qedr_roce_register_device(struct qedr_dev *dev)
+static void qedr_roce_register_device(struct qedr_dev *dev)
 {
 	dev->ibdev.node_type = RDMA_NODE_IB_CA;
 	dev->ibdev.query_gid = qedr_query_gid;
@@ -689,12 +689,12 @@ static int qedr_set_device_attr(struct qedr_dev *dev)
 	return 0;
 }
 
-void qedr_unaffiliated_event(void *context, u8 event_code)
+static void qedr_unaffiliated_event(void *context, u8 event_code)
 {
 	pr_err("unaffiliated event not implemented yet\n");
 }
 
-void qedr_affiliated_event(void *context, u8 e_code, void *fw_handle)
+static void qedr_affiliated_event(void *context, u8 e_code, void *fw_handle)
 {
 #define EVENT_TYPE_NOT_DEFINED	0
 #define EVENT_TYPE_CQ		1
@@ -833,7 +833,7 @@ static int qedr_init_hw(struct qedr_dev *dev)
 	return rc;
 }
 
-void qedr_stop_hw(struct qedr_dev *dev)
+static void qedr_stop_hw(struct qedr_dev *dev)
 {
 	dev->ops->rdma_remove_user(dev->rdma_ctx, dev->dpi);
 	dev->ops->rdma_stop(dev->rdma_ctx);
diff --git a/drivers/infiniband/hw/qedr/qedr_iw_cm.c b/drivers/infiniband/hw/qedr/qedr_iw_cm.c
index 2950d3f6ecb8..478b7317b80a 100644
--- a/drivers/infiniband/hw/qedr/qedr_iw_cm.c
+++ b/drivers/infiniband/hw/qedr/qedr_iw_cm.c
@@ -79,7 +79,7 @@ qedr_fill_sockaddr6(const struct qed_iwarp_cm_info *cm_info,
 	}
 }
 
-void
+static void
 qedr_iw_mpa_request(void *context, struct qed_iwarp_cm_event_params *params)
 {
 	struct qedr_iw_listener *listener = (struct qedr_iw_listener *)context;
@@ -113,7 +113,7 @@ qedr_iw_mpa_request(void *context, struct qed_iwarp_cm_event_params *params)
 	listener->cm_id->event_handler(listener->cm_id, &event);
 }
 
-void
+static void
 qedr_iw_issue_event(void *context,
 		    struct qed_iwarp_cm_event_params *params,
 		    enum iw_cm_event_type event_type)
@@ -136,7 +136,7 @@ qedr_iw_issue_event(void *context,
 		ep->cm_id->event_handler(ep->cm_id, &event);
 }
 
-void
+static void
 qedr_iw_close_event(void *context, struct qed_iwarp_cm_event_params *params)
 {
 	struct qedr_iw_ep *ep = (struct qedr_iw_ep *)context;
@@ -149,7 +149,7 @@ qedr_iw_close_event(void *context, struct qed_iwarp_cm_event_params *params)
 	}
 }
 
-void
+static void
 qedr_iw_qp_event(void *context,
 		 struct qed_iwarp_cm_event_params *params,
 		 enum ib_event_type ib_event, char *str)
@@ -217,7 +217,7 @@ static void qedr_iw_disconnect_worker(struct work_struct *work)
 	qedr_iw_qp_rem_ref(&qp->ibqp);
 }
 
-void
+static void
 qedr_iw_disconnect_event(void *context,
 			 struct qed_iwarp_cm_event_params *params)
 {
@@ -262,7 +262,7 @@ qedr_iw_passive_complete(void *context,
 		qedr_iw_close_event(context, params);
 }
 
-int
+static int
 qedr_iw_mpa_reply(void *context, struct qed_iwarp_cm_event_params *params)
 {
 	struct qedr_iw_ep *ep = (struct qedr_iw_ep *)context;
@@ -274,7 +274,7 @@ qedr_iw_mpa_reply(void *context, struct qed_iwarp_cm_event_params *params)
 	return dev->ops->iwarp_send_rtr(dev->rdma_ctx, &rtr_in);
 }
 
-int
+static int
 qedr_iw_event_handler(void *context, struct qed_iwarp_cm_event_params *params)
 {
 	struct qedr_iw_ep *ep = (struct qedr_iw_ep *)context;
diff --git a/drivers/infiniband/hw/qedr/qedr_roce_cm.c b/drivers/infiniband/hw/qedr/qedr_roce_cm.c
index 2a0346678ddd..9dbf0cc985f3 100644
--- a/drivers/infiniband/hw/qedr/qedr_roce_cm.c
+++ b/drivers/infiniband/hw/qedr/qedr_roce_cm.c
@@ -64,11 +64,11 @@ void qedr_store_gsi_qp_cq(struct qedr_dev *dev, struct qedr_qp *qp,
 	dev->gsi_qp = qp;
 }
 
-void qedr_ll2_complete_tx_packet(void *cxt,
-				 u8 connection_handle,
-				 void *cookie,
-				 dma_addr_t first_frag_addr,
-				 bool b_last_fragment, bool b_last_packet)
+static void qedr_ll2_complete_tx_packet(void *cxt, u8 connection_handle,
+					void *cookie,
+					dma_addr_t first_frag_addr,
+					bool b_last_fragment,
+					bool b_last_packet)
 {
 	struct qedr_dev *dev = (struct qedr_dev *)cxt;
 	struct qed_roce_ll2_packet *pkt = cookie;
@@ -93,8 +93,8 @@ void qedr_ll2_complete_tx_packet(void *cxt,
 		(*cq->ibcq.comp_handler) (&cq->ibcq, cq->ibcq.cq_context);
 }
 
-void qedr_ll2_complete_rx_packet(void *cxt,
-				 struct qed_ll2_comp_rx_data *data)
+static void qedr_ll2_complete_rx_packet(void *cxt,
+					struct qed_ll2_comp_rx_data *data)
 {
 	struct qedr_dev *dev = (struct qedr_dev *)cxt;
 	struct qedr_cq *cq = dev->gsi_rqcq;
@@ -122,10 +122,9 @@ void qedr_ll2_complete_rx_packet(void *cxt,
 		(*cq->ibcq.comp_handler) (&cq->ibcq, cq->ibcq.cq_context);
 }
 
-void qedr_ll2_release_rx_packet(void *cxt,
-				u8 connection_handle,
-				void *cookie,
-				dma_addr_t rx_buf_addr, bool b_last_packet)
+static void qedr_ll2_release_rx_packet(void *cxt, u8 connection_handle,
+				       void *cookie, dma_addr_t rx_buf_addr,
+				       bool b_last_packet)
 {
 	/* Do nothing... */
 }
@@ -237,7 +236,7 @@ static int qedr_ll2_post_tx(struct qedr_dev *dev,
 	return 0;
 }
 
-int qedr_ll2_stop(struct qedr_dev *dev)
+static int qedr_ll2_stop(struct qedr_dev *dev)
 {
 	int rc;
 
@@ -260,8 +259,8 @@ int qedr_ll2_stop(struct qedr_dev *dev)
 	return rc;
 }
 
-int qedr_ll2_start(struct qedr_dev *dev,
-		   struct ib_qp_init_attr *attrs, struct qedr_qp *qp)
+static int qedr_ll2_start(struct qedr_dev *dev,
+			  struct ib_qp_init_attr *attrs, struct qedr_qp *qp)
 {
 	struct qed_ll2_acquire_data data;
 	struct qed_ll2_cbs cbs;
diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c
index a8a6e66767d5..5acb9eab64ed 100644
--- a/drivers/infiniband/hw/qedr/verbs.c
+++ b/drivers/infiniband/hw/qedr/verbs.c
@@ -2268,7 +2268,7 @@ int qedr_query_qp(struct ib_qp *ibqp,
 	return rc;
 }
 
-int qedr_free_qp_resources(struct qedr_dev *dev, struct qedr_qp *qp)
+static int qedr_free_qp_resources(struct qedr_dev *dev, struct qedr_qp *qp)
 {
 	int rc = 0;
 
-- 
2.14.2

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

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

* [PATCH 38/47] RDMA/qedr: Annotate iomem pointers correctly
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (36 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 37/47] RDMA/qedr: Declare local functions static Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
  2017-10-06 21:33   ` [PATCH 39/47] RDMA/qedr: Remove set-but-not-used variables Bart Van Assche
                     ` (9 subsequent siblings)
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Ram Amrani,
	Michal Kalderon, Ariel Elior

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Ram Amrani <Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
Cc: Michal Kalderon <Michal.Kalderon-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
Cc: Ariel Elior <Ariel.Elior-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
---
 drivers/infiniband/hw/qedr/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/qedr/main.c b/drivers/infiniband/hw/qedr/main.c
index be282e4915d8..50812b33291b 100644
--- a/drivers/infiniband/hw/qedr/main.c
+++ b/drivers/infiniband/hw/qedr/main.c
@@ -819,7 +819,7 @@ static int qedr_init_hw(struct qedr_dev *dev)
 	if (rc)
 		goto out;
 
-	dev->db_addr = (void *)(uintptr_t)out_params.dpi_addr;
+	dev->db_addr = (void __iomem *)(uintptr_t)out_params.dpi_addr;
 	dev->db_phys_addr = out_params.dpi_phys_addr;
 	dev->db_size = out_params.dpi_size;
 	dev->dpi = out_params.dpi;
-- 
2.14.2

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

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

* [PATCH 39/47] RDMA/qedr: Remove set-but-not-used variables
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (37 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 38/47] RDMA/qedr: Annotate iomem pointers correctly Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
  2017-10-06 21:33   ` [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use Bart Van Assche
                     ` (8 subsequent siblings)
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Ram Amrani,
	Michal Kalderon, Ariel Elior

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Ram Amrani <Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
Cc: Michal Kalderon <Michal.Kalderon-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
Cc: Ariel Elior <Ariel.Elior-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
---
 drivers/infiniband/hw/qedr/verbs.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c
index 5acb9eab64ed..b26aa88dab48 100644
--- a/drivers/infiniband/hw/qedr/verbs.c
+++ b/drivers/infiniband/hw/qedr/verbs.c
@@ -1447,13 +1447,11 @@ static int qedr_create_user_qp(struct qedr_dev *dev,
 	struct qed_rdma_create_qp_out_params out_params;
 	struct qedr_pd *pd = get_qedr_pd(ibpd);
 	struct ib_ucontext *ib_ctx = NULL;
-	struct qedr_ucontext *ctx = NULL;
 	struct qedr_create_qp_ureq ureq;
 	int alloc_and_init = rdma_protocol_roce(&dev->ibdev, 1);
 	int rc = -EINVAL;
 
 	ib_ctx = ibpd->uobject->context;
-	ctx = get_qedr_ucontext(ib_ctx);
 
 	memset(&ureq, 0, sizeof(ureq));
 	rc = ib_copy_from_udata(&ureq, udata, sizeof(ureq));
@@ -2602,7 +2600,6 @@ static struct qedr_mr *__qedr_alloc_mr(struct ib_pd *ibpd,
 struct ib_mr *qedr_alloc_mr(struct ib_pd *ibpd,
 			    enum ib_mr_type mr_type, u32 max_num_sg)
 {
-	struct qedr_dev *dev;
 	struct qedr_mr *mr;
 
 	if (mr_type != IB_MR_TYPE_MEM_REG)
@@ -2613,8 +2610,6 @@ struct ib_mr *qedr_alloc_mr(struct ib_pd *ibpd,
 	if (IS_ERR(mr))
 		return ERR_PTR(-EINVAL);
 
-	dev = mr->dev;
-
 	return &mr->ibmr;
 }
 
@@ -3109,7 +3104,7 @@ static int __qedr_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
 		break;
 	case IB_WR_RDMA_READ_WITH_INV:
 		SET_FIELD2(wqe->flags, RDMA_SQ_RDMA_WQE_1ST_READ_INV_FLG, 1);
-		/* fallthrough... same is identical to RDMA READ */
+		/* fallthrough -- same is identical to RDMA READ */
 
 	case IB_WR_RDMA_READ:
 		wqe->req_type = RDMA_SQ_REQ_TYPE_RDMA_RD;
-- 
2.14.2

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

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

* [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (38 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 39/47] RDMA/qedr: Remove set-but-not-used variables Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-41-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 41/47] IB/qib: Suppress gcc 7 fall-through complaints Bart Van Assche
                     ` (7 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Mike Marciniszyn

Avoid that using the qib_inc_eeprom_err() macro in an if-statement
triggers the following compiler warning:

warning: suggest braces around empty body in an 'if' statement [-Wempty-body]

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Mike Marciniszyn <infinipath-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/qib/qib.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/qib/qib.h b/drivers/infiniband/hw/qib/qib.h
index 1167a9c1776b..f2fffbd3e95c 100644
--- a/drivers/infiniband/hw/qib/qib.h
+++ b/drivers/infiniband/hw/qib/qib.h
@@ -1297,7 +1297,7 @@ int qib_twsi_blk_rd(struct qib_devdata *dd, int dev, int addr, void *buffer,
 int qib_twsi_blk_wr(struct qib_devdata *dd, int dev, int addr,
 		    const void *buffer, int len);
 void qib_get_eeprom_info(struct qib_devdata *);
-#define qib_inc_eeprom_err(dd, eidx, incr)
+#define qib_inc_eeprom_err(dd, eidx, incr) do { } while (0)
 void qib_dump_lookup_output_queue(struct qib_devdata *);
 void qib_force_pio_avail_update(struct qib_devdata *);
 void qib_clear_symerror_on_linkup(unsigned long opaque);
-- 
2.14.2

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

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

* [PATCH 41/47] IB/qib: Suppress gcc 7 fall-through complaints
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (39 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-42-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 42/47] IB/qib: Remove set-but-not-used variables Bart Van Assche
                     ` (6 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Mike Marciniszyn

Avoid that gcc 7 reports the following warning when building with W=1:

warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Mike Marciniszyn <infinipath-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/qib/qib_mad.c  | 1 +
 drivers/infiniband/hw/qib/qib_rc.c   | 2 +-
 drivers/infiniband/hw/qib/qib_sdma.c | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/qib/qib_mad.c b/drivers/infiniband/hw/qib/qib_mad.c
index 1237952c144e..04367e0f6f9b 100644
--- a/drivers/infiniband/hw/qib/qib_mad.c
+++ b/drivers/infiniband/hw/qib/qib_mad.c
@@ -434,6 +434,7 @@ static int check_mkey(struct qib_ibport *ibp, struct ib_smp *smp, int mad_flags)
 			/* Bad mkey not a violation below level 2 */
 			if (ibp->rvp.mkeyprot < 2)
 				break;
+			/* fall through */
 		case IB_MGMT_METHOD_SET:
 		case IB_MGMT_METHOD_TRAP_REPRESS:
 			if (ibp->rvp.mkey_violations != 0xFFFF)
diff --git a/drivers/infiniband/hw/qib/qib_rc.c b/drivers/infiniband/hw/qib/qib_rc.c
index e9a91736b12d..8f5754fb8579 100644
--- a/drivers/infiniband/hw/qib/qib_rc.c
+++ b/drivers/infiniband/hw/qib/qib_rc.c
@@ -1869,7 +1869,7 @@ void qib_rc_rcv(struct qib_ctxtdata *rcd, struct ib_header *hdr,
 		qp->r_rcv_len = 0;
 		if (opcode == OP(SEND_ONLY))
 			goto no_immediate_data;
-		/* FALLTHROUGH for SEND_ONLY_WITH_IMMEDIATE */
+		/* fall through -- for SEND_ONLY_WITH_IMMEDIATE */
 	case OP(SEND_LAST_WITH_IMMEDIATE):
 send_last_imm:
 		wc.ex.imm_data = ohdr->u.imm_data;
diff --git a/drivers/infiniband/hw/qib/qib_sdma.c b/drivers/infiniband/hw/qib/qib_sdma.c
index 891873b38a1e..c3690bd51582 100644
--- a/drivers/infiniband/hw/qib/qib_sdma.c
+++ b/drivers/infiniband/hw/qib/qib_sdma.c
@@ -808,7 +808,7 @@ void __qib_sdma_process_event(struct qib_pportdata *ppd,
 			 * bringing the link up with traffic active on
 			 * 7220, e.g. */
 			ss->go_s99_running = 1;
-			/* fall through and start dma engine */
+			/* fall through -- and start dma engine */
 		case qib_sdma_event_e10_go_hw_start:
 			/* This reference means the state machine is started */
 			sdma_get(&ppd->sdma_state);
-- 
2.14.2

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

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

* [PATCH 42/47] IB/qib: Remove set-but-not-used variables
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (40 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 41/47] IB/qib: Suppress gcc 7 fall-through complaints Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-43-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 43/47] RDMA/rdmavt: Suppress gcc 7 fall-through complaints Bart Van Assche
                     ` (5 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Mike Marciniszyn

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Mike Marciniszyn <infinipath-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/qib/qib_diag.c     |  6 ------
 drivers/infiniband/hw/qib/qib_file_ops.c |  9 ---------
 drivers/infiniband/hw/qib/qib_iba6120.c  |  2 --
 drivers/infiniband/hw/qib/qib_iba7220.c  |  3 ---
 drivers/infiniband/hw/qib/qib_iba7322.c  | 15 ++++-----------
 drivers/infiniband/hw/qib/qib_mad.c      |  3 +--
 drivers/infiniband/hw/qib/qib_pcie.c     |  3 +--
 drivers/infiniband/hw/qib/qib_sd7220.c   |  2 --
 drivers/infiniband/hw/qib/qib_tx.c       |  4 ----
 drivers/infiniband/hw/qib/qib_verbs.c    |  3 +--
 10 files changed, 7 insertions(+), 43 deletions(-)

diff --git a/drivers/infiniband/hw/qib/qib_diag.c b/drivers/infiniband/hw/qib/qib_diag.c
index 775018b32b0d..a9377eee8734 100644
--- a/drivers/infiniband/hw/qib/qib_diag.c
+++ b/drivers/infiniband/hw/qib/qib_diag.c
@@ -761,7 +761,6 @@ static ssize_t qib_diag_read(struct file *fp, char __user *data,
 {
 	struct qib_diag_client *dc = fp->private_data;
 	struct qib_devdata *dd = dc->dd;
-	void __iomem *kreg_base;
 	ssize_t ret;
 
 	if (dc->pid != current->pid) {
@@ -769,8 +768,6 @@ static ssize_t qib_diag_read(struct file *fp, char __user *data,
 		goto bail;
 	}
 
-	kreg_base = dd->kregbase;
-
 	if (count == 0)
 		ret = 0;
 	else if ((count % 4) || (*off % 4))
@@ -838,7 +835,6 @@ static ssize_t qib_diag_write(struct file *fp, const char __user *data,
 {
 	struct qib_diag_client *dc = fp->private_data;
 	struct qib_devdata *dd = dc->dd;
-	void __iomem *kreg_base;
 	ssize_t ret;
 
 	if (dc->pid != current->pid) {
@@ -846,8 +842,6 @@ static ssize_t qib_diag_write(struct file *fp, const char __user *data,
 		goto bail;
 	}
 
-	kreg_base = dd->kregbase;
-
 	if (count == 0)
 		ret = 0;
 	else if ((count % 4) || (*off % 4))
diff --git a/drivers/infiniband/hw/qib/qib_file_ops.c b/drivers/infiniband/hw/qib/qib_file_ops.c
index 9396c1807cc3..2d6a191afec0 100644
--- a/drivers/infiniband/hw/qib/qib_file_ops.c
+++ b/drivers/infiniband/hw/qib/qib_file_ops.c
@@ -696,15 +696,8 @@ static void qib_clean_part_key(struct qib_ctxtdata *rcd,
 			       struct qib_devdata *dd)
 {
 	int i, j, pchanged = 0;
-	u64 oldpkey;
 	struct qib_pportdata *ppd = rcd->ppd;
 
-	/* for debugging only */
-	oldpkey = (u64) ppd->pkeys[0] |
-		((u64) ppd->pkeys[1] << 16) |
-		((u64) ppd->pkeys[2] << 32) |
-		((u64) ppd->pkeys[3] << 48);
-
 	for (i = 0; i < ARRAY_SIZE(rcd->pkeys); i++) {
 		if (!rcd->pkeys[i])
 			continue;
@@ -1817,7 +1810,6 @@ static int qib_close(struct inode *in, struct file *fp)
 	struct qib_devdata *dd;
 	unsigned long flags;
 	unsigned ctxt;
-	pid_t pid;
 
 	mutex_lock(&qib_mutex);
 
@@ -1859,7 +1851,6 @@ static int qib_close(struct inode *in, struct file *fp)
 	spin_lock_irqsave(&dd->uctxt_lock, flags);
 	ctxt = rcd->ctxt;
 	dd->rcd[ctxt] = NULL;
-	pid = rcd->pid;
 	rcd->pid = 0;
 	spin_unlock_irqrestore(&dd->uctxt_lock, flags);
 
diff --git a/drivers/infiniband/hw/qib/qib_iba6120.c b/drivers/infiniband/hw/qib/qib_iba6120.c
index c4a4c57e0f0a..65d61274ab8f 100644
--- a/drivers/infiniband/hw/qib/qib_iba6120.c
+++ b/drivers/infiniband/hw/qib/qib_iba6120.c
@@ -1914,7 +1914,6 @@ static void qib_6120_put_tid_2(struct qib_devdata *dd, u64 __iomem *tidptr,
 			       u32 type, unsigned long pa)
 {
 	u32 __iomem *tidp32 = (u32 __iomem *)tidptr;
-	u32 tidx;
 
 	if (!dd->kregbase)
 		return;
@@ -1938,7 +1937,6 @@ static void qib_6120_put_tid_2(struct qib_devdata *dd, u64 __iomem *tidptr,
 		else /* for now, always full 4KB page */
 			pa |= 2 << 29;
 	}
-	tidx = tidptr - dd->egrtidbase;
 	writel(pa, tidp32);
 	mmiowb();
 }
diff --git a/drivers/infiniband/hw/qib/qib_iba7220.c b/drivers/infiniband/hw/qib/qib_iba7220.c
index 78ce79be4120..7df874e54827 100644
--- a/drivers/infiniband/hw/qib/qib_iba7220.c
+++ b/drivers/infiniband/hw/qib/qib_iba7220.c
@@ -3524,7 +3524,6 @@ static void autoneg_7220_work(struct work_struct *work)
 {
 	struct qib_pportdata *ppd;
 	struct qib_devdata *dd;
-	u64 startms;
 	u32 i;
 	unsigned long flags;
 
@@ -3532,8 +3531,6 @@ static void autoneg_7220_work(struct work_struct *work)
 			    autoneg_work.work)->pportdata;
 	dd = ppd->dd;
 
-	startms = jiffies_to_msecs(jiffies);
-
 	/*
 	 * Busy wait for this first part, it should be at most a
 	 * few hundred usec, since we scheduled ourselves for 2msec.
diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c
index 4d02cffe4e03..a28fc358aff4 100644
--- a/drivers/infiniband/hw/qib/qib_iba7322.c
+++ b/drivers/infiniband/hw/qib/qib_iba7322.c
@@ -3435,7 +3435,6 @@ static void qib_setup_7322_interrupt(struct qib_devdata *dd, int clearpend)
 	for (i = 0; msixnum < dd->cspec->num_msix_entries; i++) {
 		irq_handler_t handler;
 		void *arg;
-		u64 val;
 		int lsb, reg, sh;
 #ifdef CONFIG_INFINIBAND_QIB_DCA
 		int dca = 0;
@@ -3506,8 +3505,8 @@ static void qib_setup_7322_interrupt(struct qib_devdata *dd, int clearpend)
 			mask &= ~(1ULL << lsb);
 			redirect[reg] |= ((u64) msixnum) << sh;
 		}
-		val = qib_read_kreg64(dd, 2 * msixnum + 1 +
-			(QIB_7322_MsixTable_OFFS / sizeof(u64)));
+		qib_read_kreg64(dd, 2 * msixnum + 1 +
+				(QIB_7322_MsixTable_OFFS / sizeof(u64)));
 		if (firstcpu < nr_cpu_ids &&
 			zalloc_cpumask_var(
 				&dd->cspec->msix_entries[msixnum].mask,
@@ -5362,16 +5361,11 @@ static void try_7322_autoneg(struct qib_pportdata *ppd)
 static void autoneg_7322_work(struct work_struct *work)
 {
 	struct qib_pportdata *ppd;
-	struct qib_devdata *dd;
-	u64 startms;
 	u32 i;
 	unsigned long flags;
 
 	ppd = container_of(work, struct qib_chippport_specific,
 			    autoneg_work.work)->ppd;
-	dd = ppd->dd;
-
-	startms = jiffies_to_msecs(jiffies);
 
 	/*
 	 * Busy wait for this first part, it should be at most a
@@ -7811,13 +7805,12 @@ static void ibsd_wr_allchans(struct qib_pportdata *ppd, int addr, unsigned data,
 {
 	struct qib_devdata *dd = ppd->dd;
 	int chan;
-	u32 rbc;
 
 	for (chan = 0; chan < SERDES_CHANS; ++chan) {
 		ahb_mod(dd, IBSD(ppd->hw_pidx), (chan + (chan >> 1)), addr,
 			data, mask);
-		rbc = ahb_mod(dd, IBSD(ppd->hw_pidx), (chan + (chan >> 1)),
-			      addr, 0, 0);
+		ahb_mod(dd, IBSD(ppd->hw_pidx), (chan + (chan >> 1)), addr,
+			0, 0);
 	}
 }
 
diff --git a/drivers/infiniband/hw/qib/qib_mad.c b/drivers/infiniband/hw/qib/qib_mad.c
index 04367e0f6f9b..841312f60dfd 100644
--- a/drivers/infiniband/hw/qib/qib_mad.c
+++ b/drivers/infiniband/hw/qib/qib_mad.c
@@ -280,7 +280,7 @@ static int subn_get_nodeinfo(struct ib_smp *smp, struct ib_device *ibdev,
 {
 	struct ib_node_info *nip = (struct ib_node_info *)&smp->data;
 	struct qib_devdata *dd = dd_from_ibdev(ibdev);
-	u32 vendor, majrev, minrev;
+	u32 majrev, minrev;
 	unsigned pidx = port - 1; /* IB number port from 1, hdw from 0 */
 
 	/* GUID 0 is illegal */
@@ -303,7 +303,6 @@ static int subn_get_nodeinfo(struct ib_smp *smp, struct ib_device *ibdev,
 	minrev = dd->minrev;
 	nip->revision = cpu_to_be32((majrev << 16) | minrev);
 	nip->local_port_num = port;
-	vendor = dd->vendorid;
 	nip->vendor_id[0] = QIB_SRC_OUI_1;
 	nip->vendor_id[1] = QIB_SRC_OUI_2;
 	nip->vendor_id[2] = QIB_SRC_OUI_3;
diff --git a/drivers/infiniband/hw/qib/qib_pcie.c b/drivers/infiniband/hw/qib/qib_pcie.c
index 6f4cc268926c..5ac7b31c346b 100644
--- a/drivers/infiniband/hw/qib/qib_pcie.c
+++ b/drivers/infiniband/hw/qib/qib_pcie.c
@@ -397,7 +397,6 @@ MODULE_PARM_DESC(pcie_coalesce, "tune PCIe colescing on some Intel chipsets");
  */
 static void qib_tune_pcie_coalesce(struct qib_devdata *dd)
 {
-	int r;
 	struct pci_dev *parent;
 	u16 devid;
 	u32 mask, bits, val;
@@ -452,7 +451,7 @@ static void qib_tune_pcie_coalesce(struct qib_devdata *dd)
 	pci_read_config_dword(parent, 0x48, &val);
 	val &= ~mask;
 	val |= bits;
-	r = pci_write_config_dword(parent, 0x48, val);
+	pci_write_config_dword(parent, 0x48, val);
 }
 
 /*
diff --git a/drivers/infiniband/hw/qib/qib_sd7220.c b/drivers/infiniband/hw/qib/qib_sd7220.c
index c72775f27212..ad52f7ac620c 100644
--- a/drivers/infiniband/hw/qib/qib_sd7220.c
+++ b/drivers/infiniband/hw/qib/qib_sd7220.c
@@ -755,7 +755,6 @@ static int qib_sd7220_ram_xfer(struct qib_devdata *dd, int sdnum, u32 loc,
 	int addr;
 	int ret;
 	unsigned long flags;
-	const char *op;
 
 	/* Pick appropriate transaction reg and "Chip select" for this serdes */
 	switch (sdnum) {
@@ -775,7 +774,6 @@ static int qib_sd7220_ram_xfer(struct qib_devdata *dd, int sdnum, u32 loc,
 		return -1;
 	}
 
-	op = rd_notwr ? "Rd" : "Wr";
 	spin_lock_irqsave(&dd->cspec->sdepb_lock, flags);
 
 	owned = epb_access(dd, sdnum, 1);
diff --git a/drivers/infiniband/hw/qib/qib_tx.c b/drivers/infiniband/hw/qib/qib_tx.c
index eface3b3dacf..c9537cfc12ce 100644
--- a/drivers/infiniband/hw/qib/qib_tx.c
+++ b/drivers/infiniband/hw/qib/qib_tx.c
@@ -179,8 +179,6 @@ void qib_disarm_piobufs_set(struct qib_devdata *dd, unsigned long *mask,
 		pppd[i] = NULL;
 
 	for (i = 0; i < cnt; i++) {
-		int which;
-
 		if (!test_bit(i, mask))
 			continue;
 		/*
@@ -201,9 +199,7 @@ void qib_disarm_piobufs_set(struct qib_devdata *dd, unsigned long *mask,
 		    (!test_bit(i << 1, dd->pioavailkernel) &&
 		     find_ctxt(dd, i))) {
 			__set_bit(i, dd->pio_need_disarm);
-			which = 0;
 		} else {
-			which = 1;
 			dd->f_sendctrl(dd->pport, QIB_SENDCTRL_DISARM_BUF(i));
 		}
 		spin_unlock_irqrestore(&dd->pioavail_lock, flags);
diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c
index 9d92aeb8d9a1..46e2da09d05b 100644
--- a/drivers/infiniband/hw/qib/qib_verbs.c
+++ b/drivers/infiniband/hw/qib/qib_verbs.c
@@ -701,7 +701,7 @@ void qib_put_txreq(struct qib_verbs_txreq *tx)
  */
 void qib_verbs_sdma_desc_avail(struct qib_pportdata *ppd, unsigned avail)
 {
-	struct rvt_qp *qp, *nqp;
+	struct rvt_qp *qp;
 	struct qib_qp_priv *qpp, *nqpp;
 	struct rvt_qp *qps[20];
 	struct qib_ibdev *dev;
@@ -714,7 +714,6 @@ void qib_verbs_sdma_desc_avail(struct qib_pportdata *ppd, unsigned avail)
 	/* Search wait list for first QP wanting DMA descriptors. */
 	list_for_each_entry_safe(qpp, nqpp, &dev->dmawait, iowait) {
 		qp = qpp->owner;
-		nqp = nqpp->owner;
 		if (qp->port_num != ppd->port)
 			continue;
 		if (n == ARRAY_SIZE(qps))
-- 
2.14.2

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

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

* [PATCH 43/47] RDMA/rdmavt: Suppress gcc 7 fall-through complaints
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (41 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 42/47] IB/qib: Remove set-but-not-used variables Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-44-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 44/47] RDMA/rxe: " Bart Van Assche
                     ` (4 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Dennis Dalessandro

Avoid that gcc 7 reports the following warning when building with W=1:

warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/sw/rdmavt/qp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index 22df09ae809e..efcff7056496 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -807,6 +807,7 @@ struct ib_qp *rvt_create_qp(struct ib_pd *ibpd,
 		if (init_attr->port_num == 0 ||
 		    init_attr->port_num > ibpd->device->phys_port_cnt)
 			return ERR_PTR(-EINVAL);
+		/* fall through */
 	case IB_QPT_UC:
 	case IB_QPT_RC:
 	case IB_QPT_UD:
-- 
2.14.2

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

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

* [PATCH 44/47] RDMA/rxe: Suppress gcc 7 fall-through complaints
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (42 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 43/47] RDMA/rdmavt: Suppress gcc 7 fall-through complaints Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
       [not found]     ` <20171006213333.6721-45-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 21:33   ` [PATCH 45/47] RDMA/usnic: Make the compiler check declaration consistency during compilation Bart Van Assche
                     ` (3 subsequent siblings)
  47 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche, Moni Shoua

Avoid that gcc 7 reports the following warning when building with W=1:

warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Cc: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/sw/rxe/rxe_comp.c  | 4 ++--
 drivers/infiniband/sw/rxe/rxe_task.c  | 2 +-
 drivers/infiniband/sw/rxe/rxe_verbs.c | 1 +
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_comp.c b/drivers/infiniband/sw/rxe/rxe_comp.c
index 9eb12c2e3c74..ff64875e3d15 100644
--- a/drivers/infiniband/sw/rxe/rxe_comp.c
+++ b/drivers/infiniband/sw/rxe/rxe_comp.c
@@ -270,8 +270,8 @@ static inline enum comp_state check_ack(struct rxe_qp *qp,
 		if ((syn & AETH_TYPE_MASK) != AETH_ACK)
 			return COMPST_ERROR;
 
-		/* Fall through (IB_OPCODE_RC_RDMA_READ_RESPONSE_MIDDLE
-		 * doesn't have an AETH)
+		/* fall through */
+		/* (IB_OPCODE_RC_RDMA_READ_RESPONSE_MIDDLE doesn't have an AETH)
 		 */
 	case IB_OPCODE_RC_RDMA_READ_RESPONSE_MIDDLE:
 		if (wqe->wr.opcode != IB_WR_RDMA_READ &&
diff --git a/drivers/infiniband/sw/rxe/rxe_task.c b/drivers/infiniband/sw/rxe/rxe_task.c
index ea3810b29273..08f05ac5f5d5 100644
--- a/drivers/infiniband/sw/rxe/rxe_task.c
+++ b/drivers/infiniband/sw/rxe/rxe_task.c
@@ -71,7 +71,7 @@ void rxe_do_task(unsigned long data)
 
 	case TASK_STATE_BUSY:
 		task->state = TASK_STATE_ARMED;
-		/* fall through to */
+		/* fall through */
 	case TASK_STATE_ARMED:
 		spin_unlock_irqrestore(&task->state_lock, flags);
 		return;
diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
index 0b362f49a10a..ff77f4f66970 100644
--- a/drivers/infiniband/sw/rxe/rxe_verbs.c
+++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
@@ -644,6 +644,7 @@ static void init_send_wr(struct rxe_qp *qp, struct rxe_send_wr *wr,
 		switch (wr->opcode) {
 		case IB_WR_RDMA_WRITE_WITH_IMM:
 			wr->ex.imm_data = ibwr->ex.imm_data;
+			/* fall through */
 		case IB_WR_RDMA_READ:
 		case IB_WR_RDMA_WRITE:
 			wr->wr.rdma.remote_addr = rdma_wr(ibwr)->remote_addr;
-- 
2.14.2

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

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

* [PATCH 45/47] RDMA/usnic: Make the compiler check declaration consistency during compilation
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (43 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 44/47] RDMA/rxe: " Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
  2017-10-06 21:33   ` [PATCH 46/47] RDMA/usnic: Remove a set-but-not-used variable Bart Van Assche
                     ` (2 subsequent siblings)
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche,
	Bart Van Assche, Christian Benvenuti, Dave Goodell

This patch avoids that sparse complains about missing declarations.

Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Cc: Christian Benvenuti <benve-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Cc: Dave Goodell <dgoodell-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/usnic/usnic_ib_sysfs.c | 1 +
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/infiniband/hw/usnic/usnic_ib_sysfs.c b/drivers/infiniband/hw/usnic/usnic_ib_sysfs.c
index 32956f9f5715..685ef2293cb8 100644
--- a/drivers/infiniband/hw/usnic/usnic_ib_sysfs.c
+++ b/drivers/infiniband/hw/usnic/usnic_ib_sysfs.c
@@ -43,6 +43,7 @@
 #include "usnic_ib_qp_grp.h"
 #include "usnic_vnic.h"
 #include "usnic_ib_verbs.h"
+#include "usnic_ib_sysfs.h"
 #include "usnic_log.h"
 #include "usnic_ib_sysfs.h"
 
diff --git a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
index e4113ef09315..8372c32485ad 100644
--- a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
+++ b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
@@ -42,6 +42,7 @@
 #include "usnic_ib.h"
 #include "usnic_common_util.h"
 #include "usnic_ib_qp_grp.h"
+#include "usnic_ib_verbs.h"
 #include "usnic_fwd.h"
 #include "usnic_log.h"
 #include "usnic_uiom.h"
-- 
2.14.2

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

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

* [PATCH 46/47] RDMA/usnic: Remove a set-but-not-used variable
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (44 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 45/47] RDMA/usnic: Make the compiler check declaration consistency during compilation Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
  2017-10-06 21:33   ` [PATCH 47/47] RDMA/usnic: Instantiate data structures once Bart Van Assche
  2017-10-09 16:51   ` [PATCH 00/47] Address issues detected by static analysis tools Doug Ledford
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche,
	Bart Van Assche, Christian Benvenuti, Dave Goodell

Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Cc: Christian Benvenuti <benve-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Cc: Dave Goodell <dgoodell-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c
index 092d4e11a633..912d8ef04352 100644
--- a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c
+++ b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c
@@ -392,14 +392,12 @@ int usnic_ib_qp_grp_modify(struct usnic_ib_qp_grp *qp_grp,
 				void *data)
 {
 	int status = 0;
-	int vnic_idx;
 	struct ib_event ib_event;
 	enum ib_qp_state old_state;
 	struct usnic_transport_spec *trans_spec;
 	struct usnic_ib_qp_grp_flow *qp_flow;
 
 	old_state = qp_grp->state;
-	vnic_idx = usnic_vnic_get_index(qp_grp->vf->vnic);
 	trans_spec = (struct usnic_transport_spec *) data;
 
 	spin_lock(&qp_grp->lock);
-- 
2.14.2

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

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

* [PATCH 47/47] RDMA/usnic: Instantiate data structures once
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (45 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 46/47] RDMA/usnic: Remove a set-but-not-used variable Bart Van Assche
@ 2017-10-06 21:33   ` Bart Van Assche
  2017-10-09 16:51   ` [PATCH 00/47] Address issues detected by static analysis tools Doug Ledford
  47 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-06 21:33 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart Van Assche,
	Bart Van Assche, Christian Benvenuti, Dave Goodell

Data structures should not be defined in a header file. Hence move
the min_transport_spec[] definition from a header file to a .c file.

Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Cc: Christian Benvenuti <benve-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Cc: Dave Goodell <dgoodell-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h | 25 +------------------------
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c  | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h
index b1458be1d402..a8a2314c9531 100644
--- a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h
+++ b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h
@@ -84,30 +84,7 @@ struct usnic_ib_qp_grp_flow {
 	char				dentry_name[32];
 };
 
-static const struct
-usnic_vnic_res_spec min_transport_spec[USNIC_TRANSPORT_MAX] = {
-	{ /*USNIC_TRANSPORT_UNKNOWN*/
-		.resources = {
-			{.type = USNIC_VNIC_RES_TYPE_EOL,	.cnt = 0,},
-		},
-	},
-	{ /*USNIC_TRANSPORT_ROCE_CUSTOM*/
-		.resources = {
-			{.type = USNIC_VNIC_RES_TYPE_WQ,	.cnt = 1,},
-			{.type = USNIC_VNIC_RES_TYPE_RQ,	.cnt = 1,},
-			{.type = USNIC_VNIC_RES_TYPE_CQ,	.cnt = 1,},
-			{.type = USNIC_VNIC_RES_TYPE_EOL,	.cnt = 0,},
-		},
-	},
-	{ /*USNIC_TRANSPORT_IPV4_UDP*/
-		.resources = {
-			{.type = USNIC_VNIC_RES_TYPE_WQ,	.cnt = 1,},
-			{.type = USNIC_VNIC_RES_TYPE_RQ,	.cnt = 1,},
-			{.type = USNIC_VNIC_RES_TYPE_CQ,	.cnt = 1,},
-			{.type = USNIC_VNIC_RES_TYPE_EOL,	.cnt = 0,},
-		},
-	},
-};
+extern const struct usnic_vnic_res_spec min_transport_spec[USNIC_TRANSPORT_MAX];
 
 const char *usnic_ib_qp_grp_state_to_string(enum ib_qp_state state);
 int usnic_ib_qp_grp_dump_hdr(char *buf, int buf_sz);
diff --git a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
index 8372c32485ad..aa2456a4f9bd 100644
--- a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
+++ b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
@@ -51,6 +51,30 @@
 
 #define USNIC_DEFAULT_TRANSPORT USNIC_TRANSPORT_ROCE_CUSTOM
 
+const struct usnic_vnic_res_spec min_transport_spec[USNIC_TRANSPORT_MAX] = {
+	{ /*USNIC_TRANSPORT_UNKNOWN*/
+		.resources = {
+			{.type = USNIC_VNIC_RES_TYPE_EOL,	.cnt = 0,},
+		},
+	},
+	{ /*USNIC_TRANSPORT_ROCE_CUSTOM*/
+		.resources = {
+			{.type = USNIC_VNIC_RES_TYPE_WQ,	.cnt = 1,},
+			{.type = USNIC_VNIC_RES_TYPE_RQ,	.cnt = 1,},
+			{.type = USNIC_VNIC_RES_TYPE_CQ,	.cnt = 1,},
+			{.type = USNIC_VNIC_RES_TYPE_EOL,	.cnt = 0,},
+		},
+	},
+	{ /*USNIC_TRANSPORT_IPV4_UDP*/
+		.resources = {
+			{.type = USNIC_VNIC_RES_TYPE_WQ,	.cnt = 1,},
+			{.type = USNIC_VNIC_RES_TYPE_RQ,	.cnt = 1,},
+			{.type = USNIC_VNIC_RES_TYPE_CQ,	.cnt = 1,},
+			{.type = USNIC_VNIC_RES_TYPE_EOL,	.cnt = 0,},
+		},
+	},
+};
+
 static void usnic_ib_fw_string_to_u64(char *fw_ver_str, u64 *fw_ver)
 {
 	*fw_ver = *((u64 *)fw_ver_str);
-- 
2.14.2

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

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

* RE: [PATCH 03/47] RDMA/cma: Avoid triggering undefined behavior
       [not found]     ` <20171006213333.6721-4-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-06 22:01       ` Hefty, Sean
  0 siblings, 0 replies; 105+ messages in thread
From: Hefty, Sean @ 2017-10-06 22:01 UTC (permalink / raw)
  To: Bart Van Assche, Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> According to the C standard the behavior of computations with integer
> operands is as follows:
> * A computation involving unsigned operands can never overflow,
>   because a result that cannot be represented by the resulting
>   unsigned integer type is reduced modulo the number that is one
>   greater than the largest value that can be represented by the
>   resulting type.
> * The behavior for signed integer underflow and overflow is
>   undefined.
> 
> Hence only use unsigned integers when checking for integer overflow.
> 
> This patch is what I came up with after having analyzed the following
> smatch warnings:
> 
> drivers/infiniband/core/cma.c:3448: cma_resolve_ib_udp() warn: signed
> overflow undefined. 'offset + conn_param->private_data_len <
> conn_param->private_data_len'
> drivers/infiniband/core/cma.c:3505: cma_connect_ib() warn: signed
> overflow undefined. 'offset + conn_param->private_data_len <
> conn_param->private_data_len'
> 
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>


Acked-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>


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

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

* RE: [PATCH 02/47] IB/cm: Suppress gcc 7 fall-through complaints
       [not found]     ` <20171006213333.6721-3-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-06 22:03       ` Hefty, Sean
  2017-10-10 19:27       ` Dennis Dalessandro
  1 sibling, 0 replies; 105+ messages in thread
From: Hefty, Sean @ 2017-10-06 22:03 UTC (permalink / raw)
  To: Bart Van Assche, Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> Avoid that gcc 7 reports the following warning when building with W=1:
> 
> warning: this statement may fall through [-Wimplicit-fallthrough=]
> 
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>

Acked-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH 04/47] RDMA/iwcm: Remove a set-but-not-used variable
       [not found]     ` <20171006213333.6721-5-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-06 22:05       ` Steve Wise
  0 siblings, 0 replies; 105+ messages in thread
From: Steve Wise @ 2017-10-06 22:05 UTC (permalink / raw)
  To: 'Bart Van Assche', 'Doug Ledford'
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> Subject: [PATCH 04/47] RDMA/iwcm: Remove a set-but-not-used variable
> 
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>

Looks fine.

Reviewed-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>


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

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

* RE: [PATCH 09/47] RDMA/cxgb3: Annotate locking assumptions
       [not found]     ` <20171006213333.6721-10-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-06 22:05       ` Steve Wise
  0 siblings, 0 replies; 105+ messages in thread
From: Steve Wise @ 2017-10-06 22:05 UTC (permalink / raw)
  To: 'Bart Van Assche', 'Doug Ledford'
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> Subject: [PATCH 09/47] RDMA/cxgb3: Annotate locking assumptions
> 
> Tell sparse what the locking assumptions are for __flush_qp() such
> that it does not complain about the locking operations inside that
> function.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>

Looks ok to me.

Reviewed-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>


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

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

* RE: [PATCH 11/47] RDMA/cxgb3: Remove a set-but-not-used variable
       [not found]     ` <20171006213333.6721-12-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-06 22:06       ` Steve Wise
  0 siblings, 0 replies; 105+ messages in thread
From: Steve Wise @ 2017-10-06 22:06 UTC (permalink / raw)
  To: 'Bart Van Assche', 'Doug Ledford'
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> Subject: [PATCH 11/47] RDMA/cxgb3: Remove a set-but-not-used variable
> 
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>

Looks fine.

Reviewed-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>

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

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

* RE: [PATCH 10/47] RDMA/cxgb3: Annotate an RCU pointer
       [not found]     ` <20171006213333.6721-11-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-06 22:06       ` Steve Wise
  0 siblings, 0 replies; 105+ messages in thread
From: Steve Wise @ 2017-10-06 22:06 UTC (permalink / raw)
  To: 'Bart Van Assche', 'Doug Ledford'
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA



> Subject: [PATCH 10/47] RDMA/cxgb3: Annotate an RCU pointer
> 
> Annotate t3cdev.l2opt with __rcu since it is used as an RCU pointer.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>

Looks ok.

Reviewed-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>


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

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

* RE: [PATCH 15/47] RDMA/cxgb4: Remove a set-but-not-used variable
       [not found]     ` <20171006213333.6721-16-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-06 22:07       ` Steve Wise
  0 siblings, 0 replies; 105+ messages in thread
From: Steve Wise @ 2017-10-06 22:07 UTC (permalink / raw)
  To: 'Bart Van Assche', 'Doug Ledford'
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> Subject: [PATCH 15/47] RDMA/cxgb4: Remove a set-but-not-used variable
> 
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>

Looks fine.

Reviewed-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>



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

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

* RE: [PATCH 14/47] RDMA/cxgb4: Suppress gcc 7 fall-through complaints
       [not found]     ` <20171006213333.6721-15-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-06 22:08       ` Steve Wise
  0 siblings, 0 replies; 105+ messages in thread
From: Steve Wise @ 2017-10-06 22:08 UTC (permalink / raw)
  To: 'Bart Van Assche', 'Doug Ledford'
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> Subject: [PATCH 14/47] RDMA/cxgb4: Suppress gcc 7 fall-through complaints
> 
> Avoid that gcc 7 reports the following warning when building with W=1:
> 
> warning: this statement may fall through [-Wimplicit-fallthrough=]
> 
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>


Reviewed-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>


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

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

* RE: [PATCH 13/47] RDMA/cxgb4: Declare a local variable 'static'
       [not found]     ` <20171006213333.6721-14-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-06 22:09       ` Steve Wise
  2017-10-09 23:20         ` Bart Van Assche
  0 siblings, 1 reply; 105+ messages in thread
From: Steve Wise @ 2017-10-06 22:09 UTC (permalink / raw)
  To: 'Bart Van Assche', 'Doug Ledford'
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> 
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
> ---
>  drivers/infiniband/hw/cxgb4/cm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/cxgb4/cm.c
b/drivers/infiniband/hw/cxgb4/cm.c
> index 2331e7d57704..49d9f9b870e5 100644
> --- a/drivers/infiniband/hw/cxgb4/cm.c
> +++ b/drivers/infiniband/hw/cxgb4/cm.c
> @@ -99,7 +99,7 @@ module_param(enable_tcp_window_scaling, int, 0644);
>  MODULE_PARM_DESC(enable_tcp_window_scaling,
>  		 "Enable tcp window scaling (default=1)");
> 
> -int c4iw_debug;
> +static int c4iw_debug;
>  module_param(c4iw_debug, int, 0644);
>  MODULE_PARM_DESC(c4iw_debug, "obsolete");

Can we just remove this now?  IE has it been 1 release since it was obsoleted?

Reviewed-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>


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

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

* RE: [PATCH 12/47] RDMA/cxgb4: Fix indentation
       [not found]     ` <20171006213333.6721-13-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-06 22:10       ` Steve Wise
  0 siblings, 0 replies; 105+ messages in thread
From: Steve Wise @ 2017-10-06 22:10 UTC (permalink / raw)
  To: 'Bart Van Assche', 'Doug Ledford'
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> 
> This patch avoids that smatch reports the following:
> 
> drivers/infiniband/hw/cxgb4/device.c:1105: copy_gl_to_skb_pkt() warn:
> inconsistent indenting
> drivers/infiniband/hw/cxgb4/cm.c:835: send_connect() warn: inconsistent
indenting
> drivers/infiniband/hw/cxgb4/cm.c:841: send_connect() warn: inconsistent
indenting
> drivers/infiniband/hw/cxgb4/cm.c:888: send_connect() warn: inconsistent
indenting
> drivers/infiniband/hw/cxgb4/cm.c:894: send_connect() warn: inconsistent
indenting
> 
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>

Reviewed-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>


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

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

* Re: [PATCH 25/47] IB/mlx4: Suppress gcc 7 fall-through complaints
       [not found]     ` <20171006213333.6721-26-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-08  7:50       ` Leon Romanovsky
  0 siblings, 0 replies; 105+ messages in thread
From: Leon Romanovsky @ 2017-10-08  7:50 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 577 bytes --]

On Fri, Oct 06, 2017 at 02:33:11PM -0700, Bart Van Assche wrote:
> Avoid that gcc 7 reports the following warning when building with W=1:
>
> warning: this statement may fall through [-Wimplicit-fallthrough=]
>
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/infiniband/hw/mlx4/cq.c  | 2 ++
>  drivers/infiniband/hw/mlx4/mcg.c | 1 +
>  2 files changed, 3 insertions(+)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 27/47] IB/mlx5: Remove a set-but-not-used variable
       [not found]     ` <20171006213333.6721-28-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-08  7:55       ` Leon Romanovsky
  0 siblings, 0 replies; 105+ messages in thread
From: Leon Romanovsky @ 2017-10-08  7:55 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 500 bytes --]

On Fri, Oct 06, 2017 at 02:33:13PM -0700, Bart Van Assche wrote:
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/infiniband/hw/mlx5/qp.c | 2 --
>  1 file changed, 2 deletions(-)
>

Thanks,
The "inl" variable was removed in commit: 5fe9dec0d045 ("IB/mlx5: Use blue flame register allocator in mlx5_ib")

Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 26/47] IB/mlx5: Suppress gcc 7 fall-through complaints
       [not found]     ` <20171006213333.6721-27-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-08  7:55       ` Leon Romanovsky
  0 siblings, 0 replies; 105+ messages in thread
From: Leon Romanovsky @ 2017-10-08  7:55 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 575 bytes --]

On Fri, Oct 06, 2017 at 02:33:12PM -0700, Bart Van Assche wrote:
> Avoid that gcc 7 reports the following warning when building with W=1:
>
> warning: this statement may fall through [-Wimplicit-fallthrough=]
>
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/infiniband/hw/mlx5/cq.c | 2 ++
>  drivers/infiniband/hw/mlx5/qp.c | 1 +
>  2 files changed, 3 insertions(+)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 19/47] IB/hns: Annotate iomem pointers correctly
       [not found]     ` <20171006213333.6721-20-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-08 13:42       ` Leon Romanovsky
       [not found]         ` <20171008134219.GB25829-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Leon Romanovsky @ 2017-10-08 13:42 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	Signed-off-by : Lijun Ou, Wei Hu, Shaobo Xu

[-- Attachment #1: Type: text/plain, Size: 491 bytes --]

On Fri, Oct 06, 2017 at 02:33:05PM -0700, Bart Van Assche wrote:
> This patch avoids that sparse complains that there is an address
> space mismatch.
>
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

Something went wrong here.

> Cc: Wei Hu (Xavier) <xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> Cc: Shaobo Xu <xushaobo2-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 20/47] IB/hns: Declare local functions 'static'
       [not found]     ` <20171006213333.6721-21-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-08 13:44       ` Leon Romanovsky
  0 siblings, 0 replies; 105+ messages in thread
From: Leon Romanovsky @ 2017-10-08 13:44 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	Signed-off-by : Lijun Ou, Wei Hu, Shaobo Xu

[-- Attachment #1: Type: text/plain, Size: 406 bytes --]

On Fri, Oct 06, 2017 at 02:33:06PM -0700, Bart Van Assche wrote:
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

^^^^^^^^^^ something wrong.


> Cc: Wei Hu (Xavier) <xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> Cc: Shaobo Xu <xushaobo2-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 44/47] RDMA/rxe: Suppress gcc 7 fall-through complaints
       [not found]     ` <20171006213333.6721-45-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-08 13:45       ` Leon Romanovsky
  0 siblings, 0 replies; 105+ messages in thread
From: Leon Romanovsky @ 2017-10-08 13:45 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Moni Shoua

[-- Attachment #1: Type: text/plain, Size: 647 bytes --]

On Fri, Oct 06, 2017 at 02:33:30PM -0700, Bart Van Assche wrote:
> Avoid that gcc 7 reports the following warning when building with W=1:
>
> warning: this statement may fall through [-Wimplicit-fallthrough=]
>
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/infiniband/sw/rxe/rxe_comp.c  | 4 ++--
>  drivers/infiniband/sw/rxe/rxe_task.c  | 2 +-
>  drivers/infiniband/sw/rxe/rxe_verbs.c | 1 +
>  3 files changed, 4 insertions(+), 3 deletions(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 01/47] IB/core: Fix endianness annotation in rdma_is_multicast_addr()
       [not found]     ` <20171006213333.6721-2-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-08 13:50       ` Leon Romanovsky
  0 siblings, 0 replies; 105+ messages in thread
From: Leon Romanovsky @ 2017-10-08 13:50 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 473 bytes --]

On Fri, Oct 06, 2017 at 02:32:47PM -0700, Bart Van Assche wrote:
> Since ipv4_addr is a big endian 32-bit number, annotate it as such.
>
> Fixes: commit be1d325a3358 ("IB/core: Set RoCEv2 MGID according to spec")
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> ---
>  include/rdma/ib_addr.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 05/47] RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing
       [not found]     ` <20171006213333.6721-6-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-09  7:40       ` Matan Barak (External)
       [not found]         ` <64b5f415-7d56-3f17-0c8c-5d80ba89582c-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Matan Barak (External) @ 2017-10-09  7:40 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Yishai Hadas, Doug Ledford

On 07/10/2017 00:32, Bart Van Assche wrote:
> This patch reduces the number of #ifdefs and also avoids that
> smatch reports the following:
>
> drivers/infiniband/core/uverbs_ioctl.c:276: ib_uverbs_cmd_verbs() warn: if statement not indented
> drivers/infiniband/core/uverbs_ioctl.c:280: ib_uverbs_cmd_verbs() warn: possible memory leak of 'ctx'
> drivers/infiniband/core/uverbs_ioctl.c:315: ib_uverbs_cmd_verbs() warn: if statement not indented
>
> References: commit fac9658cabb9 ("IB/core: Add new ioctl interface")
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Cc: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>   drivers/infiniband/core/uverbs_ioctl.c | 20 +++++++++-----------
>   1 file changed, 9 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c
> index 5286ad57d903..53f780ea49fe 100644
> --- a/drivers/infiniband/core/uverbs_ioctl.c
> +++ b/drivers/infiniband/core/uverbs_ioctl.c
> @@ -234,7 +234,7 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
>       const struct uverbs_method_spec *method_spec;
>       long err = 0;
>       unsigned int i;
> -    struct {
> +    struct attr_and_bundle {
>           struct ib_uverbs_attr        *uattrs;
>           struct uverbs_attr_bundle    *uverbs_attr_bundle;
>       } *ctx = NULL;
> @@ -242,7 +242,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
>       unsigned long *curr_bitmap;
>       size_t ctx_size;
>   #ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
> -    uintptr_t data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)];
> +    uintptr_t __data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)];
> +    struct attr_and_bundle *const data = (void *)__data;
> +#else
> +    struct attr_and_bundle *const data = NULL;
>   #endif
>
>       if (hdr->reserved)
> @@ -269,13 +272,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
>               (method_spec->num_child_attrs / BITS_PER_LONG +
>                method_spec->num_buckets);
>
> -#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
>       if (ctx_size <= UVERBS_OPTIMIZE_USING_STACK_SZ)

If UVERBS_OPTIMIZE_USING_STACK_SZ isn't defined, you'll get an error here.
Maybe we could define it as 0 in the else part of the local variables deceleration.

> -        ctx = (void *)data;
> -
> +        ctx = data;
>       if (!ctx)
> -#endif
> -    ctx = kmalloc(ctx_size, GFP_KERNEL);
> +        ctx = kmalloc(ctx_size, GFP_KERNEL);
>       if (!ctx)
>           return -ENOMEM;
>
> @@ -311,10 +311,8 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
>       err = uverbs_handle_method(buf, ctx->uattrs, hdr->num_attrs, ib_dev,
>                      file, method_spec, ctx->uverbs_attr_bundle);
>   out:
> -#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
> -    if (ctx_size > UVERBS_OPTIMIZE_USING_STACK_SZ)
> -#endif
> -    kfree(ctx);
> +    if (ctx != data)
> +        kfree(ctx);
>       return err;
>   }
>
>

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

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

* Re: [PATCH 00/47] Address issues detected by static analysis tools
       [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
                     ` (46 preceding siblings ...)
  2017-10-06 21:33   ` [PATCH 47/47] RDMA/usnic: Instantiate data structures once Bart Van Assche
@ 2017-10-09 16:51   ` Doug Ledford
       [not found]     ` <1507567892.46071.44.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  47 siblings, 1 reply; 105+ messages in thread
From: Doug Ledford @ 2017-10-09 16:51 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Fri, 2017-10-06 at 14:32 -0700, Bart Van Assche wrote:
> Hello Doug,
> 
> As we all know there are several static analysis tools available for
> the Linux
> kernel and these tools are valuable. I'm referring to increasing the
> gcc
> warning level (W=1), sparse and smatch. It is helpful to analyze new
> code with
> these tools before submitting a patch. These tools are most useful if
> existing
> code is clean. Hence this patch series that significantly reduces the
> number
> of complaints reported by static analysis tools. Please consider this
> patch
> series for kernel v4.15.

The series looks pretty good Bart.  I'd like some Intel eyes on the
hfi1 changes, and I'd like some people to report back that the rcu
changes in their code are good, and the Cc: Signed-off-by: mistakes in
the hns_roce parts needs fixed.  Then I'll be ready to take it.  Thanks
for all the work here.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

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

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

* Re: [PATCH 19/47] IB/hns: Annotate iomem pointers correctly
       [not found]         ` <20171008134219.GB25829-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
@ 2017-10-09 17:10           ` Bart Van Assche
  0 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-09 17:10 UTC (permalink / raw)
  To: leon-DgEjT+Ai2ygdnm+yROfE0A
  Cc: xavier.huwei-hv44wF8Li93QT0dZR+AlfA,
	xushaobo2-hv44wF8Li93QT0dZR+AlfA, oulijun-hv44wF8Li93QT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	dledford-H+wXaHxf7aLQT0dZR+AlfA

On Sun, 2017-10-08 at 16:42 +0300, Leon Romanovsky wrote:
> On Fri, Oct 06, 2017 at 02:33:05PM -0700, Bart Van Assche wrote:
> > This patch avoids that sparse complains that there is an address
> > space mismatch.
> > 
> > Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> > Cc: Signed-off-by: Lijun Ou <oulijun@huawei.com>
> 
> Something went wrong here.

Hello Leon,

Thanks for having reported this. I will fix the Cc-list.

Bart.

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

* Re: [PATCH 05/47] RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing
       [not found]         ` <64b5f415-7d56-3f17-0c8c-5d80ba89582c-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2017-10-09 17:27           ` Bart Van Assche
       [not found]             ` <1507570048.2674.17.camel-Sjgp3cTcYWE@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-09 17:27 UTC (permalink / raw)
  To: matanb-VPRAkNaXOzVWk0Htik3J/w
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	yishaih-VPRAkNaXOzVWk0Htik3J/w, dledford-H+wXaHxf7aLQT0dZR+AlfA

On Mon, 2017-10-09 at 10:40 +0300, Matan Barak (External) wrote:
> On 07/10/2017 00:32, Bart Van Assche wrote:
> > This patch reduces the number of #ifdefs and also avoids that
> > smatch reports the following:
> > 
> > drivers/infiniband/core/uverbs_ioctl.c:276: ib_uverbs_cmd_verbs() warn: if statement not indented
> > drivers/infiniband/core/uverbs_ioctl.c:280: ib_uverbs_cmd_verbs() warn: possible memory leak of 'ctx'
> > drivers/infiniband/core/uverbs_ioctl.c:315: ib_uverbs_cmd_verbs() warn: if statement not indented
> > 
> > References: commit fac9658cabb9 ("IB/core: Add new ioctl interface")
> > Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> > Cc: Matan Barak <matanb@mellanox.com>
> > Cc: Yishai Hadas <yishaih@mellanox.com>
> > ---
> >   drivers/infiniband/core/uverbs_ioctl.c | 20 +++++++++-----------
> >   1 file changed, 9 insertions(+), 11 deletions(-)
> > 
> > diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c
> > index 5286ad57d903..53f780ea49fe 100644
> > --- a/drivers/infiniband/core/uverbs_ioctl.c
> > +++ b/drivers/infiniband/core/uverbs_ioctl.c
> > @@ -234,7 +234,7 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
> >       const struct uverbs_method_spec *method_spec;
> >       long err = 0;
> >       unsigned int i;
> > -    struct {
> > +    struct attr_and_bundle {
> >           struct ib_uverbs_attr        *uattrs;
> >           struct uverbs_attr_bundle    *uverbs_attr_bundle;
> >       } *ctx = NULL;
> > @@ -242,7 +242,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
> >       unsigned long *curr_bitmap;
> >       size_t ctx_size;
> >   #ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
> > -    uintptr_t data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)];
> > +    uintptr_t __data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)];
> > +    struct attr_and_bundle *const data = (void *)__data;
> > +#else
> > +    struct attr_and_bundle *const data = NULL;
> >   #endif
> > 
> >       if (hdr->reserved)
> > @@ -269,13 +272,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
> >               (method_spec->num_child_attrs / BITS_PER_LONG +
> >                method_spec->num_buckets);
> > 
> > -#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
> >       if (ctx_size <= UVERBS_OPTIMIZE_USING_STACK_SZ)
> 
> If UVERBS_OPTIMIZE_USING_STACK_SZ isn't defined, you'll get an error here.
> Maybe we could define it as 0 in the else part of the local variables deceleration.

Hello Matan,

That's an interesting suggestion but that wouldn't work well with the "#ifdef
UVERBS_OPTIMIZE_USING_STACK_SZ" code in the declaration section. How about
changing "if (ctx_size <= UVERBS_OPTIMIZE_USING_STACK_SZ) ctx = data;" into
"ctx = data;" such that it becomes again safe not to define UVERBS_OPTIMIZE_USING_STACK_SZ?
With that change this patch looks as follows:


diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c
index 5286ad57d903..81c05ba2a58b 100644
--- a/drivers/infiniband/core/uverbs_ioctl.c
+++ b/drivers/infiniband/core/uverbs_ioctl.c
@@ -234,7 +234,7 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
 	const struct uverbs_method_spec *method_spec;
 	long err = 0;
 	unsigned int i;
-	struct {
+	struct attr_and_bundle {
 		struct ib_uverbs_attr		*uattrs;
 		struct uverbs_attr_bundle	*uverbs_attr_bundle;
 	} *ctx = NULL;
@@ -242,7 +242,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
 	unsigned long *curr_bitmap;
 	size_t ctx_size;
 #ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
-	uintptr_t data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)];
+	uintptr_t __data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)];
+	struct attr_and_bundle *const data = (void *)__data;
+#else
+	struct attr_and_bundle *const data = NULL;
 #endif
 
 	if (hdr->reserved)
@@ -269,13 +272,9 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
 			(method_spec->num_child_attrs / BITS_PER_LONG +
 			 method_spec->num_buckets);
 
-#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
-	if (ctx_size <= UVERBS_OPTIMIZE_USING_STACK_SZ)
-		ctx = (void *)data;
-
+	ctx = data;
 	if (!ctx)
-#endif
-	ctx = kmalloc(ctx_size, GFP_KERNEL);
+		ctx = kmalloc(ctx_size, GFP_KERNEL);
 	if (!ctx)
 		return -ENOMEM;
 
@@ -311,10 +310,8 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
 	err = uverbs_handle_method(buf, ctx->uattrs, hdr->num_attrs, ib_dev,
 				   file, method_spec, ctx->uverbs_attr_bundle);
 out:
-#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
-	if (ctx_size > UVERBS_OPTIMIZE_USING_STACK_SZ)
-#endif
-	kfree(ctx);
+	if (ctx != data)
+		kfree(ctx);
 	return err;
 }
 

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

* Re: [PATCH 21/47] RDMA/i40iw: Fix a race condition
       [not found]     ` <20171006213333.6721-22-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-09 22:04       ` Shiraz Saleem
  0 siblings, 0 replies; 105+ messages in thread
From: Shiraz Saleem @ 2017-10-09 22:04 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Fri, Oct 06, 2017 at 02:33:07PM -0700, Bart Van Assche wrote:
> Use the proper primitives to dereference the RCU pointer
> upper_dev->ip_ptr. Compile-tested only.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Shiraz Saleem <shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Thank you for this patch. Looks fine.

Reviewed-by: Shiraz Saleem <shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 22/47] RDMA/i40iw: Suppress gcc 7 fall-through complaints
       [not found]     ` <20171006213333.6721-23-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-09 22:04       ` Shiraz Saleem
  0 siblings, 0 replies; 105+ messages in thread
From: Shiraz Saleem @ 2017-10-09 22:04 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Fri, Oct 06, 2017 at 02:33:08PM -0700, Bart Van Assche wrote:
> Avoid that gcc 7 reports the following warning when building with W=1:
> 
> warning: this statement may fall through [-Wimplicit-fallthrough=]
> 
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Shiraz Saleem <shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---

Reviewed-by: Shiraz Saleem <shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 23/47] RDMA/i40iw: Remove a set-but-not-used variable
       [not found]     ` <20171006213333.6721-24-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-09 22:05       ` Shiraz Saleem
  0 siblings, 0 replies; 105+ messages in thread
From: Shiraz Saleem @ 2017-10-09 22:05 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Fri, Oct 06, 2017 at 02:33:09PM -0700, Bart Van Assche wrote:
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Shiraz Saleem <shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---

Reviewed-by: Shiraz Saleem <shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 13/47] RDMA/cxgb4: Declare a local variable 'static'
  2017-10-06 22:09       ` Steve Wise
@ 2017-10-09 23:20         ` Bart Van Assche
       [not found]           ` <1507591219.2674.58.camel-Sjgp3cTcYWE@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-09 23:20 UTC (permalink / raw)
  To: swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW, dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Fri, 2017-10-06 at 17:09 -0500, Steve Wise wrote:
> > 
> > Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> > Cc: Steve Wise <swise@opengridcomputing.com>
> > ---
> >  drivers/infiniband/hw/cxgb4/cm.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/infiniband/hw/cxgb4/cm.c
> 
> b/drivers/infiniband/hw/cxgb4/cm.c
> > index 2331e7d57704..49d9f9b870e5 100644
> > --- a/drivers/infiniband/hw/cxgb4/cm.c
> > +++ b/drivers/infiniband/hw/cxgb4/cm.c
> > @@ -99,7 +99,7 @@ module_param(enable_tcp_window_scaling, int, 0644);
> >  MODULE_PARM_DESC(enable_tcp_window_scaling,
> >  		 "Enable tcp window scaling (default=1)");
> > 
> > -int c4iw_debug;
> > +static int c4iw_debug;
> >  module_param(c4iw_debug, int, 0644);
> >  MODULE_PARM_DESC(c4iw_debug, "obsolete");
> 
> Can we just remove this now?  IE has it been 1 release since it was obsoleted?

That's a good question but I'm not sure what would be a good time to remove
this. I think the answer depends on how likely it is that people use this
variable in scripts or /etc/modprobe.d configuration files because in that
case removing the module parameter would break setups.

Bart.

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

* Re: [PATCH 13/47] RDMA/cxgb4: Declare a local variable 'static'
       [not found]           ` <1507591219.2674.58.camel-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-10  3:59             ` Leon Romanovsky
       [not found]               ` <20171010035909.GI1252-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Leon Romanovsky @ 2017-10-10  3:59 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW,
	dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1917 bytes --]

On Mon, Oct 09, 2017 at 11:20:20PM +0000, Bart Van Assche wrote:
> On Fri, 2017-10-06 at 17:09 -0500, Steve Wise wrote:
> > >
> > > Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> > > Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
> > > ---
> > >  drivers/infiniband/hw/cxgb4/cm.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/infiniband/hw/cxgb4/cm.c
> >
> > b/drivers/infiniband/hw/cxgb4/cm.c
> > > index 2331e7d57704..49d9f9b870e5 100644
> > > --- a/drivers/infiniband/hw/cxgb4/cm.c
> > > +++ b/drivers/infiniband/hw/cxgb4/cm.c
> > > @@ -99,7 +99,7 @@ module_param(enable_tcp_window_scaling, int, 0644);
> > >  MODULE_PARM_DESC(enable_tcp_window_scaling,
> > >  		 "Enable tcp window scaling (default=1)");
> > >
> > > -int c4iw_debug;
> > > +static int c4iw_debug;
> > >  module_param(c4iw_debug, int, 0644);
> > >  MODULE_PARM_DESC(c4iw_debug, "obsolete");
> >
> > Can we just remove this now?  IE has it been 1 release since it was obsoleted?
>
> That's a good question but I'm not sure what would be a good time to remove
> this. I think the answer depends on how likely it is that people use this
> variable in scripts or /etc/modprobe.d configuration files because in that
> case removing the module parameter would break setups.

It is unlikely to happen, for many reasons. It is marked as obsolete for
a long time, the proper infrastructure (dynamic prints) already for a decade
with us and no adequate user is running debug system in production.

Another thing that we do remove visible to user interfaces from time to time
and the rule is "try to remove it and see if someone screams about it".

There are a lot of commits which do such thing and latest one is 0d0c71b31720
("btrfs: obsolete and remove mount option alloc_start")

It is safe to remove c4iw_debug module parameter.

Thanks

>
> Bart.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* RE: [PATCH 41/47] IB/qib: Suppress gcc 7 fall-through complaints
       [not found]     ` <20171006213333.6721-42-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-10 13:56       ` Marciniszyn, Mike
       [not found]         ` <32E1700B9017364D9B60AED9960492BC3442AA1D-RjuIdWtd+YbTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Marciniszyn, Mike @ 2017-10-10 13:56 UTC (permalink / raw)
  To: Bart Van Assche, Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> Subject: [PATCH 41/47] IB/qib: Suppress gcc 7 fall-through complaints
> 
> Avoid that gcc 7 reports the following warning when building with W=1:
> 
> warning: this statement may fall through [-Wimplicit-fallthrough=]
> 

Bart,

I'm ok with this but...

I'm curious if there is a documentation change in the kernel on a common tree wide approach for gcc 7.

I saw a patch to add the attribute based method of getting rid of the warning, but it doesn't appear to have been merged.

This error probably runs through all of our drivers.

Acked-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use
       [not found]     ` <20171006213333.6721-41-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-10 14:15       ` Marciniszyn, Mike
       [not found]         ` <32E1700B9017364D9B60AED9960492BC3442AAD2-RjuIdWtd+YbTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Marciniszyn, Mike @ 2017-10-10 14:15 UTC (permalink / raw)
  To: Bart Van Assche, Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> Subject: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe
> to use
> 
> Avoid that using the qib_inc_eeprom_err() macro in an if-statement
> triggers the following compiler warning:
> 
> warning: suggest braces around empty body in an 'if' statement [-Wempty-
> body]
> 

There needs to be a follow-on patch here to get rid of the uses of this macro.

The original fix got rid of a bad implementation, but should have totally removed both the function and its use.

The is not the fault of this patch.

Fixes: 18c0b82a3e45  (" IB/qib: Do not write EEPROM")
Acked-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 41/47] IB/qib: Suppress gcc 7 fall-through complaints
       [not found]         ` <32E1700B9017364D9B60AED9960492BC3442AA1D-RjuIdWtd+YbTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2017-10-10 15:07           ` Bart Van Assche
  0 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-10 15:07 UTC (permalink / raw)
  To: mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w, dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Tue, 2017-10-10 at 13:56 +0000, Marciniszyn, Mike wrote:
> > Subject: [PATCH 41/47] IB/qib: Suppress gcc 7 fall-through complaints
> > 
> > Avoid that gcc 7 reports the following warning when building with W=1:
> > 
> > warning: this statement may fall through [-Wimplicit-fallthrough=]
> 
> I'm ok with this but...
> 
> I'm curious if there is a documentation change in the kernel on a common
> tree wide approach for gcc 7.
> 
> I saw a patch to add the attribute based method of getting rid of the warning,
> but it doesn't appear to have been merged.
> 
> This error probably runs through all of our drivers.
> 
> Acked-by: Mike Marciniszyn <mike.marciniszyn@intel.com>

Hello Mike,

Thanks for the review. Regarding the tree-wide approach: there has already
been a discussion about this on various kernel-related mailing lists. See
also Linus Torvalds, Lots of new warnings with gcc-7.1.1, July 11, 2017
(https://www.mail-archive.com/netdev@vger.kernel.org/msg177459.html). The
conclusion was that certain of these warnings should be suppressed but that
other warnings are useful and should be retained. See also commit
bd664f6b3e37 ("disable new gcc-7.1.1 warnings for now").

Bart.

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

* Re: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use
       [not found]         ` <32E1700B9017364D9B60AED9960492BC3442AAD2-RjuIdWtd+YbTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2017-10-10 15:08           ` Bart Van Assche
       [not found]             ` <1507648081.2815.5.camel-Sjgp3cTcYWE@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-10 15:08 UTC (permalink / raw)
  To: mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w, dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Tue, 2017-10-10 at 14:15 +0000, Marciniszyn, Mike wrote:
> > Subject: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe
> > to use
> > 
> > Avoid that using the qib_inc_eeprom_err() macro in an if-statement
> > triggers the following compiler warning:
> > 
> > warning: suggest braces around empty body in an 'if' statement [-Wempty-
> > body]
> > 
> 
> There needs to be a follow-on patch here to get rid of the uses of this macro.
> 
> The original fix got rid of a bad implementation, but should have totally
> removed both the function and its use.
> 
> The is not the fault of this patch.
> 
> Fixes: 18c0b82a3e45  (" IB/qib: Do not write EEPROM")
> Acked-by: Mike Marciniszyn <mike.marciniszyn@intel.com>

Hello Mike,

How about dropping this patch and replacing it with a patch that removes all uses
of qib_inc_eeprom_err()?

Thanks,

Bart.

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

* RE: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use
       [not found]             ` <1507648081.2815.5.camel-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-10 15:36               ` Marciniszyn, Mike
       [not found]                 ` <32E1700B9017364D9B60AED9960492BC3442ADF5-RjuIdWtd+YbTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Marciniszyn, Mike @ 2017-10-10 15:36 UTC (permalink / raw)
  To: Bart Van Assche, dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> 
> Hello Mike,
> 
> How about dropping this patch and replacing it with a patch that removes all
> uses
> of qib_inc_eeprom_err()?
> 

I'm fine with that too.

Mike

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

* Re: [PATCH 13/47] RDMA/cxgb4: Declare a local variable 'static'
       [not found]               ` <20171010035909.GI1252-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
@ 2017-10-10 16:16                 ` Bart Van Assche
  0 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-10 16:16 UTC (permalink / raw)
  To: leon-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW,
	dledford-H+wXaHxf7aLQT0dZR+AlfA

On Tue, 2017-10-10 at 06:59 +0300, Leon Romanovsky wrote:
> On Mon, Oct 09, 2017 at 11:20:20PM +0000, Bart Van Assche wrote:
> > On Fri, 2017-10-06 at 17:09 -0500, Steve Wise wrote:
> > > Can we just remove this now?  IE has it been 1 release since it was obsoleted?
> > 
> > That's a good question but I'm not sure what would be a good time to remove
> > this. I think the answer depends on how likely it is that people use this
> > variable in scripts or /etc/modprobe.d configuration files because in that
> > case removing the module parameter would break setups.
> 
> It is unlikely to happen, for many reasons. It is marked as obsolete for
> a long time, the proper infrastructure (dynamic prints) already for a decade
> with us and no adequate user is running debug system in production.
> 
> Another thing that we do remove visible to user interfaces from time to time
> and the rule is "try to remove it and see if someone screams about it".
> 
> There are a lot of commits which do such thing and latest one is 0d0c71b31720
> ("btrfs: obsolete and remove mount option alloc_start")
> 
> It is safe to remove c4iw_debug module parameter.

OK, I will remove that module parameter.

Bart.

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

* Re: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use
       [not found]                 ` <32E1700B9017364D9B60AED9960492BC3442ADF5-RjuIdWtd+YbTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2017-10-10 17:59                   ` Bart Van Assche
       [not found]                     ` <1507658390.2815.48.camel-Sjgp3cTcYWE@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-10 17:59 UTC (permalink / raw)
  To: mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w, dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 5893 bytes --]

On Tue, 2017-10-10 at 15:36 +0000, Marciniszyn, Mike wrote:
> Bart wrote:
> > How about dropping this patch and replacing it with a patch that removes all
> > uses of qib_inc_eeprom_err()?
> 
> I'm fine with that too.

How about the patch below?

Thanks,

Bart.


Subject: [PATCH] IB/qib: Remove the qib_inc_eeprom_err() macro

Since the body of the qib_inc_eeprom_err() macro is empty, remove
the invocations of this macro.

References: commit 18c0b82a3e45 (" IB/qib: Do not write EEPROM")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Mike Marciniszyn <infinipath@intel.com>
---
 drivers/infiniband/hw/qib/qib.h         |  1 -
 drivers/infiniband/hw/qib/qib_iba6120.c | 11 -----------
 drivers/infiniband/hw/qib/qib_iba7220.c | 10 ----------
 drivers/infiniband/hw/qib/qib_iba7322.c |  6 +-----
 4 files changed, 1 insertion(+), 27 deletions(-)

diff --git a/drivers/infiniband/hw/qib/qib.h b/drivers/infiniband/hw/qib/qib.h
index 1167a9c1776b..1869fce0ba00 100644
--- a/drivers/infiniband/hw/qib/qib.h
+++ b/drivers/infiniband/hw/qib/qib.h
@@ -1297,7 +1297,6 @@ int qib_twsi_blk_rd(struct qib_devdata *dd, int dev, int addr, void *buffer,
 int qib_twsi_blk_wr(struct qib_devdata *dd, int dev, int addr,
 		    const void *buffer, int len);
 void qib_get_eeprom_info(struct qib_devdata *);
-#define qib_inc_eeprom_err(dd, eidx, incr)
 void qib_dump_lookup_output_queue(struct qib_devdata *);
 void qib_force_pio_avail_update(struct qib_devdata *);
 void qib_clear_symerror_on_linkup(unsigned long opaque);
diff --git a/drivers/infiniband/hw/qib/qib_iba6120.c b/drivers/infiniband/hw/qib/qib_iba6120.c
index c4a4c57e0f0a..e0b52bab6f34 100644
--- a/drivers/infiniband/hw/qib/qib_iba6120.c
+++ b/drivers/infiniband/hw/qib/qib_iba6120.c
@@ -748,7 +748,6 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
 	u32 bits, ctrl;
 	int isfatal = 0;
 	char *bitsmsg;
-	int log_idx;
 
 	hwerrs = qib_read_kreg64(dd, kr_hwerrstatus);
 	if (!hwerrs)
@@ -770,11 +769,6 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
 
 	hwerrs &= dd->cspec->hwerrmask;
 
-	/* We log some errors to EEPROM, check if we have any of those. */
-	for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
-		if (hwerrs & dd->eep_st_masks[log_idx].hwerrs_to_log)
-			qib_inc_eeprom_err(dd, log_idx, 1);
-
 	/*
 	 * Make sure we get this much out, unless told to be quiet,
 	 * or it's occurred within the last 5 seconds.
@@ -1004,7 +998,6 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)
 	char *msg;
 	u64 ignore_this_time = 0;
 	u64 iserr = 0;
-	int log_idx;
 	struct qib_pportdata *ppd = dd->pport;
 	u64 mask;
 
@@ -1015,10 +1008,6 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)
 	/* do these first, they are most important */
 	if (errs & ERR_MASK(HardwareErr))
 		qib_handle_6120_hwerrors(dd, msg, sizeof(dd->cspec->emsgbuf));
-	else
-		for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
-			if (errs & dd->eep_st_masks[log_idx].errs_to_log)
-				qib_inc_eeprom_err(dd, log_idx, 1);
 
 	if (errs & ~IB_E_BITSEXTANT)
 		qib_dev_err(dd,
diff --git a/drivers/infiniband/hw/qib/qib_iba7220.c b/drivers/infiniband/hw/qib/qib_iba7220.c
index 78ce79be4120..75f2cfd0d272 100644
--- a/drivers/infiniband/hw/qib/qib_iba7220.c
+++ b/drivers/infiniband/hw/qib/qib_iba7220.c
@@ -1094,7 +1094,6 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)
 	char *msg;
 	u64 ignore_this_time = 0;
 	u64 iserr = 0;
-	int log_idx;
 	struct qib_pportdata *ppd = dd->pport;
 	u64 mask;
 
@@ -1105,10 +1104,6 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)
 	/* do these first, they are most important */
 	if (errs & ERR_MASK(HardwareErr))
 		qib_7220_handle_hwerrors(dd, msg, sizeof(dd->cspec->emsgbuf));
-	else
-		for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
-			if (errs & dd->eep_st_masks[log_idx].errs_to_log)
-				qib_inc_eeprom_err(dd, log_idx, 1);
 
 	if (errs & QLOGIC_IB_E_SDMAERRS)
 		sdma_7220_errors(ppd, errs);
@@ -1302,7 +1297,6 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
 	u32 bits, ctrl;
 	int isfatal = 0;
 	char *bitsmsg;
-	int log_idx;
 
 	hwerrs = qib_read_kreg64(dd, kr_hwerrstatus);
 	if (!hwerrs)
@@ -1326,10 +1320,6 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
 
 	hwerrs &= dd->cspec->hwerrmask;
 
-	/* We log some errors to EEPROM, check if we have any of those. */
-	for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
-		if (hwerrs & dd->eep_st_masks[log_idx].hwerrs_to_log)
-			qib_inc_eeprom_err(dd, log_idx, 1);
 	if (hwerrs & ~(TXEMEMPARITYERR_PIOBUF | TXEMEMPARITYERR_PIOPBC |
 		       RXE_PARITY))
 		qib_devinfo(dd->pcidev,
diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c
index 4d02cffe4e03..77217fae9c06 100644
--- a/drivers/infiniband/hw/qib/qib_iba7322.c
+++ b/drivers/infiniband/hw/qib/qib_iba7322.c
@@ -1644,7 +1644,6 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)
 	u64 iserr = 0;
 	u64 errs;
 	u64 mask;
-	int log_idx;
 
 	qib_stats.sps_errints++;
 	errs = qib_read_kreg64(dd, kr_errstatus);
@@ -1662,10 +1661,7 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)
 	if (errs & QIB_E_HARDWARE) {
 		*msg = '\0';
 		qib_7322_handle_hwerrors(dd, msg, sizeof(dd->cspec->emsgbuf));
-	} else
-		for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
-			if (errs & dd->eep_st_masks[log_idx].errs_to_log)
-				qib_inc_eeprom_err(dd, log_idx, 1);
+	}
 
 	if (errs & QIB_E_SPKTERRS) {
 		qib_disarm_7322_senderrbufs(dd->pport);
N‹§²æìr¸›yúèšØb²X¬¶Ç§vØ^–)Þº{.nÇ+‰·¥Š{±­ÙšŠ{ayº\x1dʇڙë,j\a­¢f£¢·hš‹»öì\x17/oSc¾™Ú³9˜uÀ¦æå‰È&jw¨®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿïêäz¹Þ–Šàþf£¢·hšˆ§~ˆmš

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

* Re: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use
       [not found]                     ` <1507658390.2815.48.camel-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-10 18:08                       ` Leon Romanovsky
       [not found]                         ` <20171010180809.GI2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Leon Romanovsky @ 2017-10-10 18:08 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w,
	dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 6342 bytes --]

On Tue, Oct 10, 2017 at 05:59:51PM +0000, Bart Van Assche wrote:
> On Tue, 2017-10-10 at 15:36 +0000, Marciniszyn, Mike wrote:
> > Bart wrote:
> > > How about dropping this patch and replacing it with a patch that removes all
> > > uses of qib_inc_eeprom_err()?
> >
> > I'm fine with that too.
>
> How about the patch below?
>
> Thanks,
>
> Bart.
>
>
> Subject: [PATCH] IB/qib: Remove the qib_inc_eeprom_err() macro
>
> Since the body of the qib_inc_eeprom_err() macro is empty, remove
> the invocations of this macro.
>
> References: commit 18c0b82a3e45 (" IB/qib: Do not write EEPROM")
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Mike Marciniszyn <infinipath-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/infiniband/hw/qib/qib.h         |  1 -
>  drivers/infiniband/hw/qib/qib_iba6120.c | 11 -----------
>  drivers/infiniband/hw/qib/qib_iba7220.c | 10 ----------
>  drivers/infiniband/hw/qib/qib_iba7322.c |  6 +-----
>  4 files changed, 1 insertion(+), 27 deletions(-)
>
> diff --git a/drivers/infiniband/hw/qib/qib.h b/drivers/infiniband/hw/qib/qib.h
> index 1167a9c1776b..1869fce0ba00 100644
> --- a/drivers/infiniband/hw/qib/qib.h
> +++ b/drivers/infiniband/hw/qib/qib.h
> @@ -1297,7 +1297,6 @@ int qib_twsi_blk_rd(struct qib_devdata *dd, int dev, int addr, void *buffer,
>  int qib_twsi_blk_wr(struct qib_devdata *dd, int dev, int addr,
>  		    const void *buffer, int len);
>  void qib_get_eeprom_info(struct qib_devdata *);
> -#define qib_inc_eeprom_err(dd, eidx, incr)
>  void qib_dump_lookup_output_queue(struct qib_devdata *);
>  void qib_force_pio_avail_update(struct qib_devdata *);
>  void qib_clear_symerror_on_linkup(unsigned long opaque);
> diff --git a/drivers/infiniband/hw/qib/qib_iba6120.c b/drivers/infiniband/hw/qib/qib_iba6120.c
> index c4a4c57e0f0a..e0b52bab6f34 100644
> --- a/drivers/infiniband/hw/qib/qib_iba6120.c
> +++ b/drivers/infiniband/hw/qib/qib_iba6120.c
> @@ -748,7 +748,6 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
>  	u32 bits, ctrl;
>  	int isfatal = 0;
>  	char *bitsmsg;
> -	int log_idx;
>
>  	hwerrs = qib_read_kreg64(dd, kr_hwerrstatus);
>  	if (!hwerrs)
> @@ -770,11 +769,6 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
>
>  	hwerrs &= dd->cspec->hwerrmask;
>
> -	/* We log some errors to EEPROM, check if we have any of those. */
> -	for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
> -		if (hwerrs & dd->eep_st_masks[log_idx].hwerrs_to_log)

Does it mean that you can get rid of eep_st_masks and QIB_EEP_LOG_CNT too?

> -			qib_inc_eeprom_err(dd, log_idx, 1);
> -
>  	/*
>  	 * Make sure we get this much out, unless told to be quiet,
>  	 * or it's occurred within the last 5 seconds.
> @@ -1004,7 +998,6 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)
>  	char *msg;
>  	u64 ignore_this_time = 0;
>  	u64 iserr = 0;
> -	int log_idx;
>  	struct qib_pportdata *ppd = dd->pport;
>  	u64 mask;
>
> @@ -1015,10 +1008,6 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)
>  	/* do these first, they are most important */
>  	if (errs & ERR_MASK(HardwareErr))
>  		qib_handle_6120_hwerrors(dd, msg, sizeof(dd->cspec->emsgbuf));
> -	else
> -		for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
> -			if (errs & dd->eep_st_masks[log_idx].errs_to_log)
> -				qib_inc_eeprom_err(dd, log_idx, 1);
>
>  	if (errs & ~IB_E_BITSEXTANT)
>  		qib_dev_err(dd,
> diff --git a/drivers/infiniband/hw/qib/qib_iba7220.c b/drivers/infiniband/hw/qib/qib_iba7220.c
> index 78ce79be4120..75f2cfd0d272 100644
> --- a/drivers/infiniband/hw/qib/qib_iba7220.c
> +++ b/drivers/infiniband/hw/qib/qib_iba7220.c
> @@ -1094,7 +1094,6 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)
>  	char *msg;
>  	u64 ignore_this_time = 0;
>  	u64 iserr = 0;
> -	int log_idx;
>  	struct qib_pportdata *ppd = dd->pport;
>  	u64 mask;
>
> @@ -1105,10 +1104,6 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)
>  	/* do these first, they are most important */
>  	if (errs & ERR_MASK(HardwareErr))
>  		qib_7220_handle_hwerrors(dd, msg, sizeof(dd->cspec->emsgbuf));
> -	else
> -		for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
> -			if (errs & dd->eep_st_masks[log_idx].errs_to_log)
> -				qib_inc_eeprom_err(dd, log_idx, 1);
>
>  	if (errs & QLOGIC_IB_E_SDMAERRS)
>  		sdma_7220_errors(ppd, errs);
> @@ -1302,7 +1297,6 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
>  	u32 bits, ctrl;
>  	int isfatal = 0;
>  	char *bitsmsg;
> -	int log_idx;
>
>  	hwerrs = qib_read_kreg64(dd, kr_hwerrstatus);
>  	if (!hwerrs)
> @@ -1326,10 +1320,6 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
>
>  	hwerrs &= dd->cspec->hwerrmask;
>
> -	/* We log some errors to EEPROM, check if we have any of those. */
> -	for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
> -		if (hwerrs & dd->eep_st_masks[log_idx].hwerrs_to_log)
> -			qib_inc_eeprom_err(dd, log_idx, 1);
>  	if (hwerrs & ~(TXEMEMPARITYERR_PIOBUF | TXEMEMPARITYERR_PIOPBC |
>  		       RXE_PARITY))
>  		qib_devinfo(dd->pcidev,
> diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c
> index 4d02cffe4e03..77217fae9c06 100644
> --- a/drivers/infiniband/hw/qib/qib_iba7322.c
> +++ b/drivers/infiniband/hw/qib/qib_iba7322.c
> @@ -1644,7 +1644,6 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)
>  	u64 iserr = 0;
>  	u64 errs;
>  	u64 mask;
> -	int log_idx;
>
>  	qib_stats.sps_errints++;
>  	errs = qib_read_kreg64(dd, kr_errstatus);
> @@ -1662,10 +1661,7 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)
>  	if (errs & QIB_E_HARDWARE) {
>  		*msg = '\0';
>  		qib_7322_handle_hwerrors(dd, msg, sizeof(dd->cspec->emsgbuf));
> -	} else
> -		for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
> -			if (errs & dd->eep_st_masks[log_idx].errs_to_log)
> -				qib_inc_eeprom_err(dd, log_idx, 1);
> +	}
>
>  	if (errs & QIB_E_SPKTERRS) {
>  		qib_disarm_7322_senderrbufs(dd->pport);
> N?????r??y????b?X??ǧv?^?)޺{.n?+????{??ٚ?{ay?\x1dʇڙ?,j\a??f???h???z?\x1e?w???\f???j:+v???w?j?m????\a????zZ+?????ݢj"??!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use
       [not found]                         ` <20171010180809.GI2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
@ 2017-10-10 18:25                           ` Bart Van Assche
       [not found]                             ` <1507659918.2815.50.camel-Sjgp3cTcYWE@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-10 18:25 UTC (permalink / raw)
  To: leon-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w,
	dledford-H+wXaHxf7aLQT0dZR+AlfA

On Tue, 2017-10-10 at 21:08 +0300, Leon Romanovsky wrote:
> Does it mean that you can get rid of eep_st_masks and QIB_EEP_LOG_CNT too?

I think so. Here we go ...


Subject: [PATCH] IB/qib: Remove remaining code related to writing the EEPROM

Due to removal of the EEPROM writing code, the qib_inc_eeprom_err()
macro became a no-op. Remove the code that calls it. Since that
change removes all code that reads the eep_st_masks array, also
remove the code that updates that array and the array itself.

References: commit 18c0b82a3e45 (" IB/qib: Do not write EEPROM")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Mike Marciniszyn <infinipath@intel.com>
---
 drivers/infiniband/hw/qib/qib.h         | 18 ------------------
 drivers/infiniband/hw/qib/qib_iba6120.c | 25 -------------------------
 drivers/infiniband/hw/qib/qib_iba7220.c | 20 --------------------
 drivers/infiniband/hw/qib/qib_iba7322.c |  6 +-----
 4 files changed, 1 insertion(+), 68 deletions(-)

diff --git a/drivers/infiniband/hw/qib/qib.h b/drivers/infiniband/hw/qib/qib.h
index 1167a9c1776b..689f5d001892 100644
--- a/drivers/infiniband/hw/qib/qib.h
+++ b/drivers/infiniband/hw/qib/qib.h
@@ -101,18 +101,6 @@ extern const struct pci_error_handlers qib_pci_err_handler;
  */
 #define QIB_TRAFFIC_ACTIVE_THRESHOLD (2000)
 
-/*
- * Struct used to indicate which errors are logged in each of the
- * error-counters that are logged to EEPROM. A counter is incremented
- * _once_ (saturating at 255) for each event with any bits set in
- * the error or hwerror register masks below.
- */
-#define QIB_EEP_LOG_CNT (4)
-struct qib_eep_log_mask {
-	u64 errs_to_log;
-	u64 hwerrs_to_log;
-};
-
 /*
  * Below contains all data related to a single context (formerly called port).
  */
@@ -1079,11 +1067,6 @@ struct qib_devdata {
 	/* control high-level access to EEPROM */
 	struct mutex eep_lock;
 	uint64_t traffic_wds;
-	/*
-	 * masks for which bits of errs, hwerrs that cause
-	 * each of the counters to increment.
-	 */
-	struct qib_eep_log_mask eep_st_masks[QIB_EEP_LOG_CNT];
 	struct qib_diag_client *diag_client;
 	spinlock_t qib_diag_trans_lock; /* protect diag observer ops */
 	struct diag_observer_list_elt *diag_observer_list;
@@ -1297,7 +1280,6 @@ int qib_twsi_blk_rd(struct qib_devdata *dd, int dev, int addr, void *buffer,
 int qib_twsi_blk_wr(struct qib_devdata *dd, int dev, int addr,
 		    const void *buffer, int len);
 void qib_get_eeprom_info(struct qib_devdata *);
-#define qib_inc_eeprom_err(dd, eidx, incr)
 void qib_dump_lookup_output_queue(struct qib_devdata *);
 void qib_force_pio_avail_update(struct qib_devdata *);
 void qib_clear_symerror_on_linkup(unsigned long opaque);
diff --git a/drivers/infiniband/hw/qib/qib_iba6120.c b/drivers/infiniband/hw/qib/qib_iba6120.c
index c4a4c57e0f0a..3c5adfa104a0 100644
--- a/drivers/infiniband/hw/qib/qib_iba6120.c
+++ b/drivers/infiniband/hw/qib/qib_iba6120.c
@@ -748,7 +748,6 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
 	u32 bits, ctrl;
 	int isfatal = 0;
 	char *bitsmsg;
-	int log_idx;
 
 	hwerrs = qib_read_kreg64(dd, kr_hwerrstatus);
 	if (!hwerrs)
@@ -770,11 +769,6 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
 
 	hwerrs &= dd->cspec->hwerrmask;
 
-	/* We log some errors to EEPROM, check if we have any of those. */
-	for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
-		if (hwerrs & dd->eep_st_masks[log_idx].hwerrs_to_log)
-			qib_inc_eeprom_err(dd, log_idx, 1);
-
 	/*
 	 * Make sure we get this much out, unless told to be quiet,
 	 * or it's occurred within the last 5 seconds.
@@ -1004,7 +998,6 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)
 	char *msg;
 	u64 ignore_this_time = 0;
 	u64 iserr = 0;
-	int log_idx;
 	struct qib_pportdata *ppd = dd->pport;
 	u64 mask;
 
@@ -1015,10 +1008,6 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)
 	/* do these first, they are most important */
 	if (errs & ERR_MASK(HardwareErr))
 		qib_handle_6120_hwerrors(dd, msg, sizeof(dd->cspec->emsgbuf));
-	else
-		for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
-			if (errs & dd->eep_st_masks[log_idx].errs_to_log)
-				qib_inc_eeprom_err(dd, log_idx, 1);
 
 	if (errs & ~IB_E_BITSEXTANT)
 		qib_dev_err(dd,
@@ -3227,20 +3216,6 @@ static int init_6120_variables(struct qib_devdata *dd)
 	if (qib_unordered_wc())
 		dd->flags |= QIB_PIO_FLUSH_WC;
 
-	/*
-	 * EEPROM error log 0 is TXE Parity errors. 1 is RXE Parity.
-	 * 2 is Some Misc, 3 is reserved for future.
-	 */
-	dd->eep_st_masks[0].hwerrs_to_log = HWE_MASK(TXEMemParityErr);
-
-	/* Ignore errors in PIO/PBC on systems with unordered write-combining */
-	if (qib_unordered_wc())
-		dd->eep_st_masks[0].hwerrs_to_log &= ~TXE_PIO_PARITY;
-
-	dd->eep_st_masks[1].hwerrs_to_log = HWE_MASK(RXEMemParityErr);
-
-	dd->eep_st_masks[2].errs_to_log = ERR_MASK(ResetNegated);
-
 	ret = qib_init_pportdata(ppd, dd, 0, 1);
 	if (ret)
 		goto bail;
diff --git a/drivers/infiniband/hw/qib/qib_iba7220.c b/drivers/infiniband/hw/qib/qib_iba7220.c
index 78ce79be4120..ceb2259a5efb 100644
--- a/drivers/infiniband/hw/qib/qib_iba7220.c
+++ b/drivers/infiniband/hw/qib/qib_iba7220.c
@@ -1094,7 +1094,6 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)
 	char *msg;
 	u64 ignore_this_time = 0;
 	u64 iserr = 0;
-	int log_idx;
 	struct qib_pportdata *ppd = dd->pport;
 	u64 mask;
 
@@ -1105,10 +1104,6 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)
 	/* do these first, they are most important */
 	if (errs & ERR_MASK(HardwareErr))
 		qib_7220_handle_hwerrors(dd, msg, sizeof(dd->cspec->emsgbuf));
-	else
-		for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
-			if (errs & dd->eep_st_masks[log_idx].errs_to_log)
-				qib_inc_eeprom_err(dd, log_idx, 1);
 
 	if (errs & QLOGIC_IB_E_SDMAERRS)
 		sdma_7220_errors(ppd, errs);
@@ -1302,7 +1297,6 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
 	u32 bits, ctrl;
 	int isfatal = 0;
 	char *bitsmsg;
-	int log_idx;
 
 	hwerrs = qib_read_kreg64(dd, kr_hwerrstatus);
 	if (!hwerrs)
@@ -1326,10 +1320,6 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
 
 	hwerrs &= dd->cspec->hwerrmask;
 
-	/* We log some errors to EEPROM, check if we have any of those. */
-	for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
-		if (hwerrs & dd->eep_st_masks[log_idx].hwerrs_to_log)
-			qib_inc_eeprom_err(dd, log_idx, 1);
 	if (hwerrs & ~(TXEMEMPARITYERR_PIOBUF | TXEMEMPARITYERR_PIOPBC |
 		       RXE_PARITY))
 		qib_devinfo(dd->pcidev,
@@ -4016,16 +4006,6 @@ static int qib_init_7220_variables(struct qib_devdata *dd)
 	dd->flags |= qib_special_trigger ?
 		QIB_USE_SPCL_TRIG : QIB_HAS_SEND_DMA;
 
-	/*
-	 * EEPROM error log 0 is TXE Parity errors. 1 is RXE Parity.
-	 * 2 is Some Misc, 3 is reserved for future.
-	 */
-	dd->eep_st_masks[0].hwerrs_to_log = HWE_MASK(TXEMemParityErr);
-
-	dd->eep_st_masks[1].hwerrs_to_log = HWE_MASK(RXEMemParityErr);
-
-	dd->eep_st_masks[2].errs_to_log = ERR_MASK(ResetNegated);
-
 	init_waitqueue_head(&cpspec->autoneg_wait);
 	INIT_DELAYED_WORK(&cpspec->autoneg_work, autoneg_7220_work);
 
diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c
index 4d02cffe4e03..77217fae9c06 100644
--- a/drivers/infiniband/hw/qib/qib_iba7322.c
+++ b/drivers/infiniband/hw/qib/qib_iba7322.c
@@ -1644,7 +1644,6 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)
 	u64 iserr = 0;
 	u64 errs;
 	u64 mask;
-	int log_idx;
 
 	qib_stats.sps_errints++;
 	errs = qib_read_kreg64(dd, kr_errstatus);
@@ -1662,10 +1661,7 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)
 	if (errs & QIB_E_HARDWARE) {
 		*msg = '\0';
 		qib_7322_handle_hwerrors(dd, msg, sizeof(dd->cspec->emsgbuf));
-	} else
-		for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
-			if (errs & dd->eep_st_masks[log_idx].errs_to_log)
-				qib_inc_eeprom_err(dd, log_idx, 1);
+	}
 
 	if (errs & QIB_E_SPKTERRS) {
 		qib_disarm_7322_senderrbufs(dd->pport);
-- 
2.14.2

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

* Re: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use
       [not found]                             ` <1507659918.2815.50.camel-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-10 18:33                               ` Leon Romanovsky
  2017-10-10 20:40                               ` Marciniszyn, Mike
  1 sibling, 0 replies; 105+ messages in thread
From: Leon Romanovsky @ 2017-10-10 18:33 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w,
	dledford-H+wXaHxf7aLQT0dZR+AlfA

[-- Attachment #1: Type: text/plain, Size: 8570 bytes --]

On Tue, Oct 10, 2017 at 06:25:19PM +0000, Bart Van Assche wrote:
> On Tue, 2017-10-10 at 21:08 +0300, Leon Romanovsky wrote:
> > Does it mean that you can get rid of eep_st_masks and QIB_EEP_LOG_CNT too?
>
> I think so. Here we go ...

Thanks

>
>
> Subject: [PATCH] IB/qib: Remove remaining code related to writing the EEPROM
>
> Due to removal of the EEPROM writing code, the qib_inc_eeprom_err()
> macro became a no-op. Remove the code that calls it. Since that
> change removes all code that reads the eep_st_masks array, also
> remove the code that updates that array and the array itself.
>
> References: commit 18c0b82a3e45 (" IB/qib: Do not write EEPROM")
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Mike Marciniszyn <infinipath-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/infiniband/hw/qib/qib.h         | 18 ------------------
>  drivers/infiniband/hw/qib/qib_iba6120.c | 25 -------------------------
>  drivers/infiniband/hw/qib/qib_iba7220.c | 20 --------------------
>  drivers/infiniband/hw/qib/qib_iba7322.c |  6 +-----
>  4 files changed, 1 insertion(+), 68 deletions(-)
>
> diff --git a/drivers/infiniband/hw/qib/qib.h b/drivers/infiniband/hw/qib/qib.h
> index 1167a9c1776b..689f5d001892 100644
> --- a/drivers/infiniband/hw/qib/qib.h
> +++ b/drivers/infiniband/hw/qib/qib.h
> @@ -101,18 +101,6 @@ extern const struct pci_error_handlers qib_pci_err_handler;
>   */
>  #define QIB_TRAFFIC_ACTIVE_THRESHOLD (2000)
>
> -/*
> - * Struct used to indicate which errors are logged in each of the
> - * error-counters that are logged to EEPROM. A counter is incremented
> - * _once_ (saturating at 255) for each event with any bits set in
> - * the error or hwerror register masks below.
> - */
> -#define QIB_EEP_LOG_CNT (4)
> -struct qib_eep_log_mask {
> -	u64 errs_to_log;
> -	u64 hwerrs_to_log;
> -};
> -
>  /*
>   * Below contains all data related to a single context (formerly called port).
>   */
> @@ -1079,11 +1067,6 @@ struct qib_devdata {
>  	/* control high-level access to EEPROM */
>  	struct mutex eep_lock;
>  	uint64_t traffic_wds;
> -	/*
> -	 * masks for which bits of errs, hwerrs that cause
> -	 * each of the counters to increment.
> -	 */
> -	struct qib_eep_log_mask eep_st_masks[QIB_EEP_LOG_CNT];
>  	struct qib_diag_client *diag_client;
>  	spinlock_t qib_diag_trans_lock; /* protect diag observer ops */
>  	struct diag_observer_list_elt *diag_observer_list;
> @@ -1297,7 +1280,6 @@ int qib_twsi_blk_rd(struct qib_devdata *dd, int dev, int addr, void *buffer,
>  int qib_twsi_blk_wr(struct qib_devdata *dd, int dev, int addr,
>  		    const void *buffer, int len);
>  void qib_get_eeprom_info(struct qib_devdata *);
> -#define qib_inc_eeprom_err(dd, eidx, incr)
>  void qib_dump_lookup_output_queue(struct qib_devdata *);
>  void qib_force_pio_avail_update(struct qib_devdata *);
>  void qib_clear_symerror_on_linkup(unsigned long opaque);
> diff --git a/drivers/infiniband/hw/qib/qib_iba6120.c b/drivers/infiniband/hw/qib/qib_iba6120.c
> index c4a4c57e0f0a..3c5adfa104a0 100644
> --- a/drivers/infiniband/hw/qib/qib_iba6120.c
> +++ b/drivers/infiniband/hw/qib/qib_iba6120.c
> @@ -748,7 +748,6 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
>  	u32 bits, ctrl;
>  	int isfatal = 0;
>  	char *bitsmsg;
> -	int log_idx;
>
>  	hwerrs = qib_read_kreg64(dd, kr_hwerrstatus);
>  	if (!hwerrs)
> @@ -770,11 +769,6 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
>
>  	hwerrs &= dd->cspec->hwerrmask;
>
> -	/* We log some errors to EEPROM, check if we have any of those. */
> -	for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
> -		if (hwerrs & dd->eep_st_masks[log_idx].hwerrs_to_log)
> -			qib_inc_eeprom_err(dd, log_idx, 1);
> -
>  	/*
>  	 * Make sure we get this much out, unless told to be quiet,
>  	 * or it's occurred within the last 5 seconds.
> @@ -1004,7 +998,6 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)
>  	char *msg;
>  	u64 ignore_this_time = 0;
>  	u64 iserr = 0;
> -	int log_idx;
>  	struct qib_pportdata *ppd = dd->pport;
>  	u64 mask;
>
> @@ -1015,10 +1008,6 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)
>  	/* do these first, they are most important */
>  	if (errs & ERR_MASK(HardwareErr))
>  		qib_handle_6120_hwerrors(dd, msg, sizeof(dd->cspec->emsgbuf));
> -	else
> -		for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
> -			if (errs & dd->eep_st_masks[log_idx].errs_to_log)
> -				qib_inc_eeprom_err(dd, log_idx, 1);
>
>  	if (errs & ~IB_E_BITSEXTANT)
>  		qib_dev_err(dd,
> @@ -3227,20 +3216,6 @@ static int init_6120_variables(struct qib_devdata *dd)
>  	if (qib_unordered_wc())
>  		dd->flags |= QIB_PIO_FLUSH_WC;
>
> -	/*
> -	 * EEPROM error log 0 is TXE Parity errors. 1 is RXE Parity.
> -	 * 2 is Some Misc, 3 is reserved for future.
> -	 */
> -	dd->eep_st_masks[0].hwerrs_to_log = HWE_MASK(TXEMemParityErr);
> -
> -	/* Ignore errors in PIO/PBC on systems with unordered write-combining */
> -	if (qib_unordered_wc())
> -		dd->eep_st_masks[0].hwerrs_to_log &= ~TXE_PIO_PARITY;
> -
> -	dd->eep_st_masks[1].hwerrs_to_log = HWE_MASK(RXEMemParityErr);
> -
> -	dd->eep_st_masks[2].errs_to_log = ERR_MASK(ResetNegated);
> -
>  	ret = qib_init_pportdata(ppd, dd, 0, 1);
>  	if (ret)
>  		goto bail;
> diff --git a/drivers/infiniband/hw/qib/qib_iba7220.c b/drivers/infiniband/hw/qib/qib_iba7220.c
> index 78ce79be4120..ceb2259a5efb 100644
> --- a/drivers/infiniband/hw/qib/qib_iba7220.c
> +++ b/drivers/infiniband/hw/qib/qib_iba7220.c
> @@ -1094,7 +1094,6 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)
>  	char *msg;
>  	u64 ignore_this_time = 0;
>  	u64 iserr = 0;
> -	int log_idx;
>  	struct qib_pportdata *ppd = dd->pport;
>  	u64 mask;
>
> @@ -1105,10 +1104,6 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)
>  	/* do these first, they are most important */
>  	if (errs & ERR_MASK(HardwareErr))
>  		qib_7220_handle_hwerrors(dd, msg, sizeof(dd->cspec->emsgbuf));
> -	else
> -		for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
> -			if (errs & dd->eep_st_masks[log_idx].errs_to_log)
> -				qib_inc_eeprom_err(dd, log_idx, 1);
>
>  	if (errs & QLOGIC_IB_E_SDMAERRS)
>  		sdma_7220_errors(ppd, errs);
> @@ -1302,7 +1297,6 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
>  	u32 bits, ctrl;
>  	int isfatal = 0;
>  	char *bitsmsg;
> -	int log_idx;
>
>  	hwerrs = qib_read_kreg64(dd, kr_hwerrstatus);
>  	if (!hwerrs)
> @@ -1326,10 +1320,6 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
>
>  	hwerrs &= dd->cspec->hwerrmask;
>
> -	/* We log some errors to EEPROM, check if we have any of those. */
> -	for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
> -		if (hwerrs & dd->eep_st_masks[log_idx].hwerrs_to_log)
> -			qib_inc_eeprom_err(dd, log_idx, 1);
>  	if (hwerrs & ~(TXEMEMPARITYERR_PIOBUF | TXEMEMPARITYERR_PIOPBC |
>  		       RXE_PARITY))
>  		qib_devinfo(dd->pcidev,
> @@ -4016,16 +4006,6 @@ static int qib_init_7220_variables(struct qib_devdata *dd)
>  	dd->flags |= qib_special_trigger ?
>  		QIB_USE_SPCL_TRIG : QIB_HAS_SEND_DMA;
>
> -	/*
> -	 * EEPROM error log 0 is TXE Parity errors. 1 is RXE Parity.
> -	 * 2 is Some Misc, 3 is reserved for future.
> -	 */
> -	dd->eep_st_masks[0].hwerrs_to_log = HWE_MASK(TXEMemParityErr);
> -
> -	dd->eep_st_masks[1].hwerrs_to_log = HWE_MASK(RXEMemParityErr);
> -
> -	dd->eep_st_masks[2].errs_to_log = ERR_MASK(ResetNegated);
> -
>  	init_waitqueue_head(&cpspec->autoneg_wait);
>  	INIT_DELAYED_WORK(&cpspec->autoneg_work, autoneg_7220_work);
>
> diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c
> index 4d02cffe4e03..77217fae9c06 100644
> --- a/drivers/infiniband/hw/qib/qib_iba7322.c
> +++ b/drivers/infiniband/hw/qib/qib_iba7322.c
> @@ -1644,7 +1644,6 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)
>  	u64 iserr = 0;
>  	u64 errs;
>  	u64 mask;
> -	int log_idx;
>
>  	qib_stats.sps_errints++;
>  	errs = qib_read_kreg64(dd, kr_errstatus);
> @@ -1662,10 +1661,7 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)
>  	if (errs & QIB_E_HARDWARE) {
>  		*msg = '\0';
>  		qib_7322_handle_hwerrors(dd, msg, sizeof(dd->cspec->emsgbuf));
> -	} else
> -		for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
> -			if (errs & dd->eep_st_masks[log_idx].errs_to_log)
> -				qib_inc_eeprom_err(dd, log_idx, 1);
> +	}
>
>  	if (errs & QIB_E_SPKTERRS) {
>  		qib_disarm_7322_senderrbufs(dd->pport);
> --
> 2.14.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 02/47] IB/cm: Suppress gcc 7 fall-through complaints
       [not found]     ` <20171006213333.6721-3-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
  2017-10-06 22:03       ` Hefty, Sean
@ 2017-10-10 19:27       ` Dennis Dalessandro
       [not found]         ` <849d304a-fa89-0d6a-6edb-cf34780e41a8-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  1 sibling, 1 reply; 105+ messages in thread
From: Dennis Dalessandro @ 2017-10-10 19:27 UTC (permalink / raw)
  To: Bart Van Assche, Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sean Hefty

On 10/6/2017 5:32 PM, Bart Van Assche wrote:
> Avoid that gcc 7 reports the following warning when building with W=1:
> 
> warning: this statement may fall through [-Wimplicit-fallthrough=]
> 
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
>   drivers/infiniband/core/cm.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
> index d80911d4abb7..5927ee4e57ca 100644
> --- a/drivers/infiniband/core/cm.c
> +++ b/drivers/infiniband/core/cm.c
> @@ -2808,6 +2808,7 @@ int ib_send_cm_mra(struct ib_cm_id *cm_id,
>   			msg_response = CM_MSG_RESPONSE_OTHER;
>   			break;
>   		}
> +		/* fall through */
>   	default:
>   		ret = -EINVAL;
>   		goto error1;
> 

So adding the comment is enough to make gcc shut up? Or are you just 
annotating the code so it's obvious it was intentional?

-Dennis
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH 02/47] IB/cm: Suppress gcc 7 fall-through complaints
       [not found]         ` <849d304a-fa89-0d6a-6edb-cf34780e41a8-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2017-10-10 19:29           ` Hefty, Sean
  2017-10-10 19:31           ` Leon Romanovsky
  1 sibling, 0 replies; 105+ messages in thread
From: Hefty, Sean @ 2017-10-10 19:29 UTC (permalink / raw)
  To: Dalessandro, Dennis, Bart Van Assche, Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> > diff --git a/drivers/infiniband/core/cm.c
> > b/drivers/infiniband/core/cm.c index d80911d4abb7..5927ee4e57ca
> 100644
> > --- a/drivers/infiniband/core/cm.c
> > +++ b/drivers/infiniband/core/cm.c
> > @@ -2808,6 +2808,7 @@ int ib_send_cm_mra(struct ib_cm_id *cm_id,
> >   			msg_response = CM_MSG_RESPONSE_OTHER;
> >   			break;
> >   		}
> > +		/* fall through */
> >   	default:
> >   		ret = -EINVAL;
> >   		goto error1;
> >
> 
> So adding the comment is enough to make gcc shut up? Or are you just
> annotating the code so it's obvious it was intentional?

gcc will process the comment and its intent

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

* Re: [PATCH 02/47] IB/cm: Suppress gcc 7 fall-through complaints
       [not found]         ` <849d304a-fa89-0d6a-6edb-cf34780e41a8-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  2017-10-10 19:29           ` Hefty, Sean
@ 2017-10-10 19:31           ` Leon Romanovsky
       [not found]             ` <20171010193127.GK2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
  1 sibling, 1 reply; 105+ messages in thread
From: Leon Romanovsky @ 2017-10-10 19:31 UTC (permalink / raw)
  To: Dennis Dalessandro
  Cc: Bart Van Assche, Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	Sean Hefty

[-- Attachment #1: Type: text/plain, Size: 1877 bytes --]

On Tue, Oct 10, 2017 at 03:27:11PM -0400, Dennis Dalessandro wrote:
> On 10/6/2017 5:32 PM, Bart Van Assche wrote:
> > Avoid that gcc 7 reports the following warning when building with W=1:
> >
> > warning: this statement may fall through [-Wimplicit-fallthrough=]
> >
> > Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> > Cc: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > ---
> >   drivers/infiniband/core/cm.c | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
> > index d80911d4abb7..5927ee4e57ca 100644
> > --- a/drivers/infiniband/core/cm.c
> > +++ b/drivers/infiniband/core/cm.c
> > @@ -2808,6 +2808,7 @@ int ib_send_cm_mra(struct ib_cm_id *cm_id,
> >   			msg_response = CM_MSG_RESPONSE_OTHER;
> >   			break;
> >   		}
> > +		/* fall through */
> >   	default:
> >   		ret = -EINVAL;
> >   		goto error1;
> >
>
> So adding the comment is enough to make gcc shut up? Or are you just
> annotating the code so it's obvious it was intentional?

GCC is looking for the specific comment.
---
-Wimplicit-fallthrough warns when a switch case falls through.
This warning has five different levels. The compiler is able to parse a wide range of fallthrough comments,
depending on the level. It also handles control-flow statements, such as ifs.
It's possible to suppress the warning by either adding a fallthrough comment,
or by using a null statement: __attribute__ ((fallthrough)); (C, C++),
or [[fallthrough]]; (C++17), or [[gnu::fallthrough]]; (C++11/C++14).
---
https://gcc.gnu.org/gcc-7/changes.html

Thanks

>
> -Dennis
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 02/47] IB/cm: Suppress gcc 7 fall-through complaints
       [not found]             ` <20171010193127.GK2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
@ 2017-10-10 19:49               ` Dennis Dalessandro
  0 siblings, 0 replies; 105+ messages in thread
From: Dennis Dalessandro @ 2017-10-10 19:49 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Bart Van Assche, Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	Sean Hefty

On 10/10/2017 3:31 PM, Leon Romanovsky wrote:
> On Tue, Oct 10, 2017 at 03:27:11PM -0400, Dennis Dalessandro wrote:
>> On 10/6/2017 5:32 PM, Bart Van Assche wrote:
>>> Avoid that gcc 7 reports the following warning when building with W=1:
>>>
>>> warning: this statement may fall through [-Wimplicit-fallthrough=]
>>>
>>> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
>>> Cc: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>>> ---
>>>    drivers/infiniband/core/cm.c | 1 +
>>>    1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
>>> index d80911d4abb7..5927ee4e57ca 100644
>>> --- a/drivers/infiniband/core/cm.c
>>> +++ b/drivers/infiniband/core/cm.c
>>> @@ -2808,6 +2808,7 @@ int ib_send_cm_mra(struct ib_cm_id *cm_id,
>>>    			msg_response = CM_MSG_RESPONSE_OTHER;
>>>    			break;
>>>    		}
>>> +		/* fall through */
>>>    	default:
>>>    		ret = -EINVAL;
>>>    		goto error1;
>>>
>>
>> So adding the comment is enough to make gcc shut up? Or are you just
>> annotating the code so it's obvious it was intentional?
> 
> GCC is looking for the specific comment.
> ---
> -Wimplicit-fallthrough warns when a switch case falls through.
> This warning has five different levels. The compiler is able to parse a wide range of fallthrough comments,
> depending on the level. It also handles control-flow statements, such as ifs.
> It's possible to suppress the warning by either adding a fallthrough comment,
> or by using a null statement: __attribute__ ((fallthrough)); (C, C++),
> or [[fallthrough]]; (C++17), or [[gnu::fallthrough]]; (C++11/C++14).
> ---
> https://gcc.gnu.org/gcc-7/changes.html
> 
> Thanks

Ah, makes sense now, thanks Leon.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 16/47] IB/hfi1: Suppress gcc 7 fall-through complaints
       [not found]     ` <20171006213333.6721-17-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-10 19:50       ` Dennis Dalessandro
  0 siblings, 0 replies; 105+ messages in thread
From: Dennis Dalessandro @ 2017-10-10 19:50 UTC (permalink / raw)
  To: Bart Van Assche, Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Ira Weiny

On 10/6/2017 5:33 PM, Bart Van Assche wrote:
> Avoid that gcc 7 reports the following warning when building with W=1:
> 
> warning: this statement may fall through [-Wimplicit-fallthrough=]
> 
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Cc: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 43/47] RDMA/rdmavt: Suppress gcc 7 fall-through complaints
       [not found]     ` <20171006213333.6721-44-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-10 19:51       ` Dennis Dalessandro
  0 siblings, 0 replies; 105+ messages in thread
From: Dennis Dalessandro @ 2017-10-10 19:51 UTC (permalink / raw)
  To: Bart Van Assche, Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 10/6/2017 5:33 PM, Bart Van Assche wrote:
> Avoid that gcc 7 reports the following warning when building with W=1:
> 
> warning: this statement may fall through [-Wimplicit-fallthrough=]
> 
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH 42/47] IB/qib: Remove set-but-not-used variables
       [not found]     ` <20171006213333.6721-43-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-10 20:25       ` Marciniszyn, Mike
       [not found]         ` <32E1700B9017364D9B60AED9960492BC3442B95A-RjuIdWtd+YbTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Marciniszyn, Mike @ 2017-10-10 20:25 UTC (permalink / raw)
  To: Bart Van Assche, Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> Subject: [PATCH 42/47] IB/qib: Remove set-but-not-used variables
> 
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Mike Marciniszyn <infinipath-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---

This one looks good!

I'm curious about the kbuild modificaitons to expose these issues.

Did you add them yourself, or are they now upstream?

Mike

Tested-By: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Acked-By: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 42/47] IB/qib: Remove set-but-not-used variables
       [not found]         ` <32E1700B9017364D9B60AED9960492BC3442B95A-RjuIdWtd+YbTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2017-10-10 20:40           ` Bart Van Assche
       [not found]             ` <1507668036.2815.55.camel-Sjgp3cTcYWE@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-10 20:40 UTC (permalink / raw)
  To: mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w, dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Tue, 2017-10-10 at 20:25 +0000, Marciniszyn, Mike wrote:
> I'm curious about the kbuild modificaitons to expose these issues.
> Did you add them yourself, or are they now upstream?

Hello Mike,

Thanks for the review. Is what you would like to know what build options
I used to enable the warnings addressed by this patch series? What I did
is to build the IB subsystem as follows:

$ for opt in "W=1" "C=2" "C=2 CHECK='smatch -p=kernel'"; do make -j5 M=drivers/infiniband $opt; done

Instructions for how to download the source code of sparse and smatch are
available at:
* https://sparse.wiki.kernel.org/index.php/Main_Page
* http://smatch.sourceforge.net/

Bart.

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

* RE: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use
       [not found]                             ` <1507659918.2815.50.camel-Sjgp3cTcYWE@public.gmane.org>
  2017-10-10 18:33                               ` Leon Romanovsky
@ 2017-10-10 20:40                               ` Marciniszyn, Mike
  1 sibling, 0 replies; 105+ messages in thread
From: Marciniszyn, Mike @ 2017-10-10 20:40 UTC (permalink / raw)
  To: Bart Van Assche, leon-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, dledford-H+wXaHxf7aLQT0dZR+AlfA

> 
> Subject: [PATCH] IB/qib: Remove remaining code related to writing the
> EEPROM
> 

Go ahead and submit a v2.

I will grab it from patchworks and test.

Mike

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

* Re: [PATCH 05/47] RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing
       [not found]             ` <1507570048.2674.17.camel-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-11  5:19               ` Matan Barak
       [not found]                 ` <3a6adf24-3e60-7fd1-a119-37586793d374-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Matan Barak @ 2017-10-11  5:19 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	yishaih-VPRAkNaXOzVWk0Htik3J/w, dledford-H+wXaHxf7aLQT0dZR+AlfA

On 09/10/2017 20:27, Bart Van Assche wrote:
> On Mon, 2017-10-09 at 10:40 +0300, Matan Barak (External) wrote:
>> On 07/10/2017 00:32, Bart Van Assche wrote:
>>> This patch reduces the number of #ifdefs and also avoids that
>>> smatch reports the following:
>>>
>>> drivers/infiniband/core/uverbs_ioctl.c:276: ib_uverbs_cmd_verbs() warn: if statement not indented
>>> drivers/infiniband/core/uverbs_ioctl.c:280: ib_uverbs_cmd_verbs() warn: possible memory leak of 'ctx'
>>> drivers/infiniband/core/uverbs_ioctl.c:315: ib_uverbs_cmd_verbs() warn: if statement not indented
>>>
>>> References: commit fac9658cabb9 ("IB/core: Add new ioctl interface")
>>> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
>>> Cc: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>>> Cc: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>>> ---
>>>    drivers/infiniband/core/uverbs_ioctl.c | 20 +++++++++-----------
>>>    1 file changed, 9 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c
>>> index 5286ad57d903..53f780ea49fe 100644
>>> --- a/drivers/infiniband/core/uverbs_ioctl.c
>>> +++ b/drivers/infiniband/core/uverbs_ioctl.c
>>> @@ -234,7 +234,7 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
>>>        const struct uverbs_method_spec *method_spec;
>>>        long err = 0;
>>>        unsigned int i;
>>> -    struct {
>>> +    struct attr_and_bundle {
>>>            struct ib_uverbs_attr        *uattrs;
>>>            struct uverbs_attr_bundle    *uverbs_attr_bundle;
>>>        } *ctx = NULL;
>>> @@ -242,7 +242,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
>>>        unsigned long *curr_bitmap;
>>>        size_t ctx_size;
>>>    #ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
>>> -    uintptr_t data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)];
>>> +    uintptr_t __data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)];
>>> +    struct attr_and_bundle *const data = (void *)__data;
>>> +#else
>>> +    struct attr_and_bundle *const data = NULL;
>>>    #endif
>>>
>>>        if (hdr->reserved)
>>> @@ -269,13 +272,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
>>>                (method_spec->num_child_attrs / BITS_PER_LONG +
>>>                 method_spec->num_buckets);
>>>
>>> -#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
>>>        if (ctx_size <= UVERBS_OPTIMIZE_USING_STACK_SZ)
>>
>> If UVERBS_OPTIMIZE_USING_STACK_SZ isn't defined, you'll get an error here.
>> Maybe we could define it as 0 in the else part of the local variables deceleration.
> 
> Hello Matan,
> 
> That's an interesting suggestion but that wouldn't work well with the "#ifdef
> UVERBS_OPTIMIZE_USING_STACK_SZ" code in the declaration section. How about
> changing "if (ctx_size <= UVERBS_OPTIMIZE_USING_STACK_SZ) ctx = data;" into
> "ctx = data;" such that it becomes again safe not to define UVERBS_OPTIMIZE_USING_STACK_SZ?
> With that change this patch looks as follows:
> 
> 
> diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c
> index 5286ad57d903..81c05ba2a58b 100644
> --- a/drivers/infiniband/core/uverbs_ioctl.c
> +++ b/drivers/infiniband/core/uverbs_ioctl.c
> @@ -234,7 +234,7 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
>   	const struct uverbs_method_spec *method_spec;
>   	long err = 0;
>   	unsigned int i;
> -	struct {
> +	struct attr_and_bundle {
>   		struct ib_uverbs_attr		*uattrs;
>   		struct uverbs_attr_bundle	*uverbs_attr_bundle;
>   	} *ctx = NULL;
> @@ -242,7 +242,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
>   	unsigned long *curr_bitmap;
>   	size_t ctx_size;
>   #ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
> -	uintptr_t data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)];
> +	uintptr_t __data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)];
> +	struct attr_and_bundle *const data = (void *)__data;
> +#else
> +	struct attr_and_bundle *const data = NULL;

I meant to define that macro here:
#define UVERBS_OPTIMIZE_USING_STACK_SZ 	0

>   #endif
>   
>   	if (hdr->reserved)
> @@ -269,13 +272,9 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
>   			(method_spec->num_child_attrs / BITS_PER_LONG +
>   			 method_spec->num_buckets);
>   
> -#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
> -	if (ctx_size <= UVERBS_OPTIMIZE_USING_STACK_SZ)
> -		ctx = (void *)data;
> -
> +	ctx = data;
>   	if (!ctx)
> -#endif
> -	ctx = kmalloc(ctx_size, GFP_KERNEL);
> +		ctx = kmalloc(ctx_size, GFP_KERNEL);

But what about cases where UVERBS_OPTIMIZE_USING_STACK_SZ is defined but 
is insufficient in size?

In the suggestion I posted above, I meant:
/* Here UVERBS_OPTIMIZE_USING_STACK_SZ is always defined */
if (ctx_size <= UVERBS_OPTIMIZE_USING_STACK_SZ)
	ctx = data;
if (!ctx)
	ctx = kmalloc(ctx_size, GFP_KERNEL);

The last hunk (free part) stays the same.	

>   	if (!ctx)
>   		return -ENOMEM;
>   
> @@ -311,10 +310,8 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
>   	err = uverbs_handle_method(buf, ctx->uattrs, hdr->num_attrs, ib_dev,
>   				   file, method_spec, ctx->uverbs_attr_bundle);
>   out:
> -#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
> -	if (ctx_size > UVERBS_OPTIMIZE_USING_STACK_SZ)
> -#endif
> -	kfree(ctx);
> +	if (ctx != data)
> +		kfree(ctx);
>   	return err;
>   }
>   
> 


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

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

* Re: [PATCH 06/47] RDMA/isert: Suppress gcc 7 fall-through complaints
       [not found]     ` <20171006213333.6721-7-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-11 13:10       ` Sagi Grimberg
  0 siblings, 0 replies; 105+ messages in thread
From: Sagi Grimberg @ 2017-10-11 13:10 UTC (permalink / raw)
  To: Bart Van Assche, Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Acked-by: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 17/47] IB/hfi1: Remove set-but-not-used variables
       [not found]     ` <20171006213333.6721-18-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-11 13:45       ` Dennis Dalessandro
  0 siblings, 0 replies; 105+ messages in thread
From: Dennis Dalessandro @ 2017-10-11 13:45 UTC (permalink / raw)
  To: Bart Van Assche, Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Ira Weiny

On 10/6/2017 5:33 PM, Bart Van Assche wrote:
> diff --git a/drivers/infiniband/hw/hfi1/mad.c b/drivers/infiniband/hw/hfi1/mad.c
> index f57d893df3e0..29da75d89a7c 100644
> --- a/drivers/infiniband/hw/hfi1/mad.c
> +++ b/drivers/infiniband/hw/hfi1/mad.c
> @@ -2889,7 +2889,6 @@ static int pma_get_opa_datacounters(struct opa_pma_mad *pmp,
>   	struct _vls_dctrs *vlinfo;
>   	size_t response_data_size;
>   	u32 num_ports;
> -	u8 num_pslm;
>   	u8 lq, num_vls;
>   	u8 res_lli, res_ler;
>   	u64 port_mask;
> @@ -2899,7 +2898,6 @@ static int pma_get_opa_datacounters(struct opa_pma_mad *pmp,
>   	int vfi;
>   
>   	num_ports = be32_to_cpu(pmp->mad_hdr.attr_mod) >> 24;
> -	num_pslm = hweight64(be64_to_cpu(req->port_select_mask[3]));

I need to figure out why we don't check num_pslm here like we do in 
every other instance. This may be a bug. I'm fine removing this for now, 
since it clearly doesn't hurt, and we will add it back later with the 
check if needed.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 18/47] IB/hfi1: Define hfi1_handle_cnp_tbl[] once
       [not found]     ` <20171006213333.6721-19-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-11 13:54       ` Dennis Dalessandro
  0 siblings, 0 replies; 105+ messages in thread
From: Dennis Dalessandro @ 2017-10-11 13:54 UTC (permalink / raw)
  To: Bart Van Assche, Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Ira Weiny

On 10/6/2017 5:33 PM, Bart Van Assche wrote:
> This patch does not change any functionality.

Greg K-H would probably tell you that you need to be more descriptive in 
the commit message.

> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Cc: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

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

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

* Re: [PATCH 35/47] IB/opa: Fix endianness annotation of opa_is_extended_lid()
       [not found]     ` <20171006213333.6721-36-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-11 13:59       ` Dennis Dalessandro
  0 siblings, 0 replies; 105+ messages in thread
From: Dennis Dalessandro @ 2017-10-11 13:59 UTC (permalink / raw)
  To: Bart Van Assche, Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Niranjana Vishwanathapura

On 10/6/2017 5:33 PM, Bart Van Assche wrote:
> This patch does not change any functionality.
> 
> Fixes: commit e92aa00a5189 ("IB/CM: Add OPA Path record support to CM")
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Cc: Niranjana Vishwanathapura <niranjana.vishwanathapura-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
>   include/rdma/opa_addr.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/rdma/opa_addr.h b/include/rdma/opa_addr.h
> index e6e90f18e6d5..72995a39cb97 100644
> --- a/include/rdma/opa_addr.h
> +++ b/include/rdma/opa_addr.h
> @@ -97,7 +97,7 @@ static inline u32 opa_get_lid_from_gid(const union ib_gid *gid)
>    * @dlid: The DLID
>    * @slid: The SLID
>    */
> -static inline bool opa_is_extended_lid(u32 dlid, u32 slid)
> +static inline bool opa_is_extended_lid(__be32 dlid, __be32 slid)
>   {
>   	if ((be32_to_cpu(dlid) >=
>   	     be16_to_cpu(IB_MULTICAST_LID_BASE)) ||
> 

Doug already has taken a patch for this, it is in his for-next branch:

a917374e8a20 ("IB/core: Use __be32 for LIDs in opa_is_extended_lid").

-Denny
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 00/47] Address issues detected by static analysis tools
       [not found]     ` <1507567892.46071.44.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2017-10-11 14:03       ` Dennis Dalessandro
       [not found]         ` <5d2b3adc-1a19-8acf-9915-d97296be9079-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Dennis Dalessandro @ 2017-10-11 14:03 UTC (permalink / raw)
  To: Doug Ledford, Bart Van Assche; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 10/9/2017 12:51 PM, Doug Ledford wrote:
> On Fri, 2017-10-06 at 14:32 -0700, Bart Van Assche wrote:
>> Hello Doug,
>>
>> As we all know there are several static analysis tools available for
>> the Linux
>> kernel and these tools are valuable. I'm referring to increasing the
>> gcc
>> warning level (W=1), sparse and smatch. It is helpful to analyze new
>> code with
>> these tools before submitting a patch. These tools are most useful if
>> existing
>> code is clean. Hence this patch series that significantly reduces the
>> number
>> of complaints reported by static analysis tools. Please consider this
>> patch
>> series for kernel v4.15.
> 
> The series looks pretty good Bart.  I'd like some Intel eyes on the
> hfi1 changes, and I'd like some people to report back that the rcu
> changes in their code are good, and the Cc: Signed-off-by: mistakes in
> the hns_roce parts needs fixed.  Then I'll be ready to take it.  Thanks
> for all the work here.

Thanks for the hard work here Bart! I know all of us driver maintainers 
appreciate your helping to clean up our mess :) and you might have even 
uncovered a bug in our driver so double thanks!

The only problem is the one patch isn't needed because I just submitted 
a patch last week for the same thing and Doug has already pulled it into 
his for-next.

-Denny


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

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

* Re: [PATCH 00/47] Address issues detected by static analysis tools
       [not found]         ` <5d2b3adc-1a19-8acf-9915-d97296be9079-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2017-10-11 14:55           ` Bart Van Assche
  0 siblings, 0 replies; 105+ messages in thread
From: Bart Van Assche @ 2017-10-11 14:55 UTC (permalink / raw)
  To: dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w,
	dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Wed, 2017-10-11 at 10:03 -0400, Dennis Dalessandro wrote:
> The only problem is the one patch isn't needed because I just submitted 
> a patch last week for the same thing and Doug has already pulled it into 
> his for-next.

Hello Dennis,

That's fine. I will rebase and retest this patch series anyway before I
repost this series.

Bart.

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

* Re: [PATCH 05/47] RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing
       [not found]                 ` <3a6adf24-3e60-7fd1-a119-37586793d374-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2017-10-11 15:30                   ` Bart Van Assche
       [not found]                     ` <1507735840.2477.8.camel-Sjgp3cTcYWE@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-11 15:30 UTC (permalink / raw)
  To: matanb-VPRAkNaXOzVWk0Htik3J/w
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	yishaih-VPRAkNaXOzVWk0Htik3J/w, dledford-H+wXaHxf7aLQT0dZR+AlfA

On Wed, 2017-10-11 at 08:19 +0300, Matan Barak wrote:
> But what about cases where UVERBS_OPTIMIZE_USING_STACK_SZ is defined but 
> is insufficient in size?

Sorry. How about the patch below? The most significant change compared to the
current code is that UVERBS_OPTIMIZE_USING_STACK_SZ has to be defined as 0
instead of not defining that macro to disable the optimization. A new change
is that this version uses gcc's support for zero-length arrays (which is an
extension of the C standard and is already used elsewhere in the kernel).


Subject: [PATCH] RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less
 confusing

This patch reduces the number of #ifdefs and also avoids that
smatch reports the following:

drivers/infiniband/core/uverbs_ioctl.c:276: ib_uverbs_cmd_verbs() warn: if statement not indented
drivers/infiniband/core/uverbs_ioctl.c:280: ib_uverbs_cmd_verbs() warn: possible memory leak of 'ctx'
drivers/infiniband/core/uverbs_ioctl.c:315: ib_uverbs_cmd_verbs() warn: if statement not indented

References: commit fac9658cabb9 ("IB/core: Add new ioctl interface")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Matan Barak <matanb@mellanox.com>
Cc: Yishai Hadas <yishaih@mellanox.com>
---
 drivers/infiniband/core/uverbs_ioctl.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c
index 5286ad57d903..71ff2644e053 100644
--- a/drivers/infiniband/core/uverbs_ioctl.c
+++ b/drivers/infiniband/core/uverbs_ioctl.c
@@ -241,9 +241,7 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
 	struct uverbs_attr *curr_attr;
 	unsigned long *curr_bitmap;
 	size_t ctx_size;
-#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
 	uintptr_t data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)];
-#endif
 
 	if (hdr->reserved)
 		return -EINVAL;
@@ -269,13 +267,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
 			(method_spec->num_child_attrs / BITS_PER_LONG +
 			 method_spec->num_buckets);
 
-#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
 	if (ctx_size <= UVERBS_OPTIMIZE_USING_STACK_SZ)
 		ctx = (void *)data;
-
 	if (!ctx)
-#endif
-	ctx = kmalloc(ctx_size, GFP_KERNEL);
+		ctx = kmalloc(ctx_size, GFP_KERNEL);
 	if (!ctx)
 		return -ENOMEM;
 
@@ -311,10 +306,8 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
 	err = uverbs_handle_method(buf, ctx->uattrs, hdr->num_attrs, ib_dev,
 				   file, method_spec, ctx->uverbs_attr_bundle);
 out:
-#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
-	if (ctx_size > UVERBS_OPTIMIZE_USING_STACK_SZ)
-#endif
-	kfree(ctx);
+	if (ctx != (void *)data)
+		kfree(ctx);
 	return err;
 }
 
-- 
2.14.2

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

* Re: [PATCH 42/47] IB/qib: Remove set-but-not-used variables
       [not found]             ` <1507668036.2815.55.camel-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-12  8:44               ` Leon Romanovsky
       [not found]                 ` <20171012084412.GO2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Leon Romanovsky @ 2017-10-12  8:44 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w,
	dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 997 bytes --]

On Tue, Oct 10, 2017 at 08:40:37PM +0000, Bart Van Assche wrote:
> On Tue, 2017-10-10 at 20:25 +0000, Marciniszyn, Mike wrote:
> > I'm curious about the kbuild modificaitons to expose these issues.
> > Did you add them yourself, or are they now upstream?
>
> Hello Mike,
>
> Thanks for the review. Is what you would like to know what build options
> I used to enable the warnings addressed by this patch series? What I did
> is to build the IB subsystem as follows:
>
> $ for opt in "W=1" "C=2" "C=2 CHECK='smatch -p=kernel'"; do make -j5 M=drivers/infiniband $opt; done
>

Bart,
I'm running more or less the same checks ( + "CHECK=sparse C=2") and for
a long time I'm trying to fix nes and orcdma endianess errors, but
without much luck. Did you look on them and plan to address in near
future?

Thanks

> Instructions for how to download the source code of sparse and smatch are
> available at:
> * https://sparse.wiki.kernel.org/index.php/Main_Page
> * http://smatch.sourceforge.net/
>
> Bart.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 42/47] IB/qib: Remove set-but-not-used variables
       [not found]                 ` <20171012084412.GO2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
@ 2017-10-12 15:45                   ` Bart Van Assche
       [not found]                     ` <1507823130.2448.16.camel-Sjgp3cTcYWE@public.gmane.org>
  0 siblings, 1 reply; 105+ messages in thread
From: Bart Van Assche @ 2017-10-12 15:45 UTC (permalink / raw)
  To: leon-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w,
	dledford-H+wXaHxf7aLQT0dZR+AlfA

On Thu, 2017-10-12 at 11:44 +0300, Leon Romanovsky wrote:
> I'm running more or less the same checks ( + "CHECK=sparse C=2") and for
> a long time I'm trying to fix nes and orcdma endianess errors, but
> without much luck. Did you look on them and plan to address in near
> future?

Hello Leon,

My experience is that for some drivers, e.g. drivers/scsi/qla2xxx, making
these endianness clean is a huge task. I prefer that the driver authors work
on this. I have been using the following patch to suppress complaints about
endianness issues for drivers that are not endianness clean:
https://lkml.org/lkml/2017/10/6/638.

Bart.

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

* Re: [PATCH 42/47] IB/qib: Remove set-but-not-used variables
       [not found]                     ` <1507823130.2448.16.camel-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-12 15:54                       ` Leon Romanovsky
  0 siblings, 0 replies; 105+ messages in thread
From: Leon Romanovsky @ 2017-10-12 15:54 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w,
	dledford-H+wXaHxf7aLQT0dZR+AlfA

[-- Attachment #1: Type: text/plain, Size: 754 bytes --]

On Thu, Oct 12, 2017 at 03:45:31PM +0000, Bart Van Assche wrote:
> On Thu, 2017-10-12 at 11:44 +0300, Leon Romanovsky wrote:
> > I'm running more or less the same checks ( + "CHECK=sparse C=2") and for
> > a long time I'm trying to fix nes and orcdma endianess errors, but
> > without much luck. Did you look on them and plan to address in near
> > future?
>
> Hello Leon,
>
> My experience is that for some drivers, e.g. drivers/scsi/qla2xxx, making
> these endianness clean is a huge task. I prefer that the driver authors work
> on this. I have been using the following patch to suppress complaints about
> endianness issues for drivers that are not endianness clean:
> https://lkml.org/lkml/2017/10/6/638.

Thanks, I'll try your approach.

>
> Bart.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 05/47] RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing
       [not found]                     ` <1507735840.2477.8.camel-Sjgp3cTcYWE@public.gmane.org>
@ 2017-10-15  7:37                       ` Matan Barak
  0 siblings, 0 replies; 105+ messages in thread
From: Matan Barak @ 2017-10-15  7:37 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	yishaih-VPRAkNaXOzVWk0Htik3J/w, dledford-H+wXaHxf7aLQT0dZR+AlfA

On 11/10/2017 18:30, Bart Van Assche wrote:
> On Wed, 2017-10-11 at 08:19 +0300, Matan Barak wrote:
>> But what about cases where UVERBS_OPTIMIZE_USING_STACK_SZ is defined but
>> is insufficient in size?
> 
> Sorry. How about the patch below? The most significant change compared to the
> current code is that UVERBS_OPTIMIZE_USING_STACK_SZ has to be defined as 0
> instead of not defining that macro to disable the optimization. A new change
> is that this version uses gcc's support for zero-length arrays (which is an
> extension of the C standard and is already used elsewhere in the kernel).
> 
> 
> Subject: [PATCH] RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less
>   confusing
> 
> This patch reduces the number of #ifdefs and also avoids that
> smatch reports the following:
> 
> drivers/infiniband/core/uverbs_ioctl.c:276: ib_uverbs_cmd_verbs() warn: if statement not indented
> drivers/infiniband/core/uverbs_ioctl.c:280: ib_uverbs_cmd_verbs() warn: possible memory leak of 'ctx'
> drivers/infiniband/core/uverbs_ioctl.c:315: ib_uverbs_cmd_verbs() warn: if statement not indented
> 
> References: commit fac9658cabb9 ("IB/core: Add new ioctl interface")
> Signed-off-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
> Cc: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Cc: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>   drivers/infiniband/core/uverbs_ioctl.c | 13 +++----------
>   1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c
> index 5286ad57d903..71ff2644e053 100644
> --- a/drivers/infiniband/core/uverbs_ioctl.c
> +++ b/drivers/infiniband/core/uverbs_ioctl.c
> @@ -241,9 +241,7 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
>   	struct uverbs_attr *curr_attr;
>   	unsigned long *curr_bitmap;
>   	size_t ctx_size;
> -#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
>   	uintptr_t data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)];
> -#endif
>   
>   	if (hdr->reserved)
>   		return -EINVAL;
> @@ -269,13 +267,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
>   			(method_spec->num_child_attrs / BITS_PER_LONG +
>   			 method_spec->num_buckets);
>   
> -#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
>   	if (ctx_size <= UVERBS_OPTIMIZE_USING_STACK_SZ)
>   		ctx = (void *)data;
> -
>   	if (!ctx)
> -#endif
> -	ctx = kmalloc(ctx_size, GFP_KERNEL);
> +		ctx = kmalloc(ctx_size, GFP_KERNEL);
>   	if (!ctx)
>   		return -ENOMEM;
>   
> @@ -311,10 +306,8 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
>   	err = uverbs_handle_method(buf, ctx->uattrs, hdr->num_attrs, ib_dev,
>   				   file, method_spec, ctx->uverbs_attr_bundle);
>   out:
> -#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ
> -	if (ctx_size > UVERBS_OPTIMIZE_USING_STACK_SZ)
> -#endif
> -	kfree(ctx);
> +	if (ctx != (void *)data)
> +		kfree(ctx);
>   	return err;
>   }
>   
> 

Simple and looks good to me. Thanks.
Acked-by: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2017-10-15  7:37 UTC | newest]

Thread overview: 105+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06 21:32 [PATCH 00/47] Address issues detected by static analysis tools Bart Van Assche
     [not found] ` <20171006213333.6721-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-06 21:32   ` [PATCH 01/47] IB/core: Fix endianness annotation in rdma_is_multicast_addr() Bart Van Assche
     [not found]     ` <20171006213333.6721-2-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-08 13:50       ` Leon Romanovsky
2017-10-06 21:32   ` [PATCH 02/47] IB/cm: Suppress gcc 7 fall-through complaints Bart Van Assche
     [not found]     ` <20171006213333.6721-3-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-06 22:03       ` Hefty, Sean
2017-10-10 19:27       ` Dennis Dalessandro
     [not found]         ` <849d304a-fa89-0d6a-6edb-cf34780e41a8-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-10-10 19:29           ` Hefty, Sean
2017-10-10 19:31           ` Leon Romanovsky
     [not found]             ` <20171010193127.GK2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-10 19:49               ` Dennis Dalessandro
2017-10-06 21:32   ` [PATCH 03/47] RDMA/cma: Avoid triggering undefined behavior Bart Van Assche
     [not found]     ` <20171006213333.6721-4-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-06 22:01       ` Hefty, Sean
2017-10-06 21:32   ` [PATCH 04/47] RDMA/iwcm: Remove a set-but-not-used variable Bart Van Assche
     [not found]     ` <20171006213333.6721-5-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-06 22:05       ` Steve Wise
2017-10-06 21:32   ` [PATCH 05/47] RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing Bart Van Assche
     [not found]     ` <20171006213333.6721-6-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-09  7:40       ` Matan Barak (External)
     [not found]         ` <64b5f415-7d56-3f17-0c8c-5d80ba89582c-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-10-09 17:27           ` Bart Van Assche
     [not found]             ` <1507570048.2674.17.camel-Sjgp3cTcYWE@public.gmane.org>
2017-10-11  5:19               ` Matan Barak
     [not found]                 ` <3a6adf24-3e60-7fd1-a119-37586793d374-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-10-11 15:30                   ` Bart Van Assche
     [not found]                     ` <1507735840.2477.8.camel-Sjgp3cTcYWE@public.gmane.org>
2017-10-15  7:37                       ` Matan Barak
2017-10-06 21:32   ` [PATCH 06/47] RDMA/isert: Suppress gcc 7 fall-through complaints Bart Van Assche
     [not found]     ` <20171006213333.6721-7-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-11 13:10       ` Sagi Grimberg
2017-10-06 21:32   ` [PATCH 07/47] RDMA/bnxt_re: " Bart Van Assche
2017-10-06 21:32   ` [PATCH 08/47] RDMA/bnxt_re: Remove set-but-not-used variables Bart Van Assche
2017-10-06 21:32   ` [PATCH 09/47] RDMA/cxgb3: Annotate locking assumptions Bart Van Assche
     [not found]     ` <20171006213333.6721-10-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-06 22:05       ` Steve Wise
2017-10-06 21:32   ` [PATCH 10/47] RDMA/cxgb3: Annotate an RCU pointer Bart Van Assche
     [not found]     ` <20171006213333.6721-11-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-06 22:06       ` Steve Wise
2017-10-06 21:32   ` [PATCH 11/47] RDMA/cxgb3: Remove a set-but-not-used variable Bart Van Assche
     [not found]     ` <20171006213333.6721-12-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-06 22:06       ` Steve Wise
2017-10-06 21:32   ` [PATCH 12/47] RDMA/cxgb4: Fix indentation Bart Van Assche
     [not found]     ` <20171006213333.6721-13-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-06 22:10       ` Steve Wise
2017-10-06 21:32   ` [PATCH 13/47] RDMA/cxgb4: Declare a local variable 'static' Bart Van Assche
     [not found]     ` <20171006213333.6721-14-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-06 22:09       ` Steve Wise
2017-10-09 23:20         ` Bart Van Assche
     [not found]           ` <1507591219.2674.58.camel-Sjgp3cTcYWE@public.gmane.org>
2017-10-10  3:59             ` Leon Romanovsky
     [not found]               ` <20171010035909.GI1252-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-10 16:16                 ` Bart Van Assche
2017-10-06 21:33   ` [PATCH 14/47] RDMA/cxgb4: Suppress gcc 7 fall-through complaints Bart Van Assche
     [not found]     ` <20171006213333.6721-15-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-06 22:08       ` Steve Wise
2017-10-06 21:33   ` [PATCH 15/47] RDMA/cxgb4: Remove a set-but-not-used variable Bart Van Assche
     [not found]     ` <20171006213333.6721-16-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-06 22:07       ` Steve Wise
2017-10-06 21:33   ` [PATCH 16/47] IB/hfi1: Suppress gcc 7 fall-through complaints Bart Van Assche
     [not found]     ` <20171006213333.6721-17-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-10 19:50       ` Dennis Dalessandro
2017-10-06 21:33   ` [PATCH 17/47] IB/hfi1: Remove set-but-not-used variables Bart Van Assche
     [not found]     ` <20171006213333.6721-18-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-11 13:45       ` Dennis Dalessandro
2017-10-06 21:33   ` [PATCH 18/47] IB/hfi1: Define hfi1_handle_cnp_tbl[] once Bart Van Assche
     [not found]     ` <20171006213333.6721-19-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-11 13:54       ` Dennis Dalessandro
2017-10-06 21:33   ` [PATCH 19/47] IB/hns: Annotate iomem pointers correctly Bart Van Assche
     [not found]     ` <20171006213333.6721-20-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-08 13:42       ` Leon Romanovsky
     [not found]         ` <20171008134219.GB25829-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-09 17:10           ` Bart Van Assche
2017-10-06 21:33   ` [PATCH 20/47] IB/hns: Declare local functions 'static' Bart Van Assche
     [not found]     ` <20171006213333.6721-21-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-08 13:44       ` Leon Romanovsky
2017-10-06 21:33   ` [PATCH 21/47] RDMA/i40iw: Fix a race condition Bart Van Assche
     [not found]     ` <20171006213333.6721-22-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-09 22:04       ` Shiraz Saleem
2017-10-06 21:33   ` [PATCH 22/47] RDMA/i40iw: Suppress gcc 7 fall-through complaints Bart Van Assche
     [not found]     ` <20171006213333.6721-23-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-09 22:04       ` Shiraz Saleem
2017-10-06 21:33   ` [PATCH 23/47] RDMA/i40iw: Remove a set-but-not-used variable Bart Van Assche
     [not found]     ` <20171006213333.6721-24-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-09 22:05       ` Shiraz Saleem
2017-10-06 21:33   ` [PATCH 24/47] IB/mthca: Fix indentation Bart Van Assche
2017-10-06 21:33   ` [PATCH 25/47] IB/mlx4: Suppress gcc 7 fall-through complaints Bart Van Assche
     [not found]     ` <20171006213333.6721-26-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-08  7:50       ` Leon Romanovsky
2017-10-06 21:33   ` [PATCH 26/47] IB/mlx5: " Bart Van Assche
     [not found]     ` <20171006213333.6721-27-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-08  7:55       ` Leon Romanovsky
2017-10-06 21:33   ` [PATCH 27/47] IB/mlx5: Remove a set-but-not-used variable Bart Van Assche
     [not found]     ` <20171006213333.6721-28-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-08  7:55       ` Leon Romanovsky
2017-10-06 21:33   ` [PATCH 28/47] IB/nes: Fix indentation Bart Van Assche
2017-10-06 21:33   ` [PATCH 29/47] IB/nes: Suppress gcc 7 fall-through complaints Bart Van Assche
2017-10-06 21:33   ` [PATCH 30/47] IB/nes: Remove set-but-not-used variables Bart Van Assche
2017-10-06 21:33   ` [PATCH 31/47] IB/nes: Fix a race condition in nes_inetaddr_event() Bart Van Assche
2017-10-06 21:33   ` [PATCH 32/47] RDMA/ocrdma: Use NULL instead of 0 to represent a pointer Bart Van Assche
2017-10-06 21:33   ` [PATCH 33/47] RDMA/ocrdma: Suppress gcc 7 fall-through complaints Bart Van Assche
2017-10-06 21:33   ` [PATCH 34/47] RDMA/ocrdma: Remove set-but-not-used variables Bart Van Assche
2017-10-06 21:33   ` [PATCH 35/47] IB/opa: Fix endianness annotation of opa_is_extended_lid() Bart Van Assche
     [not found]     ` <20171006213333.6721-36-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-11 13:59       ` Dennis Dalessandro
2017-10-06 21:33   ` [PATCH 36/47] RDMA/qedr: Use NULL instead of 0 to represent a pointer Bart Van Assche
2017-10-06 21:33   ` [PATCH 37/47] RDMA/qedr: Declare local functions static Bart Van Assche
2017-10-06 21:33   ` [PATCH 38/47] RDMA/qedr: Annotate iomem pointers correctly Bart Van Assche
2017-10-06 21:33   ` [PATCH 39/47] RDMA/qedr: Remove set-but-not-used variables Bart Van Assche
2017-10-06 21:33   ` [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use Bart Van Assche
     [not found]     ` <20171006213333.6721-41-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-10 14:15       ` Marciniszyn, Mike
     [not found]         ` <32E1700B9017364D9B60AED9960492BC3442AAD2-RjuIdWtd+YbTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-10-10 15:08           ` Bart Van Assche
     [not found]             ` <1507648081.2815.5.camel-Sjgp3cTcYWE@public.gmane.org>
2017-10-10 15:36               ` Marciniszyn, Mike
     [not found]                 ` <32E1700B9017364D9B60AED9960492BC3442ADF5-RjuIdWtd+YbTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-10-10 17:59                   ` Bart Van Assche
     [not found]                     ` <1507658390.2815.48.camel-Sjgp3cTcYWE@public.gmane.org>
2017-10-10 18:08                       ` Leon Romanovsky
     [not found]                         ` <20171010180809.GI2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-10 18:25                           ` Bart Van Assche
     [not found]                             ` <1507659918.2815.50.camel-Sjgp3cTcYWE@public.gmane.org>
2017-10-10 18:33                               ` Leon Romanovsky
2017-10-10 20:40                               ` Marciniszyn, Mike
2017-10-06 21:33   ` [PATCH 41/47] IB/qib: Suppress gcc 7 fall-through complaints Bart Van Assche
     [not found]     ` <20171006213333.6721-42-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-10 13:56       ` Marciniszyn, Mike
     [not found]         ` <32E1700B9017364D9B60AED9960492BC3442AA1D-RjuIdWtd+YbTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-10-10 15:07           ` Bart Van Assche
2017-10-06 21:33   ` [PATCH 42/47] IB/qib: Remove set-but-not-used variables Bart Van Assche
     [not found]     ` <20171006213333.6721-43-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-10 20:25       ` Marciniszyn, Mike
     [not found]         ` <32E1700B9017364D9B60AED9960492BC3442B95A-RjuIdWtd+YbTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-10-10 20:40           ` Bart Van Assche
     [not found]             ` <1507668036.2815.55.camel-Sjgp3cTcYWE@public.gmane.org>
2017-10-12  8:44               ` Leon Romanovsky
     [not found]                 ` <20171012084412.GO2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-12 15:45                   ` Bart Van Assche
     [not found]                     ` <1507823130.2448.16.camel-Sjgp3cTcYWE@public.gmane.org>
2017-10-12 15:54                       ` Leon Romanovsky
2017-10-06 21:33   ` [PATCH 43/47] RDMA/rdmavt: Suppress gcc 7 fall-through complaints Bart Van Assche
     [not found]     ` <20171006213333.6721-44-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-10 19:51       ` Dennis Dalessandro
2017-10-06 21:33   ` [PATCH 44/47] RDMA/rxe: " Bart Van Assche
     [not found]     ` <20171006213333.6721-45-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2017-10-08 13:45       ` Leon Romanovsky
2017-10-06 21:33   ` [PATCH 45/47] RDMA/usnic: Make the compiler check declaration consistency during compilation Bart Van Assche
2017-10-06 21:33   ` [PATCH 46/47] RDMA/usnic: Remove a set-but-not-used variable Bart Van Assche
2017-10-06 21:33   ` [PATCH 47/47] RDMA/usnic: Instantiate data structures once Bart Van Assche
2017-10-09 16:51   ` [PATCH 00/47] Address issues detected by static analysis tools Doug Ledford
     [not found]     ` <1507567892.46071.44.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-10-11 14:03       ` Dennis Dalessandro
     [not found]         ` <5d2b3adc-1a19-8acf-9915-d97296be9079-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-10-11 14:55           ` Bart Van Assche

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.