Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: esas2r: Fix format string type mistakes

This adds the missing __printf attribute which allows compile time
format string checking (and will be used by the coming initify gcc
plugin). Additionally, this fixes the warnings exposed by the attribute.

Signed-off-by: Emese Revfy <re.emese@gmail.com>
[kees: split scsi/acpi, merged attr and fix, new commit messages]
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Emese Revfy and committed by
Martin K. Petersen
b6f0ec36 eab5c150

+6 -6
+1 -1
drivers/scsi/esas2r/esas2r_init.c
··· 237 237 flags |= IRQF_SHARED; 238 238 239 239 esas2r_log(ESAS2R_LOG_INFO, 240 - "esas2r_claim_interrupts irq=%d (%p, %s, %x)", 240 + "esas2r_claim_interrupts irq=%d (%p, %s, %lx)", 241 241 a->pcid->irq, a, a->name, flags); 242 242 243 243 if (request_irq(a->pcid->irq,
+1 -1
drivers/scsi/esas2r/esas2r_ioctl.c
··· 1301 1301 ioctl = kzalloc(sizeof(struct atto_express_ioctl), GFP_KERNEL); 1302 1302 if (ioctl == NULL) { 1303 1303 esas2r_log(ESAS2R_LOG_WARN, 1304 - "ioctl_handler kzalloc failed for %d bytes", 1304 + "ioctl_handler kzalloc failed for %zu bytes", 1305 1305 sizeof(struct atto_express_ioctl)); 1306 1306 return -ENOMEM; 1307 1307 }
+2 -2
drivers/scsi/esas2r/esas2r_log.h
··· 61 61 #endif 62 62 }; 63 63 64 - int esas2r_log(const long level, const char *format, ...); 65 - int esas2r_log_dev(const long level, 64 + __printf(2, 3) int esas2r_log(const long level, const char *format, ...); 65 + __printf(3, 4) int esas2r_log_dev(const long level, 66 66 const struct device *dev, 67 67 const char *format, 68 68 ...);
+2 -2
drivers/scsi/esas2r/esas2r_main.c
··· 198 198 GFP_KERNEL); 199 199 if (a->local_atto_ioctl == NULL) { 200 200 esas2r_log(ESAS2R_LOG_WARN, 201 - "write_hw kzalloc failed for %d bytes", 201 + "write_hw kzalloc failed for %zu bytes", 202 202 sizeof(struct atto_ioctl)); 203 203 return -ENOMEM; 204 204 } ··· 1186 1186 } else { 1187 1187 esas2r_log(ESAS2R_LOG_CRIT, 1188 1188 "unable to allocate a request for a " 1189 - "device reset (%d:%d)!", 1189 + "device reset (%d:%llu)!", 1190 1190 cmd->device->id, 1191 1191 cmd->device->lun); 1192 1192 }