mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@01.org, Steve Longerbeam <slongerbeam@gmail.com>
Cc: kbuild-all@01.org, linux-media@vger.kernel.org,
	Steve Longerbeam <steve_longerbeam@mentor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 15/17] media: platform: Switch to v4l2_async_notifier_add_subdev
Date: Mon, 2 Jul 2018 09:09:07 +0300	[thread overview]
Message-ID: <20180702060907.xlghcxtsj5eepdxu@mwanda> (raw)
In-Reply-To: <1530298220-5097-16-git-send-email-steve_longerbeam@mentor.com>

Hi Steve,

I love your patch! Perhaps something to improve:

url:    https://github.com/0day-ci/linux/commits/Steve-Longerbeam/media-imx-Switch-to-subdev-notifiers/20180630-035625
base:   git://linuxtv.org/media_tree.git master

New smatch warnings:
drivers/media/platform/xilinx/xilinx-vipp.c:97 xvip_graph_build_one() error: '%pOF' expects argument of type 'struct device_node*', argument 3 has type 'struct fwnode_handle*'
drivers/media/platform/xilinx/xilinx-vipp.c:335 xvip_graph_notify_bound() error: '%pOF' expects argument of type 'struct device_node*', argument 3 has type 'struct fwnode_handle*'

Old smatch warnings:
drivers/media/platform/xilinx/xilinx-vipp.c:106 xvip_graph_build_one() error: '%pOF' expects argument of type 'struct device_node*', argument 4 has type 'struct fwnode_handle*'
drivers/media/platform/xilinx/xilinx-vipp.c:133 xvip_graph_build_one() error: '%pOF' expects argument of type 'struct device_node*', argument 3 has type 'struct fwnode_handle*'
drivers/media/platform/xilinx/xilinx-vipp.c:143 xvip_graph_build_one() error: '%pOF' expects argument of type 'struct device_node*', argument 4 has type 'struct fwnode_handle*'

# https://github.com/0day-ci/linux/commit/86ede05d30b3cad4b07c2df915fc83b94d3327f1
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 86ede05d30b3cad4b07c2df915fc83b94d3327f1
vim +97 drivers/media/platform/xilinx/xilinx-vipp.c

