linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libfc: fix enum-conversion warning
@ 2020-10-26 21:49 Arnd Bergmann
  2020-10-30  1:52 ` Martin K. Petersen
  2020-11-05  4:21 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2020-10-26 21:49 UTC (permalink / raw)
  To: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen,
	James Bottomley, Robert Love
  Cc: Arnd Bergmann, Gustavo A. R. Silva, Lee Jones, linux-scsi, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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.

Fixes: 42e9a92fe6a9 ("[SCSI] libfc: A modular Fibre Channel library")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/libfc/fc_exch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index 91e680b53523..d71afae6191c 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -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.
-- 
2.27.0


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

* Re: [PATCH] libfc: fix enum-conversion warning
  2020-10-26 21:49 [PATCH] libfc: fix enum-conversion warning Arnd Bergmann
@ 2020-10-30  1:52 ` Martin K. Petersen
  2020-11-05  4:21 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2020-10-30  1:52 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen,
	James Bottomley, Robert Love, Arnd Bergmann, Gustavo A. R. Silva,
	Lee Jones, linux-scsi, linux-kernel


Arnd,

> gcc -Wextra points out an assignment between two different
> enum types:

Applied to 5.11/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] libfc: fix enum-conversion warning
  2020-10-26 21:49 [PATCH] libfc: fix enum-conversion warning Arnd Bergmann
  2020-10-30  1:52 ` Martin K. Petersen
@ 2020-11-05  4:21 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2020-11-05  4:21 UTC (permalink / raw)
  To: Arnd Bergmann, Hannes Reinecke, Robert Love,
	James E.J. Bottomley, James Bottomley
  Cc: Martin K . Petersen, Gustavo A. R. Silva, Arnd Bergmann,
	Lee Jones, linux-scsi, linux-kernel

On Mon, 26 Oct 2020 22:49:07 +0100, Arnd Bergmann wrote:

> 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.

Applied to 5.11/scsi-queue, thanks!

[1/1] scsi: libfc: Fix enum-conversion warning
      https://git.kernel.org/mkp/scsi/c/3fb52041a832

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2020-11-05  4:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 21:49 [PATCH] libfc: fix enum-conversion warning Arnd Bergmann
2020-10-30  1:52 ` Martin K. Petersen
2020-11-05  4:21 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).