mirror-linux/drivers/infiniband/ulp
Jiri Slaby (SUSE) 307e8d9eef RDMA/srp: Move large values to a new enum for gcc13
[ Upstream commit 56c5dab20a ]

Since gcc13, each member of an enum has the same type as the enum [1]. And
that is inherited from its members. Provided these two:
  SRP_TAG_NO_REQ        = ~0U,
  SRP_TAG_TSK_MGMT	= 1U << 31
all other members are unsigned ints.

Esp. with SRP_MAX_SGE and SRP_TSK_MGMT_SQ_SIZE and their use in min(),
this results in the following warnings:
  include/linux/minmax.h:20:35: error: comparison of distinct pointer types lacks a cast
  drivers/infiniband/ulp/srp/ib_srp.c:563:42: note: in expansion of macro 'min'

  include/linux/minmax.h:20:35: error: comparison of distinct pointer types lacks a cast
  drivers/infiniband/ulp/srp/ib_srp.c:2369:27: note: in expansion of macro 'min'

So move the large values away to a separate enum, so that they don't
affect other members.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36113

Link: https://lore.kernel.org/r/20221212120411.13750-1-jirislaby@kernel.org
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-01-24 07:24:31 +01:00
..
ipoib IB/IPoIB: Fix queue count inconsistency for PKEY child interfaces 2022-12-31 13:32:38 +01:00
iser IB/iser: Fix login with authentication 2022-08-16 15:56:33 +03:00
isert v5.19 pull request 2022-05-26 21:08:40 -07:00
opa_vnic IB: move from strlcpy with unused retval to strscpy 2022-08-21 14:18:02 +03:00
rtrs treewide: use prandom_u32_max() when possible, part 1 2022-10-11 17:42:55 -06:00
srp RDMA/srp: Move large values to a new enum for gcc13 2023-01-24 07:24:31 +01:00
srpt RDMA/srpt: Use flex array destination for memcpy() 2022-09-20 15:05:29 +03:00
Makefile RDMA/rtrs: include client and server modules into kernel compilation 2020-05-17 18:57:15 -03:00