df3305156 Laurent Pinchart      2013-05-15   70  
df3305156 Laurent Pinchart      2013-05-15   71  static int xvip_graph_build_one(struct xvip_composite_device *xdev,
df3305156 Laurent Pinchart      2013-05-15   72  				struct xvip_graph_entity *entity)
df3305156 Laurent Pinchart      2013-05-15   73  {
df3305156 Laurent Pinchart      2013-05-15   74  	u32 link_flags = MEDIA_LNK_FL_ENABLED;
df3305156 Laurent Pinchart      2013-05-15   75  	struct media_entity *local = entity->entity;
df3305156 Laurent Pinchart      2013-05-15   76  	struct media_entity *remote;
df3305156 Laurent Pinchart      2013-05-15   77  	struct media_pad *local_pad;
df3305156 Laurent Pinchart      2013-05-15   78  	struct media_pad *remote_pad;
df3305156 Laurent Pinchart      2013-05-15   79  	struct xvip_graph_entity *ent;
859969b38 Sakari Ailus          2016-08-26   80  	struct v4l2_fwnode_link link;
86ede05d3 Steve Longerbeam      2018-06-29   81  	struct fwnode_handle *ep = NULL;
df3305156 Laurent Pinchart      2013-05-15   82  	int ret = 0;
df3305156 Laurent Pinchart      2013-05-15   83  
df3305156 Laurent Pinchart      2013-05-15   84  	dev_dbg(xdev->dev, "creating links for entity %s\n", local->name);
df3305156 Laurent Pinchart      2013-05-15   85  
df3305156 Laurent Pinchart      2013-05-15   86  	while (1) {
df3305156 Laurent Pinchart      2013-05-15   87  		/* Get the next endpoint and parse its link. */
86ede05d3 Steve Longerbeam      2018-06-29   88  		ep = fwnode_graph_get_next_endpoint(entity->asd.match.fwnode,
86ede05d3 Steve Longerbeam      2018-06-29   89  						    ep);
ef94711a0 Akinobu Mita          2017-10-12   90  		if (ep == NULL)
df3305156 Laurent Pinchart      2013-05-15   91  			break;
df3305156 Laurent Pinchart      2013-05-15   92  
68d9c47b1 Rob Herring           2017-07-21   93  		dev_dbg(xdev->dev, "processing endpoint %pOF\n", ep);
df3305156 Laurent Pinchart      2013-05-15   94  
86ede05d3 Steve Longerbeam      2018-06-29   95  		ret = v4l2_fwnode_parse_link(ep, &link);
df3305156 Laurent Pinchart      2013-05-15   96  		if (ret < 0) {
68d9c47b1 Rob Herring           2017-07-21  @97  			dev_err(xdev->dev, "failed to parse link for %pOF\n",
68d9c47b1 Rob Herring           2017-07-21   98  				ep);
df3305156 Laurent Pinchart      2013-05-15   99  			continue;
df3305156 Laurent Pinchart      2013-05-15  100  		}
df3305156 Laurent Pinchart      2013-05-15  101  
df3305156 Laurent Pinchart      2013-05-15  102  		/* Skip sink ports, they will be processed from the other end of
df3305156 Laurent Pinchart      2013-05-15  103  		 * the link.
df3305156 Laurent Pinchart      2013-05-15  104  		 */
df3305156 Laurent Pinchart      2013-05-15  105  		if (link.local_port >= local->num_pads) {
68d9c47b1 Rob Herring           2017-07-21  106  			dev_err(xdev->dev, "invalid port number %u for %pOF\n",
86ede05d3 Steve Longerbeam      2018-06-29  107  				link.local_port, link.local_node);
859969b38 Sakari Ailus          2016-08-26  108  			v4l2_fwnode_put_link(&link);
df3305156 Laurent Pinchart      2013-05-15  109  			ret = -EINVAL;
df3305156 Laurent Pinchart      2013-05-15  110  			break;
df3305156 Laurent Pinchart      2013-05-15  111  		}
df3305156 Laurent Pinchart      2013-05-15  112  
df3305156 Laurent Pinchart      2013-05-15  113  		local_pad = &local->pads[link.local_port];
df3305156 Laurent Pinchart      2013-05-15  114  
df3305156 Laurent Pinchart      2013-05-15  115  		if (local_pad->flags & MEDIA_PAD_FL_SINK) {
68d9c47b1 Rob Herring           2017-07-21  116  			dev_dbg(xdev->dev, "skipping sink port %pOF:%u\n",
86ede05d3 Steve Longerbeam      2018-06-29  117  				link.local_node, link.local_port);
859969b38 Sakari Ailus          2016-08-26  118  			v4l2_fwnode_put_link(&link);
df3305156 Laurent Pinchart      2013-05-15  119  			continue;
df3305156 Laurent Pinchart      2013-05-15  120  		}
df3305156 Laurent Pinchart      2013-05-15  121  
df3305156 Laurent Pinchart      2013-05-15  122  		/* Skip DMA engines, they will be processed separately. */
859969b38 Sakari Ailus          2016-08-26  123  		if (link.remote_node == of_fwnode_handle(xdev->dev->of_node)) {
68d9c47b1 Rob Herring           2017-07-21  124  			dev_dbg(xdev->dev, "skipping DMA port %pOF:%u\n",
86ede05d3 Steve Longerbeam      2018-06-29  125  				link.local_node, link.local_port);
859969b38 Sakari Ailus          2016-08-26  126  			v4l2_fwnode_put_link(&link);
df3305156 Laurent Pinchart      2013-05-15  127  			continue;
df3305156 Laurent Pinchart      2013-05-15  128  		}
df3305156 Laurent Pinchart      2013-05-15  129  
df3305156 Laurent Pinchart      2013-05-15  130  		/* Find the remote entity. */
86ede05d3 Steve Longerbeam      2018-06-29  131  		ent = xvip_graph_find_entity(xdev, link.remote_node);
df3305156 Laurent Pinchart      2013-05-15  132  		if (ent == NULL) {
68d9c47b1 Rob Herring           2017-07-21  133  			dev_err(xdev->dev, "no entity found for %pOF\n",
86ede05d3 Steve Longerbeam      2018-06-29  134  				link.remote_node);
859969b38 Sakari Ailus          2016-08-26  135  			v4l2_fwnode_put_link(&link);
df3305156 Laurent Pinchart      2013-05-15  136  			ret = -ENODEV;
df3305156 Laurent Pinchart      2013-05-15  137  			break;
df3305156 Laurent Pinchart      2013-05-15  138  		}
df3305156 Laurent Pinchart      2013-05-15  139  
df3305156 Laurent Pinchart      2013-05-15  140  		remote = ent->entity;
df3305156 Laurent Pinchart      2013-05-15  141  
df3305156 Laurent Pinchart      2013-05-15  142  		if (link.remote_port >= remote->num_pads) {
68d9c47b1 Rob Herring           2017-07-21  143  			dev_err(xdev->dev, "invalid port number %u on %pOF\n",
86ede05d3 Steve Longerbeam      2018-06-29  144  				link.remote_port, link.remote_node);
859969b38 Sakari Ailus          2016-08-26  145  			v4l2_fwnode_put_link(&link);
df3305156 Laurent Pinchart      2013-05-15  146  			ret = -EINVAL;
df3305156 Laurent Pinchart      2013-05-15  147  			break;
df3305156 Laurent Pinchart      2013-05-15  148  		}
df3305156 Laurent Pinchart      2013-05-15  149  
df3305156 Laurent Pinchart      2013-05-15  150  		remote_pad = &remote->pads[link.remote_port];
df3305156 Laurent Pinchart      2013-05-15  151  
859969b38 Sakari Ailus          2016-08-26  152  		v4l2_fwnode_put_link(&link);
df3305156 Laurent Pinchart      2013-05-15  153  
df3305156 Laurent Pinchart      2013-05-15  154  		/* Create the media link. */
df3305156 Laurent Pinchart      2013-05-15  155  		dev_dbg(xdev->dev, "creating %s:%u -> %s:%u link\n",
df3305156 Laurent Pinchart      2013-05-15  156  			local->name, local_pad->index,
df3305156 Laurent Pinchart      2013-05-15  157  			remote->name, remote_pad->index);
df3305156 Laurent Pinchart      2013-05-15  158  
8df00a158 Mauro Carvalho Chehab 2015-08-07  159  		ret = media_create_pad_link(local, local_pad->index,
df3305156 Laurent Pinchart      2013-05-15  160  					       remote, remote_pad->index,
df3305156 Laurent Pinchart      2013-05-15  161  					       link_flags);
df3305156 Laurent Pinchart      2013-05-15  162  		if (ret < 0) {
df3305156 Laurent Pinchart      2013-05-15  163  			dev_err(xdev->dev,
df3305156 Laurent Pinchart      2013-05-15  164  				"failed to create %s:%u -> %s:%u link\n",
df3305156 Laurent Pinchart      2013-05-15  165  				local->name, local_pad->index,
df3305156 Laurent Pinchart      2013-05-15  166  				remote->name, remote_pad->index);
df3305156 Laurent Pinchart      2013-05-15  167  			break;
df3305156 Laurent Pinchart      2013-05-15  168  		}
df3305156 Laurent Pinchart      2013-05-15  169  	}
df3305156 Laurent Pinchart      2013-05-15  170  
86ede05d3 Steve Longerbeam      2018-06-29  171  	fwnode_handle_put(ep);
df3305156 Laurent Pinchart      2013-05-15  172  	return ret;
df3305156 Laurent Pinchart      2013-05-15  173  }
df3305156 Laurent Pinchart      2013-05-15  174  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

  reply	other threads:[~2018-07-02  6:09 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-29 18:49 [PATCH v5 00/17] media: imx: Switch to subdev notifiers Steve Longerbeam
2018-06-29 18:49 ` [PATCH v5 01/17] media: v4l2-fwnode: ignore endpoints that have no remote port parent Steve Longerbeam
2018-06-29 18:49 ` [PATCH v5 02/17] media: v4l2: async: Allow searching for asd of any type Steve Longerbeam
2018-06-29 18:49 ` [PATCH v5 03/17] media: v4l2: async: Add v4l2_async_notifier_add_subdev Steve Longerbeam
2018-06-29 18:49 ` [PATCH v5 04/17] media: v4l2: async: Add convenience functions to allocate and add asd's Steve Longerbeam
2018-06-29 18:49 ` [PATCH v5 05/17] media: v4l2-fwnode: Switch to v4l2_async_notifier_add_subdev Steve Longerbeam
2018-06-29 18:49 ` [PATCH v5 06/17] media: v4l2-fwnode: Add a convenience function for registering subdevs with notifiers Steve Longerbeam
2018-06-29 18:49 ` [PATCH v5 07/17] media: platform: video-mux: Register a subdev notifier Steve Longerbeam
2018-06-29 18:49 ` [PATCH v5 08/17] media: imx: csi: " Steve Longerbeam
2018-06-29 18:49 ` [PATCH v5 09/17] media: imx: mipi csi-2: " Steve Longerbeam
2018-06-29 18:49 ` [PATCH v5 10/17] media: staging/imx: of: Remove recursive graph walk Steve Longerbeam
2018-06-29 18:49 ` [PATCH v5 11/17] media: staging/imx: Loop through all registered subdevs for media links Steve Longerbeam
2018-06-29 18:49 ` [PATCH v5 12/17] media: staging/imx: Rename root notifier Steve Longerbeam
2018-06-29 18:49 ` [PATCH v5 13/17] media: staging/imx: Switch to v4l2_async_notifier_add_*_subdev Steve Longerbeam
2018-06-29 18:49 ` [PATCH v5 14/17] media: staging/imx: TODO: Remove one assumption about OF graph parsing Steve Longerbeam
2018-06-29 18:49 ` [PATCH v5 15/17] media: platform: Switch to v4l2_async_notifier_add_subdev Steve Longerbeam
2018-07-02  6:09   ` Dan Carpenter [this message]
2018-07-07 21:06     ` Steve Longerbeam
2018-07-02 11:23   ` Sakari Ailus
2018-07-07 21:09     ` Steve Longerbeam
2018-06-29 18:50 ` [PATCH v5 16/17] media: v4l2: async: Remove notifier subdevs array Steve Longerbeam
2018-06-29 18:50 ` [PATCH v5 17/17] [media] v4l2-subdev.rst: Update doc regarding subdev descriptors Steve Longerbeam
2018-07-02  9:51 ` [PATCH v5 00/17] media: imx: Switch to subdev notifiers Sakari Ailus
2018-07-07 21:15   ` Steve Longerbeam

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=20180702060907.xlghcxtsj5eepdxu@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild-all@01.org \
    --cc=kbuild@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=slongerbeam@gmail.com \
    --cc=steve_longerbeam@mentor.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®