public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: navin patidar <navinp@cdac.in>
Cc: mfm@muteddisk.com, sergei.shtylyov@cogentembedded.com,
	joe@perches.com, linux-usb@vger.kernel.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] staging: usbip: replace pr_warning() with dev_warn().
Date: Wed, 24 Jul 2013 22:08:40 -0700	[thread overview]
Message-ID: <20130725050840.GA21814@kroah.com> (raw)
In-Reply-To: <CAPV97ydVKFdRuKRkW12KNmoh8ZoN-XoX=vW8CjaBz-u386ZOiA@mail.gmail.com>

On Thu, Jul 25, 2013 at 10:19:31AM +0530, navin patidar wrote:
> >> -        pr_warning("Unable to start control thread\n");
> >> +        struct device *dev;
> >> +
> >> +        if (ud->side == USBIP_STUB)
> >> +            dev = &container_of(ud, struct stub_device, ud)->udev->dev;
> >> +        else
> >> +            dev = &container_of(ud, struct vhci_device, ud)->udev->dev;
> >
> > Putting '&' in front of container_of seems odd, are you sure it's needed
> > here?  If ud is a pointer, everything else should "just work" properly
> > without that.
> 
> Removing '&'   caused following error.
> drivers/staging/usbip/usbip_event.c: In function ‘usbip_start_eh’:
> drivers/staging/usbip/usbip_event.c:93:8: error: incompatible types
> when assigning to type ‘struct device *’ from type ‘struct device’
> drivers/staging/usbip/usbip_event.c:95:8: error: incompatible types
> when assigning to type ‘struct device *’ from type ‘struct device’
> 
> dev needs to be initialized with address of dev (struct device ) which
> is member of struct usb_device pointed by the udev.
> 
> To make it more clear i can change it to
> 
> dev = &(container_of(ud, struct vhci_device, ud)->udev->dev);
> 
>  or
> 
> struct vhci_device *vdev = container_of(ud, struct vhci_device, ud);
> dev = &(vdev->udev->dev);

Or perhaps:
	dev = container_of(ud, struct stub_device, ud).udev->dev;

or ->udev.dev; I don't remember which, but that should work, right?

greg k-h

  reply	other threads:[~2013-07-25  5:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25  4:49 [PATCH v4] staging: usbip: replace pr_warning() with dev_warn() navin patidar
2013-07-25  5:08 ` Greg KH [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-07-25  7:01 navin patidar
2013-06-27 10:04 navin patidar
2013-07-23 21:47 ` Greg KH

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=20130725050840.GA21814@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=joe@perches.com \
    --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