mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: navin patidar <navinp@cdac.in>
Cc: gregkh@linuxfoundation.org, mfm@muteddisk.com,
	sergei.shtylyov@cogentembedded.com, linux-usb@vger.kernel.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] staging: usbip: replace pr_warning() with dev_warn().
Date: Wed, 26 Jun 2013 21:45:29 -0700	[thread overview]
Message-ID: <1372308329.2060.3.camel@joe-AO722> (raw)
In-Reply-To: <1372307706-6711-1-git-send-email-navinp@cdac.in>

On Thu, 2013-06-27 at 10:05 +0530, navin patidar wrote:
> dev_warn() is preferred over pr_warning().
[]
> diff --git a/drivers/staging/usbip/usbip_event.c b/drivers/staging/usbip/usbip_event.c
[]
> @@ -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;

Don't put a struct device on stack,
just use a struct device *

> +		if (ud->side == USBIP_STUB) {
> +			struct stub_device *sdev;
> +
> +			sdev = container_of(ud, struct stub_device, ud);
> +			dev = sdev->udev->dev;

			dev = &sdev->udev->dev;

> +		} else {
> +			struct vhci_device *vdev;
> +
> +			vdev = container_of(ud, struct vhci_device, ud);
> +			dev = vdev->udev->dev;

			dev = &vdev->udev->dev;
though maybe
			dev = &container_of(udev, struct vhci_device, ud)->udev->dev;
would work too.

> +		}
> +		dev_warn(&dev, "Unable to start control thread\n");

		dev_warn(dev, ...)




      reply	other threads:[~2013-06-27  4:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27  4:35 navin patidar
2013-06-27  4:45 ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1372308329.2060.3.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mfm@muteddisk.com \
    --cc=navinp@cdac.in \
    --cc=sergei.shtylyov@cogentembedded.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®