diff mbox series

[09/20] iscsi: Suppress two clang format mismatch warnings

Message ID 20210413170714.2119-10-bvanassche@acm.org
State New
Headers show
Series SCSI patches for kernel v5.13 | expand

Commit Message

Bart Van Assche April 13, 2021, 5:07 p.m. UTC
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 mbox series

Patch

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->sin6_port));
 		break;
 	default:
 		return -EINVAL;