public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <jejb@linux.vnet.ibm.com>
To: Bart Van Assche <bvanassche@acm.org>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Lee Duncan <lduncan@suse.com>, Chris Leech <cleech@redhat.com>
Subject: Re: [PATCH 09/20] iscsi: Suppress two clang format mismatch warnings
Date: Tue, 13 Apr 2021 10:59:30 -0700	[thread overview]
Message-ID: <605ae0b2be96ccaf15dc515dd67b4f32b289ba92.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <20210413170714.2119-10-bvanassche@acm.org>

On Tue, 2021-04-13 at 10:07 -0700, Bart Van Assche wrote:
> Suppress two instances of the following clang compiler warning:
> 
> warning: format specifies type 'unsigned short'
>       but the argument has type 'int' [-Wformat]
> 
> Cc: Lee Duncan <lduncan@suse.com>
> Cc: Chris Leech <cleech@redhat.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  drivers/scsi/libiscsi.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
> index 7ad11e42306d..0c3082d09712 100644
> --- a/drivers/scsi/libiscsi.c
> +++ b/drivers/scsi/libiscsi.c
> @@ -3587,10 +3587,11 @@ int iscsi_conn_get_addr_param(struct
> sockaddr_storage *addr,
>  	case ISCSI_PARAM_CONN_PORT:
>  	case ISCSI_PARAM_LOCAL_PORT:
>  		if (sin)
> -			len = sprintf(buf, "%hu\n", be16_to_cpu(sin-
> >sin_port));
> +			len = sprintf(buf, "%hu\n",
> +				      (u16)be16_to_cpu(sin->sin_port));
>  		else
>  			len = sprintf(buf, "%hu\n",
> -				      be16_to_cpu(sin6->sin6_port));
> +				      (u16)be16_to_cpu(sin6-
> 

This looks odd: the generic definition of be16_to_cpu on le is

#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))

and __swab16 is

#define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))

So why doesn't clang see the existing __u16 as short?  This smells like
a problem in the compiler file.

James



  reply	other threads:[~2021-04-13 17:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 17:06 [PATCH 00/20] SCSI patches for kernel v5.13 Bart Van Assche
2021-04-13 17:06 ` [PATCH 01/20] Make the scsi_alloc_sgtables() documentation more accurate Bart Van Assche
2021-04-13 17:06 ` [PATCH 02/20] Remove an incorrect comment Bart Van Assche
2021-04-13 17:06 ` [PATCH 03/20] Rename scsi_softirq_done() into scsi_complete() Bart Van Assche
2021-04-13 17:06 ` [PATCH 04/20] Modify the scsi_send_eh_cmnd() return value for the SDEV_BLOCK case Bart Van Assche
2021-04-13 17:06 ` [PATCH 05/20] Introduce enum scsi_disposition Bart Van Assche
2021-04-13 17:07 ` [PATCH 06/20] aacraid: Remove an unused function Bart Van Assche
2021-04-13 17:07 ` [PATCH 07/20] libfc: Fix a format specifier Bart Van Assche
2021-04-13 17:07 ` [PATCH 08/20] fcoe: Suppress a compiler warning Bart Van Assche
2021-04-13 17:07 ` [PATCH 09/20] iscsi: Suppress two clang format mismatch warnings Bart Van Assche
2021-04-13 17:59   ` James Bottomley [this message]
2021-04-13 18:57     ` Bart Van Assche
2021-04-13 17:07 ` [PATCH 10/20] mpt3sas: Fix two kernel-doc headers Bart Van Assche
2021-04-13 17:07 ` [PATCH 11/20] myrb: Remove unused functions Bart Van Assche
2021-04-13 17:07 ` [PATCH 12/20] myrs: " Bart Van Assche
2021-04-13 17:07 ` [PATCH 13/20] qla4xxx: Remove an unused function Bart Van Assche
2021-04-13 17:07 ` [PATCH 14/20] smartpqi: Remove unused functions Bart Van Assche
2021-04-13 17:07 ` [PATCH 15/20] 53c700: Open-code status_byte(u8) calls Bart Van Assche
2021-04-13 17:07 ` [PATCH 16/20] dc395x: " Bart Van Assche
2021-04-13 17:07 ` [PATCH 17/20] sd: Introduce a new local variable in sd_check_events() Bart Van Assche
2021-04-13 17:07 ` [PATCH 18/20] target: Compare explicitly with SAM_STAT_GOOD Bart Van Assche
2021-04-13 17:40   ` Mike Christie
2021-04-13 17:07 ` [PATCH 19/20] target: Fix several format specifiers Bart Van Assche
2021-04-13 17:47   ` Mike Christie
2021-04-13 18:19     ` Bart Van Assche
2021-04-13 17:07 ` [PATCH 20/20] target/tcm_fc: Fix a kernel-doc header Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=605ae0b2be96ccaf15dc515dd67b4f32b289ba92.camel@linux.vnet.ibm.com \
    --to=jejb@linux.vnet.ibm.com \
    --cc=bvanassche@acm.org \
    --cc=cleech@redhat.com \
    --cc=hch@lst.de \
    --cc=jejb@linux.ibm.com \
    --cc=lduncan@suse.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox