From: Jan Beulcih Date: Thu, 23 Jun 2011 10:12:32 +0000 (+0100) Subject: xenbus: add __attribute__((format(printf... where appropriate X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a87d5c7a789f619a11b9a9c484f98b1116513915;p=legacy%2Flinux-2.6.18-xen.git xenbus: add __attribute__((format(printf... where appropriate From: Joe Perches Use the compiler to verify printf formats and arguments. Fix fallout. Signed-off-by: Joe Perches Make apply, slightly re-format, and fix more fallout (in blktap). Signed-off-by: Jan Beulcih --- diff --git a/drivers/xen/blkback/xenbus.c b/drivers/xen/blkback/xenbus.c index cbbb8fc8..4f2c0dd0 100644 --- a/drivers/xen/blkback/xenbus.c +++ b/drivers/xen/blkback/xenbus.c @@ -473,7 +473,7 @@ again: err = xenbus_switch_state(dev, XenbusStateConnected); if (err) - xenbus_dev_fatal(dev, err, "switching to Connected state", + xenbus_dev_fatal(dev, err, "%s: switching to Connected state", dev->nodename); return; diff --git a/drivers/xen/blktap/xenbus.c b/drivers/xen/blktap/xenbus.c index cbdc24d1..922ace74 100644 --- a/drivers/xen/blktap/xenbus.c +++ b/drivers/xen/blktap/xenbus.c @@ -426,7 +426,7 @@ static void connect(struct backend_info *be) err = xenbus_switch_state(dev, XenbusStateConnected); if (err) - xenbus_dev_fatal(dev, err, "switching to Connected state", + xenbus_dev_fatal(dev, err, "%s: switching to Connected state", dev->nodename); return; diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h index 06e9145f..f1e79819 100644 --- a/include/xen/xenbus.h +++ b/include/xen/xenbus.h @@ -276,7 +276,7 @@ enum xenbus_state xenbus_read_driver_state(const char *path); * formatted message. */ void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, - ...); + ...) __attribute__((__format__(__printf__, 3, 4))); /*** @@ -285,7 +285,7 @@ void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, * closedown of this driver and its peer. */ void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, - ...); + ...) __attribute__((__format__(__printf__, 3, 4))); int xenbus_dev_init(void);