#undef DPRINTK
#define DPRINTK(fmt, args...) \
pr_debug("blkback/xenbus (%s:%d) " fmt ".\n", \
- __FUNCTION__, __LINE__, ##args)
+ __func__, __LINE__, ##args)
-struct backend_info
-{
+struct backend_info {
struct xenbus_device *dev;
struct blkif_st *blkif;
struct xenbus_watch backend_watch;
if (IS_ERR(devpath))
return PTR_ERR(devpath);
- if ((devname = strstr(devpath, "/dev/")) != NULL)
+ devname = strstr(devpath, "/dev/");
+ if (devname != NULL)
devname += strlen("/dev/");
else
devname = devpath;
int error;
error = device_create_file(&dev->dev, &dev_attr_physical_device);
- if (error)
+ if (error)
goto fail1;
error = device_create_file(&dev->dev, &dev_attr_mode);
/* Front end dir is a number, which is used as the handle. */
char *p = strrchr(dev->otherend, '/') + 1;
- long handle = simple_strtoul(p, NULL, 0);
+ long handle;
+ err = strict_strtoul(p, 0, &handle);
+ if (err)
+ return;
be->major = major;
be->minor = minor;
case XenbusStateInitialising:
if (dev->state == XenbusStateClosed) {
printk(KERN_INFO "%s: %s: prepare for reconnect\n",
- __FUNCTION__, dev->nodename);
+ __func__, dev->nodename);
xenbus_switch_state(dev, XenbusStateInitWait);
}
break;
DPRINTK("%s", dev->otherend);
- err = xenbus_gather(XBT_NIL, dev->otherend, "ring-ref", "%lu", &ring_ref,
- "event-channel", "%u", &evtchn, NULL);
+ err = xenbus_gather(XBT_NIL, dev->otherend, "ring-ref", "%lu",
+ &ring_ref, "event-channel", "%u", &evtchn, NULL);
if (err) {
xenbus_dev_fatal(dev, err,
"reading %s/ring-ref and event-channel",