Skip to content

Commit 7c2baed

Browse files
Jiri Slaby (SUSE)smb49
authored andcommitted
RDMA/srp: Move large values to a new enum for gcc13
BugLink: https://bugs.launchpad.net/bugs/2008946 [ Upstream commit 56c5dab ] 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> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 7c319b4 commit 7c2baed

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/infiniband/ulp/srp/ib_srp.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ enum {
6363
SRP_DEFAULT_CMD_SQ_SIZE = SRP_DEFAULT_QUEUE_SIZE - SRP_RSP_SQ_SIZE -
6464
SRP_TSK_MGMT_SQ_SIZE,
6565

66-
SRP_TAG_NO_REQ = ~0U,
67-
SRP_TAG_TSK_MGMT = 1U << 31,
68-
6966
SRP_MAX_PAGES_PER_MR = 512,
7067

7168
SRP_MAX_ADD_CDB_LEN = 16,
@@ -80,6 +77,11 @@ enum {
8077
sizeof(struct srp_imm_buf),
8178
};
8279

80+
enum {
81+
SRP_TAG_NO_REQ = ~0U,
82+
SRP_TAG_TSK_MGMT = BIT(31),
83+
};
84+
8385
enum srp_target_state {
8486
SRP_TARGET_SCANNING,
8587
SRP_TARGET_LIVE,

0 commit comments

Comments
 (0)