Skip to contentSkip to conversation

print u64 with %llu

PATCH New Honggang Li 1 participant 3 messages Aug 19, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 print u64 with %llu

There are printk format issue and coding style issue for the lines changed by this patch. This patch only fix the format issue. Please take those coding style errors as false positives for this patch.

[real@name linux-next]$ scripts/checkpatch.pl outgoing2/0001-staging-unisys-virthba-virthba.c-print-u64-with-llu.patch
WARNING: line over 80 characters
#45: FILE: drivers/staging/unisys/virthba/virthba.c:520:
+ LOGINF("scsihost->max_channel=%u, max_id=%u, max_lun=%llu, cmd_per_lun=%u, max_sectors=%hu, sg_tablesize=%hu\n",

WARNING: line over 80 characters
#63: FILE: drivers/staging/unisys/virthba/virthba.c:1142:
+ LOGERR("SCSICMD ****FAILED scsicmd:0x%p op:0x%x <%d:%d:%d:%llu> 0x%x-0x%x-0x%x-0x%x-0x%x.\n",

WARNING: line over 80 characters
#72: FILE: drivers/staging/unisys/virthba/virthba.c:1151:
+ LOGERR("Throtling SCSICMD errors disk <%d:%d:%d:%llu>\n",

total: 0 errors, 3 warnings, 32 lines checked

outgoing2/0001-staging-unisys-virthba-virthba.c-print-u64-with-llu.patch has style problems, please review.

If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. [real@name linux-next]$

Honggang Li (1):
staging: unisys/virthba/virthba.c print u64 with %llu

 drivers/staging/unisys/virthba/virthba.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 print u64 with %llu

There are printk format issue and coding style issue for the lines changed by this patch. This patch only fix the format issue. Please take those coding style errors as false positives for this patch.

Honggang Li (1):
staging: unisys/virthba/virthba.c print u64 with %llu

 drivers/staging/unisys/virthba/virthba.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 1/1 staging: unisys/virthba/virthba.c print u64 with %llu

In reply to Honggang Li

drivers/staging/unisys/virthba/virthba.c:520:2: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘u64’ [-Wformat=]
drivers/staging/unisys/virthba/virthba.c:749:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘u64’ [-Wformat=] drivers/staging/unisys/virthba/virthba.c:1142:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 7 has type ‘u64’ [-Wformat=] drivers/staging/unisys/virthba/virthba.c:1151:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘u64’ [-Wformat=]

After apply the patch:
linux-next]$ make C=1 drivers/staging/unisys/virthba/virthba.o

  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CHECK   drivers/staging/unisys/virthba/virthba.c
  CC [M]  drivers/staging/unisys/virthba/virthba.o
---
 drivers/staging/unisys/virthba/virthba.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/unisys/virthba/virthba.c +4 -4
index 049eeab..53615df 100644
@@ -517,7 +517,7 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id)
 	    (unsigned short) (virtpcidev->scsi.max.max_io_size / PAGE_SIZE);
 	if (scsihost->sg_tablesize > MAX_PHYS_INFO)
 		scsihost->sg_tablesize = MAX_PHYS_INFO;
-	LOGINF("scsihost->max_channel=%u, max_id=%u, max_lun=%u, cmd_per_lun=%u, max_sectors=%hu, sg_tablesize=%hu\n",
+	LOGINF("scsihost->max_channel=%u, max_id=%u, max_lun=%llu, cmd_per_lun=%u, max_sectors=%hu, sg_tablesize=%hu\n",
 	     scsihost->max_channel, scsihost->max_id, scsihost->max_lun,
 	     scsihost->cmd_per_lun, scsihost->max_sectors,
 	     scsihost->sg_tablesize);
@@ -746,7 +746,7 @@ forward_taskmgmt_command(TASK_MGMT_TYPES tasktype, struct scsi_device *scsidev)
 	int notifyresult = 0xffff;
 	wait_queue_head_t notifyevent;
 
-	LOGINF("TaskMgmt:%d %d:%d:%d\n", tasktype,
+	LOGINF("TaskMgmt:%d %d:%d:%llu\n", tasktype,
 	       scsidev->channel, scsidev->id, scsidev->lun);
 
 	if (virthbainfo->serverdown || virthbainfo->serverchangingstate) {
@@ -1139,7 +1139,7 @@ do_scsi_linuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd)
 
 		if (atomic_read(&vdisk->error_count) < VIRTHBA_ERROR_COUNT) {
 			atomic_inc(&vdisk->error_count);
-			LOGERR("SCSICMD ****FAILED scsicmd:0x%p op:0x%x <%d:%d:%d:%d> 0x%x-0x%x-0x%x-0x%x-0x%x.\n",
+			LOGERR("SCSICMD ****FAILED scsicmd:0x%p op:0x%x <%d:%d:%d:%llu> 0x%x-0x%x-0x%x-0x%x-0x%x.\n",
 			       scsicmd, cmdrsp->scsi.cmnd[0],
 			       scsidev->host->host_no, scsidev->id,
 			       scsidev->channel, scsidev->lun,
@@ -1148,7 +1148,7 @@ do_scsi_linuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd)
 			       sd->AdditionalSenseCodeQualifier);
 			if (atomic_read(&vdisk->error_count) ==
 			    VIRTHBA_ERROR_COUNT) {
-				LOGERR("Throtling SCSICMD errors disk <%d:%d:%d:%d>\n",
+				LOGERR("Throtling SCSICMD errors disk <%d:%d:%d:%llu>\n",
 				     scsidev->host->host_no, scsidev->id,
 				     scsidev->channel, scsidev->lun);
 			}
Signature · 1 line
1.8.3.1