libfc: fix enum-conversion warning
Subsystems (2)
PATCH 1/1 libfc: fix enum-conversion warning
From: Arnd Bergmann <[email protected]>
gcc -Wextra points out an assignment between two different enum types:
drivers/scsi/libfc/fc_exch.c: In function 'fc_exch_setup_hdr':../drivers/scsi/libfc/fc_exch.c:275:26: warning: implicit conversion from 'enum fc_class' to 'enum fc_sof' [-Wenum-conversion]
This seems to be intentional, as the same numeric values are used here, so shut up the warning by adding an explicit cast.
--- drivers/scsi/libfc/fc_exch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/libfc/fc_exch.c +1 -1
@@ -271,7 +271,7 @@ static void fc_exch_setup_hdr(struct fc_exch *ep, struct fc_frame *fp,if (f_ctl &FC_FC_END_SEQ ) {fr_eof (fp) =FC_EOF_T ; -if (fc_sof_needs_ack (ep->class)) +if (fc_sof_needs_ack ((enum fc_sof )ep->class))fr_eof (fp) =FC_EOF_N ;/* * From F_CTL.
Signature · 1 line
2.27.0
Martin K. Petersen
AppliedArnd,
Quoted 2 lines
gcc -Wextra points out an assignment between two different enum types:
Applied to 5.11/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 8 lines · Arnd Bergmann
gcc -Wextra points out an assignment between two different enum types:
drivers/scsi/libfc/fc_exch.c: In function 'fc_exch_setup_hdr':../drivers/scsi/libfc/fc_exch.c:275:26: warning: implicit conversion from 'enumfc_class' to 'enumfc_sof' [-Wenum-conversion]This seems to be intentional, as the same numeric values are used here, so shut up the warning by adding an explicit cast.
Applied to 5.11/scsi-queue, thanks!
[1/1] scsi: libfc: Fix enum-conversion warning
https://git.kernel.org/mkp/scsi/c/3fb52041a832
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering