Re: [PATCH v7 01/28] media: sun6i-csi: Add bridge v4l2 subdev with port management

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Paul,

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Paul-Kocialkowski/Allwinner-A31-A83T-MIPI-CSI-2-and-A31-ISP-CSI-Rework/20221104-003518
base:   git://linuxtv.org/media_tree.git master
patch link:    https://lore.kernel.org/r/20221103163113.245462-2-paul.kocialkowski%40bootlin.com
patch subject: [PATCH v7 01/28] media: sun6i-csi: Add bridge v4l2 subdev with port management
config: arc-randconfig-m041-20221107
compiler: arc-elf-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Reported-by: Dan Carpenter <error27@xxxxxxxxx>

smatch warnings:
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c:86 sun6i_csi_bridge_s_stream() warn: missing error code 'ret'
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c:279 sun6i_csi_bridge_notifier_bound() error: uninitialized symbol 'enabled'.

vim +/ret +86 drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c

d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   62  static int sun6i_csi_bridge_s_stream(struct v4l2_subdev *subdev, int on)
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   63  {
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   64  	struct sun6i_csi_device *csi_dev = v4l2_get_subdevdata(subdev);
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   65  	struct sun6i_csi_bridge *bridge = &csi_dev->bridge;
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   66  	struct media_pad *local_pad = &bridge->pads[SUN6I_CSI_BRIDGE_PAD_SINK];
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   67  	struct device *dev = csi_dev->dev;
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   68  	struct v4l2_subdev *source_subdev;
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   69  	struct media_pad *remote_pad;
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   70  	/* Initialize to 0 to use both in disable label (ret != 0) and off. */
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   71  	int ret = 0;
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   72  
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   73  	/* Source */
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   74  
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   75  	remote_pad = media_pad_remote_pad_unique(local_pad);
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   76  	if (IS_ERR(remote_pad)) {
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   77  		dev_err(dev,
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   78  			"zero or more than a single source connected to the bridge\n");
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   79  		return PTR_ERR(remote_pad);
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   80  	}
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   81  
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   82  	source_subdev = media_entity_to_v4l2_subdev(remote_pad->entity);
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   83  
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   84  	if (!on) {
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   85  		v4l2_subdev_call(source_subdev, video, s_stream, 0);
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  @86  		goto disable;

This is intentional, but it should just return 0;

d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   87  	}
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   88  
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   89  	ret = v4l2_subdev_call(source_subdev, video, s_stream, 1);
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   90  	if (ret && ret != -ENOIOCTLCMD)
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   91  		goto disable;

Do we really need to clean anything up?  Why not just:

	source_subdev = media_entity_to_v4l2_subdev(remote_pad->entity);

	return v4l2_subdev_call(source_subdev, video, s_stream, !!on);

d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   92  
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   93  	return 0;
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   94  
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   95  disable:
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   96  
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   97  	return ret;
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   98  }
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03   99  

[ snip ]

d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  254  static int
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  255  sun6i_csi_bridge_notifier_bound(struct v4l2_async_notifier *notifier,
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  256  				struct v4l2_subdev *remote_subdev,
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  257  				struct v4l2_async_subdev *async_subdev)
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  258  {
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  259  	struct sun6i_csi_device *csi_dev =
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  260  		container_of(notifier, struct sun6i_csi_device,
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  261  			     bridge.notifier);
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  262  	struct sun6i_csi_bridge_async_subdev *bridge_async_subdev =
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  263  		container_of(async_subdev, struct sun6i_csi_bridge_async_subdev,
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  264  			     async_subdev);
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  265  	struct sun6i_csi_bridge_source *source = bridge_async_subdev->source;
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  266  	bool enabled;

This neesds to be "bool enabled = false;"

d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  267  
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  268  	switch (source->endpoint.base.port) {
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  269  	case SUN6I_CSI_PORT_PARALLEL:
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  270  		enabled = true;
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  271  		break;
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  272  	default:
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  273  		break;
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  274  	}
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  275  
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  276  	source->subdev = remote_subdev;
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  277  
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  278  	return sun6i_csi_bridge_link(csi_dev, SUN6I_CSI_BRIDGE_PAD_SINK,
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03 @279  				     remote_subdev, enabled);
d26de0b15ad9da7 Paul Kocialkowski 2022-11-03  280  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux