Skip to contentSkip to conversation

linux-2.6.18: add __attribute__((format(printf... where appropriate

PATCH New Jan Beulich 1 participant 1 message Jun 17, 2011 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-2.6.18: add __attribute__((format(printf... where appropriate

From: Joe Perches <[email protected]>

Use the compiler to verify printf formats and arguments.

Fix fallout.

Make apply, slightly re-format, and fix more fallout (in blktap).

drivers/xen/blkback/xenbus.c +1 -1
@@ -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;
drivers/xen/blktap/xenbus.c +1 -1
@@ -426,7 +426,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;
include/xen/xenbus.h +2 -2
@@ -276,7 +276,7 @@ enum xenbus_state xenbus_read_driver_sta
  * 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_devi
  * 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);
 

From: Joe Perches <[email protected]>
Subject: xen: add __attribute__((format(printf... where appropriate

Use the compiler to verify printf formats and arguments.

Fix fallout.

Make apply, slightly re-format, and fix more fallout (in blktap).

drivers/xen/blkback/xenbus.c +1 -1
@@ -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;
drivers/xen/blktap/xenbus.c +1 -1
@@ -426,7 +426,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;
include/xen/xenbus.h +2 -2
@@ -276,7 +276,7 @@ enum xenbus_state xenbus_read_driver_sta
  * 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_devi
  * 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);
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel