linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Tang Bin <tangbin@cmss.chinamobile.com>
Cc: Jason Wang <jasowang@redhat.com>,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] virtio-mmio: Use to_virtio_mmio_device() to simply code
Date: Sun, 21 Feb 2021 06:26:35 -0500	[thread overview]
Message-ID: <20210221062628-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <740b0c1f-24d4-de31-8753-4c5ec07b92f9@cmss.chinamobile.com>

On Thu, Feb 18, 2021 at 09:34:08AM +0800, Tang Bin wrote:
> Dear Jason:
> 
>       Sorry for the late reply this email.
> 
> 在 2021/2/10 16:09, Jason Wang 写道:
> > 
> > On 2021/2/10 上午11:04, Tang Bin wrote:
> > > The file virtio_mmio.c has defined the function to_virtio_mmio_device,
> > > so use it instead of container_of() to simply code. And remove
> > > superfluous blank lines in this file.
> > > 
> > > Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
> > > ---
> > >   drivers/virtio/virtio_mmio.c | 16 +---------------
> > >   1 file changed, 1 insertion(+), 15 deletions(-)
> > > 
> > > diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
> > > index 627ac0487..449d0f209 100644
> > > --- a/drivers/virtio/virtio_mmio.c
> > > +++ b/drivers/virtio/virtio_mmio.c
> > > @@ -69,14 +69,10 @@
> > >   #include <uapi/linux/virtio_mmio.h>
> > >   #include <linux/virtio_ring.h>
> > >   -
> > > -
> > 
> > 
> > It's better not mix the patch with style changes.
> > 
> > Other looks good.
> > 
> > Thanks
> 
> Whether should I send patch V2?
> 
> Thanks


Please do.

> > 
> > 
> > >   /* The alignment to use between consumer and producer parts of vring.
> > >    * Currently hardcoded to the page size. */
> > >   #define VIRTIO_MMIO_VRING_ALIGN        PAGE_SIZE
> > >   -
> > > -
> > >   #define to_virtio_mmio_device(_plat_dev) \
> > >       container_of(_plat_dev, struct virtio_mmio_device, vdev)
> > >   @@ -100,8 +96,6 @@ struct virtio_mmio_vq_info {
> > >       struct list_head node;
> > >   };
> > >   -
> > > -
> > >   /* Configuration interface */
> > >     static u64 vm_get_features(struct virtio_device *vdev)
> > > @@ -264,8 +258,6 @@ static void vm_reset(struct virtio_device *vdev)
> > >       writel(0, vm_dev->base + VIRTIO_MMIO_STATUS);
> > >   }
> > >   -
> > > -
> > >   /* Transport interface */
> > >     /* the notify function used when creating a virt queue */
> > > @@ -307,8 +299,6 @@ static irqreturn_t vm_interrupt(int irq, void
> > > *opaque)
> > >       return ret;
> > >   }
> > >   -
> > > -
> > >   static void vm_del_vq(struct virtqueue *vq)
> > >   {
> > >       struct virtio_mmio_device *vm_dev =
> > > to_virtio_mmio_device(vq->vdev);
> > > @@ -512,13 +502,11 @@ static const struct virtio_config_ops
> > > virtio_mmio_config_ops = {
> > >       .bus_name    = vm_bus_name,
> > >   };
> > >   -
> > >   static void virtio_mmio_release_dev(struct device *_d)
> > >   {
> > >       struct virtio_device *vdev =
> > >               container_of(_d, struct virtio_device, dev);
> > > -    struct virtio_mmio_device *vm_dev =
> > > -            container_of(vdev, struct virtio_mmio_device, vdev);
> > > +    struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
> > >       struct platform_device *pdev = vm_dev->pdev;
> > >         devm_kfree(&pdev->dev, vm_dev);
> > > @@ -608,8 +596,6 @@ static int virtio_mmio_remove(struct
> > > platform_device *pdev)
> > >       return 0;
> > >   }
> > >   -
> > > -
> > >   /* Devices list parameter */
> > >     #if defined(CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES)
> > 
> 


      reply	other threads:[~2021-02-21 11:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10  3:04 [PATCH] virtio-mmio: Use to_virtio_mmio_device() to simply code Tang Bin
2021-02-10  8:09 ` Jason Wang
2021-02-18  1:34   ` Tang Bin
2021-02-21 11:26     ` Michael S. Tsirkin [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=20210221062628-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tangbin@cmss.chinamobile.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).