Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1550313
| Path | csiph.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Kees Cook <keescook@chromium.org> |
| Newsgroups | linux.kernel |
| Subject | [PATCH v2] scsi: esas2r: Fix format string type mistakes |
| Date | Wed, 04 Jan 2017 01:10:02 +0100 |
| Message-ID | <sVHjs-5la-11@gated-at.bofh.it> (permalink) |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=Nrg/7F+MmXx6EeDBRv0FrcIVCFAq60YxWR73sNXxZQM=; b=cViTUlw9Ni+KVZc+sKesbWFBidn38g/6bCKqmRypZtWhl//UI9Nz9sC53TgXXb8uZk yuCKaRAO9U+hWRi1yHDa1YUIvDD7NythDM1VeWRjlXZHZXdI7meqO6HxyoDxrJg1smYM B6lv7ZDpJzgYKw+lEeNCDhLzfs4R73H8FDHTY= |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=Nrg/7F+MmXx6EeDBRv0FrcIVCFAq60YxWR73sNXxZQM=; b=UMz8gAoiIWpMGJh5q0E1U3Ciq+RV343Pev+3kYpS20vvyxxhIKnXaJbj3EYnXTCrMZ phcHhjcKUGr544D5lgATVjPtbel0RFbUrLktbzVpoZMfEOA9VIAbCSzXuasikQcX2MMC 9graJs5htnUjfPhHupGi6TMpW1zdKWZNSyCfGqF7+FaR4sO25pRZrKgSBWHCMcbjebco yeYGuwqkzxjxhSyUvhDu7IgMKBgV60TsRv0+4Fm92npzFZYgc5atdp6CeoUGpNhzrOsS NnUHJD5g8PWsg9Gpp9UG4OTCzV7/hCNwwhaRPd+lrD05rwmf0PQ4gRbNcdRnrtIXbejs GWLg== |
| X-Gm-Message-State | AIkVDXIO4eB3/LKUNMNj6JESGjkBrnSuCF0yhpo6VHzrzE/ly9S+lTU5A6/qFMv7odb7WPGU |
| X-Received | by 10.84.179.67 with SMTP id a61mr137718964plc.98.1483488102877; Tue, 03 Jan 2017 16:01:42 -0800 (PST) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 89 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Bradley Grove <linuxdrivers@attotech.com>, "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>, "Martin K. Petersen" <martin.petersen@oracle.com>, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Emese Revfy <re.emese@gmail.com> |
| X-Original-Date | Tue, 3 Jan 2017 16:01:40 -0800 |
| X-Original-Message-ID | <20170104000140.GA120826@beast> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1550313 |
Show key headers only | View raw
From: Emese Revfy <re.emese@gmail.com>
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>
---
v2:
- fix %lu to %zu on sizeof() values, bart
---
drivers/scsi/esas2r/esas2r_init.c | 2 +-
drivers/scsi/esas2r/esas2r_ioctl.c | 2 +-
drivers/scsi/esas2r/esas2r_log.h | 4 ++--
drivers/scsi/esas2r/esas2r_main.c | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c
index d6e53aee2295..6432a50b26d8 100644
--- a/drivers/scsi/esas2r/esas2r_init.c
+++ b/drivers/scsi/esas2r/esas2r_init.c
@@ -237,7 +237,7 @@ static void esas2r_claim_interrupts(struct esas2r_adapter *a)
flags |= IRQF_SHARED;
esas2r_log(ESAS2R_LOG_INFO,
- "esas2r_claim_interrupts irq=%d (%p, %s, %x)",
+ "esas2r_claim_interrupts irq=%d (%p, %s, %lx)",
a->pcid->irq, a, a->name, flags);
if (request_irq(a->pcid->irq,
diff --git a/drivers/scsi/esas2r/esas2r_ioctl.c b/drivers/scsi/esas2r/esas2r_ioctl.c
index 3e8483410f61..b35ed3829421 100644
--- a/drivers/scsi/esas2r/esas2r_ioctl.c
+++ b/drivers/scsi/esas2r/esas2r_ioctl.c
@@ -1301,7 +1301,7 @@ int esas2r_ioctl_handler(void *hostdata, int cmd, void __user *arg)
ioctl = kzalloc(sizeof(struct atto_express_ioctl), GFP_KERNEL);
if (ioctl == NULL) {
esas2r_log(ESAS2R_LOG_WARN,
- "ioctl_handler kzalloc failed for %d bytes",
+ "ioctl_handler kzalloc failed for %zu bytes",
sizeof(struct atto_express_ioctl));
return -ENOMEM;
}
diff --git a/drivers/scsi/esas2r/esas2r_log.h b/drivers/scsi/esas2r/esas2r_log.h
index 7b6397bb5b94..75b9d23cd736 100644
--- a/drivers/scsi/esas2r/esas2r_log.h
+++ b/drivers/scsi/esas2r/esas2r_log.h
@@ -61,8 +61,8 @@ enum {
#endif
};
-int esas2r_log(const long level, const char *format, ...);
-int esas2r_log_dev(const long level,
+__printf(2, 3) int esas2r_log(const long level, const char *format, ...);
+__printf(3, 4) int esas2r_log_dev(const long level,
const struct device *dev,
const char *format,
...);
diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c
index 5092c821d088..f2e9d8aa979c 100644
--- a/drivers/scsi/esas2r/esas2r_main.c
+++ b/drivers/scsi/esas2r/esas2r_main.c
@@ -198,7 +198,7 @@ static ssize_t write_hw(struct file *file, struct kobject *kobj,
GFP_KERNEL);
if (a->local_atto_ioctl == NULL) {
esas2r_log(ESAS2R_LOG_WARN,
- "write_hw kzalloc failed for %d bytes",
+ "write_hw kzalloc failed for %zu bytes",
sizeof(struct atto_ioctl));
return -ENOMEM;
}
@@ -1186,7 +1186,7 @@ static int esas2r_dev_targ_reset(struct scsi_cmnd *cmd, bool target_reset)
} else {
esas2r_log(ESAS2R_LOG_CRIT,
"unable to allocate a request for a "
- "device reset (%d:%d)!",
+ "device reset (%d:%llu)!",
cmd->device->id,
cmd->device->lun);
}
--
2.7.4
--
Kees Cook
Nexus Security
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH v2] scsi: esas2r: Fix format string type mistakes Kees Cook <keescook@chromium.org> - 2017-01-04 01:10 +0100 Re: [PATCH v2] scsi: esas2r: Fix format string type mistakes "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-01-10 06:00 +0100
csiph-web