public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: "Linux Media Mailing List" <linux-media@vger.kernel.org>,
	"Mauro Carvalho Chehab" <mchehab@infradead.org>,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
	"Hans Verkuil" <hans.verkuil@cisco.com>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Steve Longerbeam" <slongerbeam@gmail.com>
Subject: Re: [PATCH 2/3] media: v4l2-fwnode: cleanup functions that parse endpoints
Date: Fri, 5 Oct 2018 06:52:20 -0300	[thread overview]
Message-ID: <20181005065220.360198b9@coco.lan> (raw)
In-Reply-To: <20181005080118.dvw5m7z2xgruu476@paasikivi.fi.intel.com>

Em Fri, 5 Oct 2018 11:01:18 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> escreveu:

> Hi Mauro,
> 
> Feel free to ignore the comments on the first patch regarding the functions
> below. There are other issues there though.
> 
> On Thu, Oct 04, 2018 at 06:13:47PM -0400, Mauro Carvalho Chehab wrote:
> > There is already a typedef for the parse endpoint function.
> > However, instead of using it, it is redefined at the C file
> > (and on one of the function headers).
> > 
> > Replace them by the function typedef, in order to cleanup
> > several related coding style warnings.
> > 
> > Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
> > ---
> >  drivers/media/v4l2-core/v4l2-fwnode.c | 64 ++++++++++++---------------
> >  include/media/v4l2-fwnode.h           | 19 ++++----
> >  2 files changed, 37 insertions(+), 46 deletions(-)
> > 
> > diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
> > index 4e518d5fddd8..a7c2487154a4 100644
> > --- a/drivers/media/v4l2-core/v4l2-fwnode.c
> > +++ b/drivers/media/v4l2-core/v4l2-fwnode.c
> > @@ -596,12 +596,10 @@ EXPORT_SYMBOL_GPL(v4l2_fwnode_put_link);
> >  
> >  static int
> >  v4l2_async_notifier_fwnode_parse_endpoint(struct device *dev,
> > -		struct v4l2_async_notifier *notifier,
> > -		struct fwnode_handle *endpoint,
> > -		unsigned int asd_struct_size,
> > -		int (*parse_endpoint)(struct device *dev,
> > -				      struct v4l2_fwnode_endpoint *vep,
> > -				      struct v4l2_async_subdev *asd))
> > +					  struct v4l2_async_notifier *notifier,
> > +					  struct fwnode_handle *endpoint,
> > +					  unsigned int asd_struct_size,
> > +					  parse_endpoint_func parse_endpoint)
> >  {
> >  	struct v4l2_fwnode_endpoint vep = { .bus_type = 0 };
> >  	struct v4l2_async_subdev *asd;
> > @@ -657,13 +655,12 @@ v4l2_async_notifier_fwnode_parse_endpoint(struct device *dev,
> >  }
> >  
> >  static int
> > -__v4l2_async_notifier_parse_fwnode_endpoints(struct device *dev,
> > -			struct v4l2_async_notifier *notifier,
> > -			size_t asd_struct_size,
> > -			unsigned int port, bool has_port,
> > -			int (*parse_endpoint)(struct device *dev,
> > -					      struct v4l2_fwnode_endpoint *vep,
> > -					      struct v4l2_async_subdev *asd))
> > +__v4l2_async_notifier_parse_fwnode_ep(struct device *dev,
> > +				      struct v4l2_async_notifier *notifier,
> > +				      size_t asd_struct_size,
> > +				      unsigned int port,
> > +				      bool has_port,
> > +				      parse_endpoint_func parse_endpoint)
> >  {
> >  	struct fwnode_handle *fwnode;
> >  	int ret = 0;
> > @@ -708,31 +705,27 @@ __v4l2_async_notifier_parse_fwnode_endpoints(struct device *dev,
> >  
> >  int
> >  v4l2_async_notifier_parse_fwnode_endpoints(struct device *dev,
> > -		struct v4l2_async_notifier *notifier,
> > -		size_t asd_struct_size,
> > -		int (*parse_endpoint)(struct device *dev,
> > -				      struct v4l2_fwnode_endpoint *vep,
> > -				      struct v4l2_async_subdev *asd))
> > +					   struct v4l2_async_notifier *notifier,
> > +					   size_t asd_struct_size,
> > +					   parse_endpoint_func parse_endpoint)
> >  {
> > -	return __v4l2_async_notifier_parse_fwnode_endpoints(dev, notifier,
> > -							    asd_struct_size, 0,
> > -							    false,
> > -							    parse_endpoint);
> > +	return __v4l2_async_notifier_parse_fwnode_ep(dev, notifier,
> > +						     asd_struct_size, 0,
> > +						     false, parse_endpoint);
> >  }
> >  EXPORT_SYMBOL_GPL(v4l2_async_notifier_parse_fwnode_endpoints);
> >  
> >  int
> >  v4l2_async_notifier_parse_fwnode_endpoints_by_port(struct device *dev,
> > -			struct v4l2_async_notifier *notifier,
> > -			size_t asd_struct_size, unsigned int port,
> > -			int (*parse_endpoint)(struct device *dev,
> > -					      struct v4l2_fwnode_endpoint *vep,
> > -					      struct v4l2_async_subdev *asd))
> > +						   struct v4l2_async_notifier *notifier,
> > +						   size_t asd_struct_size,
> > +						   unsigned int port,
> > +						   parse_endpoint_func parse_endpoint)  
> 
> This is still over 80 here. I think we could think of abbreviating what's
> in the function name, not limiting to the endpoint. I think I'd prefer to
> leave that for 4.21 as there's not much time anymore.

Yes, I know. Renaming the function is the only way to get rid of
those remaining warnings. If you're ok with renaming, IMHO it is best
do do it right now, as we are already churning a lot of fwnode-related
code, avoiding the need of touching it again for 4.21.

Thanks,
Mauro

  reply	other threads:[~2018-10-05 16:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 22:13 [PATCH 0/3] Coding style cleanups after the fwnode patchset Mauro Carvalho Chehab
2018-10-04 22:13 ` [PATCH 1/3] media: v4l2-core: cleanup coding style at V4L2 async/fwnode Mauro Carvalho Chehab
2018-10-05  7:55   ` Sakari Ailus
2018-10-05 10:12     ` Mauro Carvalho Chehab
2018-10-05 10:22       ` Sakari Ailus
2018-10-04 22:13 ` [PATCH 2/3] media: v4l2-fwnode: cleanup functions that parse endpoints Mauro Carvalho Chehab
2018-10-05  8:01   ` Sakari Ailus
2018-10-05  9:52     ` Mauro Carvalho Chehab [this message]
2018-10-05 10:08       ` Sakari Ailus
2018-10-05 10:33         ` Mauro Carvalho Chehab
2018-10-04 22:13 ` [PATCH 3/3] media: v4l2-fwnode: simplify v4l2_fwnode_reference_parse_int_props() call Mauro Carvalho Chehab
2018-10-05  8:03   ` Sakari Ailus
2018-10-05  9:54     ` Mauro Carvalho Chehab
2018-10-05 10:06       ` Sakari Ailus
2018-10-05 10:31         ` Mauro Carvalho Chehab

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=20181005065220.360198b9@coco.lan \
    --to=mchehab+samsung@kernel.org \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=sakari.ailus@linux.intel.com \
    --cc=slongerbeam@gmail.com \
    --cc=sre@kernel.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