[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] usbif: simplify kthread name generation


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
  • Date: Tue, 02 Jun 2015 14:22:03 +0000
  • Delivery-date: Tue, 02 Jun 2015 14:22:11 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1433254219 -7200
# Node ID a429985613f2ad6739ddbd44eb296954678b78ce
# Parent  62922fbe9fe2ceb749413dfccb4645d2c83bf69b
usbif: simplify kthread name generation

kthread_run() taking a format string it can quite well do all the
formatting itself.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---


diff -r 62922fbe9fe2 -r a429985613f2 drivers/xen/usbback/xenbus.c
--- a/drivers/xen/usbback/xenbus.c      Tue Jun 02 16:09:12 2015 +0200
+++ b/drivers/xen/usbback/xenbus.c      Tue Jun 02 16:10:19 2015 +0200
@@ -48,11 +48,9 @@
 static int start_xenusbd(usbif_t *usbif)
 {
        int err = 0;
-       char name[TASK_COMM_LEN];
 
-       snprintf(name, TASK_COMM_LEN, "usbback.%d.%d", usbif->domid,
-                       usbif->handle);
-       usbif->xenusbd = kthread_run(usbbk_schedule, usbif, name);
+       usbif->xenusbd = kthread_run(usbbk_schedule, usbif, "usbback.%d.%u",
+                                    usbif->domid, usbif->handle);
        if (IS_ERR(usbif->xenusbd)) {
                err = PTR_ERR(usbif->xenusbd);
                usbif->xenusbd = NULL;
diff -r 62922fbe9fe2 -r a429985613f2 drivers/xen/usbfront/xenbus.c
--- a/drivers/xen/usbfront/xenbus.c     Tue Jun 02 16:09:12 2015 +0200
+++ b/drivers/xen/usbfront/xenbus.c     Tue Jun 02 16:10:19 2015 +0200
@@ -190,17 +190,15 @@ static int connect(struct xenbus_device 
        usbif_conn_request_t *req;
        int i, idx, err;
        int notify;
-       char name[TASK_COMM_LEN];
        struct usb_hcd *hcd;
 
-       hcd = info_to_hcd(info);
-       snprintf(name, TASK_COMM_LEN, "xenhcd.%d", hcd->self.busnum);
-
        err = talk_to_backend(dev, info);
        if (err)
                return err;
 
-       info->kthread = kthread_run(xenhcd_schedule, info, name);
+       hcd = info_to_hcd(info);
+       info->kthread = kthread_run(xenhcd_schedule, info,
+                                   "xenhcd.%d", hcd->self.busnum);
        if (IS_ERR(info->kthread)) {
                err = PTR_ERR(info->kthread);
                info->kthread = NULL;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.