Skip to content

Commit ec6a178

Browse files
arndbgregkh
authored andcommitted
RDMa/mthca: Work around -Wenum-conversion warning
[ Upstream commit fbb7dc5 ] gcc points out a suspicious mixing of enum types in a function that converts from MTHCA_OPCODE_* values to IB_WC_* values: drivers/infiniband/hw/mthca/mthca_cq.c: In function 'mthca_poll_one': drivers/infiniband/hw/mthca/mthca_cq.c:607:21: warning: implicit conversion from 'enum <anonymous>' to 'enum ib_wc_opcode' [-Wenum-conversion] 607 | entry->opcode = MTHCA_OPCODE_INVALID; Nothing seems to ever check for MTHCA_OPCODE_INVALID again, no idea if this is meaningful, but it seems harmless as it deals with an invalid input. Remove MTHCA_OPCODE_INVALID and set the ib_wc_opcode to 0xFF, which is still bogus, but at least doesn't make compiler warnings. Fixes: 2a4443a ("[PATCH] IB/mthca: fill in opcode field for send completions") Link: https://lore.kernel.org/r/20201026211311.3887003-1-arnd@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 81d23c1 commit ec6a178

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

‎drivers/infiniband/hw/mthca/mthca_cq.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ static inline int mthca_poll_one(struct mthca_dev *dev,
604604
entry->byte_len = MTHCA_ATOMIC_BYTE_LEN;
605605
break;
606606
default:
607-
entry->opcode = MTHCA_OPCODE_INVALID;
607+
entry->opcode = 0xFF;
608608
break;
609609
}
610610
} else {

‎drivers/infiniband/hw/mthca/mthca_dev.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ enum {
105105
MTHCA_OPCODE_ATOMIC_CS = 0x11,
106106
MTHCA_OPCODE_ATOMIC_FA = 0x12,
107107
MTHCA_OPCODE_BIND_MW = 0x18,
108-
MTHCA_OPCODE_INVALID = 0xff
109108
};
110109

111110
enum {

0 commit comments

Comments
 (0)