lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 27 Jun 2013 10:05:06 +0530
From:	navin patidar <navinp@...c.in>
To:	gregkh@...uxfoundation.org, mfm@...eddisk.com,
	sergei.shtylyov@...entembedded.com
Cc:	linux-usb@...r.kernel.org, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org, navin patidar <navinp@...c.in>
Subject: [PATCH v3] staging: usbip: replace pr_warning() with dev_warn().

dev_warn() is preferred over pr_warning().

container_of() is used to get usb_driver pointer from usbip_device container
(stub_device or vhci_device), to get device structure required for dev_warn().

Signed-off-by: navin patidar <navinp@...c.in>
---
 drivers/staging/usbip/usbip_event.c |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/usbip/usbip_event.c b/drivers/staging/usbip/usbip_event.c
index 82123be..eca14b7 100644
--- a/drivers/staging/usbip/usbip_event.c
+++ b/drivers/staging/usbip/usbip_event.c
@@ -21,6 +21,8 @@
 #include <linux/export.h>

 #include "usbip_common.h"
+#include "stub.h"
+#include "vhci.h"

 static int event_handler(struct usbip_device *ud)
 {
@@ -85,7 +87,20 @@ int usbip_start_eh(struct usbip_device *ud)

 	ud->eh = kthread_run(event_handler_loop, ud, "usbip_eh");
 	if (IS_ERR(ud->eh)) {
-		pr_warning("Unable to start control thread\n");
+		struct device dev;
+
+		if (ud->side == USBIP_STUB) {
+			struct stub_device *sdev;
+
+			sdev = container_of(ud, struct stub_device, ud);
+			dev = sdev->udev->dev;
+		} else {
+			struct vhci_device *vdev;
+
+			vdev = container_of(ud, struct vhci_device, ud);
+			dev = vdev->udev->dev;
+		}
+		dev_warn(&dev, "Unable to start control thread\n");
 		return PTR_ERR(ud->eh);
 	}

--
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists