All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Himadri Pandya <himadri18.07@gmail.com>
Cc: laurent.pinchart@ideasonboard.com, mchehab@kernel.org,
	 gregkh@linuxfoundation.org, outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] staging: media: omap4iss: Use list_entry instead of container_of
Date: Sun, 24 Mar 2019 18:18:50 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.1903241812520.2526@hadrien> (raw)
In-Reply-To: <20190324165433.95833-1-himadri18.07@gmail.com>



On Sun, 24 Mar 2019, Himadri Pandya wrote:

> Use list_entry instead of container_of for lists iss_buffer and
> iss_video.
>
> Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
> ---
>  drivers/staging/media/omap4iss/iss_video.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/media/omap4iss/iss_video.h b/drivers/staging/media/omap4iss/iss_video.h
> index f22489edb562..e8d27b7ac329 100644
> --- a/drivers/staging/media/omap4iss/iss_video.h
> +++ b/drivers/staging/media/omap4iss/iss_video.h
> @@ -118,7 +118,7 @@ struct iss_buffer {
>  	dma_addr_t iss_addr;
>  };
>
> -#define to_iss_buffer(buf)	container_of(buf, struct iss_buffer, vb)
> +#define to_iss_buffer(buf)	list_entry(buf, struct iss_buffer, vb)

Actually, this macro is no longer used.  Perhaps someone else converted
the uses to use the proper list operations and forgot to drop the macro
definition.

>
>  enum iss_video_dmaqueue_flags {
>  	/* Set if DMA queue becomes empty when ISS_PIPELINE_STREAM_CONTINUOUS */
> @@ -170,7 +170,7 @@ struct iss_video {
>  	const struct iss_video_operations *ops;
>  };
>
> -#define to_iss_video(vdev)	container_of(vdev, struct iss_video, video)
> +#define to_iss_video(vdev)	list_entry(vdev, struct iss_video, video)

This doesn't involve a list.  Nor does the previous one.  To use
list_entry, the third argument should be the name of a field that has type
list_head.

julia

>  struct iss_video_fh {
>  	struct v4l2_fh vfh;
> --
> 2.17.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190324165433.95833-1-himadri18.07%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


  reply	other threads:[~2019-03-24 17:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-24 16:54 [PATCH] staging: media: omap4iss: Use list_entry instead of container_of Himadri Pandya
2019-03-24 17:18 ` Julia Lawall [this message]
2019-03-24 17:49   ` [Outreachy kernel] " Himadri Pandya
2019-03-24 17:57     ` Julia Lawall
2019-03-25  1:46     ` Laurent Pinchart
2019-03-26 19:43       ` Himadri Pandya
2019-03-30 15:40         ` Himadri Pandya
2019-03-31 10:08         ` Laurent Pinchart
2019-04-01 18:54           ` Himadri Pandya

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=alpine.DEB.2.21.1903241812520.2526@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=himadri18.07@gmail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=mchehab@kernel.org \
    --cc=outreachy-kernel@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.