]> www.infradead.org Git - users/hch/misc.git/commitdiff
media: stm32-dcmi: use int type to store negative error codes
authorQianfeng Rong <rongqianfeng@vivo.com>
Wed, 27 Aug 2025 12:39:12 +0000 (20:39 +0800)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 9 Sep 2025 13:59:16 +0000 (15:59 +0200)
Change "ret" from unsigned int to int type in dcmi_framesizes_init()
and dcmi_graph_notify_bound() to store negative error codes or zero
returned by v4l2_subdev_call() and media_create_pad_link() - this
better aligns with the coding standards and maintains code consistency.

No effect on runtime.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/st/stm32/stm32-dcmi.c

index d94c61b8569d8fac07dcdcc6565f888b1249e323..13762861b76942530ed5f821c30f77c921047f9b 100644 (file)
@@ -1701,8 +1701,8 @@ static int dcmi_framesizes_init(struct stm32_dcmi *dcmi)
                .which = V4L2_SUBDEV_FORMAT_ACTIVE,
                .code = dcmi->sd_format->mbus_code,
        };
-       unsigned int ret;
        unsigned int i;
+       int ret;
 
        /* Allocate discrete framesizes array */
        while (!v4l2_subdev_call(subdev, pad, enum_frame_size,
@@ -1808,8 +1808,8 @@ static int dcmi_graph_notify_bound(struct v4l2_async_notifier *notifier,
                                   struct v4l2_async_connection *asd)
 {
        struct stm32_dcmi *dcmi = notifier_to_dcmi(notifier);
-       unsigned int ret;
        int src_pad;
+       int ret;
 
        dev_dbg(dcmi->dev, "Subdev \"%s\" bound\n", subdev->name);