diff mbox series

staging: media: imx: initialize hs_settle to avoid warning

Message ID 86de50ed-5bd9-6cdf-a430-895839568ffd@xs4all.nl (mailing list archive)
State New, archived
Headers show
Series staging: media: imx: initialize hs_settle to avoid warning | expand

Commit Message

Hans Verkuil April 18, 2023, 7:46 a.m. UTC
Initialize hs_settle to 0 to avoid this compiler warning:

imx8mq-mipi-csi2.c: In function 'imx8mq_mipi_csi_start_stream.part.0':
imx8mq-mipi-csi2.c:91:55: warning: 'hs_settle' may be used uninitialized [-Wmaybe-uninitialized]
   91 | #define GPR_CSI2_1_S_PRG_RXHS_SETTLE(x) (((x) & 0x3f) << 2)
      |                                                       ^~
imx8mq-mipi-csi2.c:357:13: note: 'hs_settle' was declared here
  357 |         u32 hs_settle;
      |             ^~~~~~~~~

It's a false positive, but it is too complicated for the compiler to detect that.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---

Comments

Martin Kepplinger April 18, 2023, 8:41 a.m. UTC | #1
hi Hans,

thank you for the patch. please use get_maintainer.pl to find all email
addresses to send this to. Sending this to linux-media only is
incomplete.

other than that, the patch lgtm and if you resend, you can add

Reviewed-by: Martin Kepplinger <martink@posteo.de>

thank you again,

                            martin


Am Dienstag, dem 18.04.2023 um 09:46 +0200 schrieb Hans Verkuil:
> Initialize hs_settle to 0 to avoid this compiler warning:
> 
> imx8mq-mipi-csi2.c: In function
> 'imx8mq_mipi_csi_start_stream.part.0':
> imx8mq-mipi-csi2.c:91:55: warning: 'hs_settle' may be used
> uninitialized [-Wmaybe-uninitialized]
>    91 | #define GPR_CSI2_1_S_PRG_RXHS_SETTLE(x) (((x) & 0x3f) << 2)
>       |                                                       ^~
> imx8mq-mipi-csi2.c:357:13: note: 'hs_settle' was declared here
>   357 |         u32 hs_settle;
>       |             ^~~~~~~~~
> 
> It's a false positive, but it is too complicated for the compiler to
> detect that.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> ---
> diff --git a/drivers/staging/media/imx/imx8mq-mipi-csi2.c
> b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
> index 32700cb8bc4d..ca2efcc21efe 100644
> --- a/drivers/staging/media/imx/imx8mq-mipi-csi2.c
> +++ b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
> @@ -354,7 +354,7 @@ static int imx8mq_mipi_csi_start_stream(struct
> csi_state *state,
>                                         struct v4l2_subdev_state
> *sd_state)
>  {
>         int ret;
> -       u32 hs_settle;
> +       u32 hs_settle = 0;
> 
>         ret = imx8mq_mipi_csi_sw_reset(state);
>         if (ret)
Hans Verkuil April 18, 2023, 8:53 a.m. UTC | #2
On 4/18/23 10:41, Martin Kepplinger wrote:
> hi Hans,
> 
> thank you for the patch. please use get_maintainer.pl to find all email
> addresses to send this to. Sending this to linux-media only is
> incomplete.

Note that you do not appear if I do:

scripts/get_maintainer.pl drivers/staging/media/imx/imx8mq-mipi-csi2.c

Not sure why not. It might be because there is no entry in the MAINTAINERS
file for this specific driver.

Regards,

	Hans

> 
> other than that, the patch lgtm and if you resend, you can add
> 
> Reviewed-by: Martin Kepplinger <martink@posteo.de>
> 
> thank you again,
> 
>                             martin
> 
> 
> Am Dienstag, dem 18.04.2023 um 09:46 +0200 schrieb Hans Verkuil:
>> Initialize hs_settle to 0 to avoid this compiler warning:
>>
>> imx8mq-mipi-csi2.c: In function
>> 'imx8mq_mipi_csi_start_stream.part.0':
>> imx8mq-mipi-csi2.c:91:55: warning: 'hs_settle' may be used
>> uninitialized [-Wmaybe-uninitialized]
>>    91 | #define GPR_CSI2_1_S_PRG_RXHS_SETTLE(x) (((x) & 0x3f) << 2)
>>       |                                                       ^~
>> imx8mq-mipi-csi2.c:357:13: note: 'hs_settle' was declared here
>>   357 |         u32 hs_settle;
>>       |             ^~~~~~~~~
>>
>> It's a false positive, but it is too complicated for the compiler to
>> detect that.
>>
>> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
>> ---
>> diff --git a/drivers/staging/media/imx/imx8mq-mipi-csi2.c
>> b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
>> index 32700cb8bc4d..ca2efcc21efe 100644
>> --- a/drivers/staging/media/imx/imx8mq-mipi-csi2.c
>> +++ b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
>> @@ -354,7 +354,7 @@ static int imx8mq_mipi_csi_start_stream(struct
>> csi_state *state,
>>                                         struct v4l2_subdev_state
>> *sd_state)
>>  {
>>         int ret;
>> -       u32 hs_settle;
>> +       u32 hs_settle = 0;
>>
>>         ret = imx8mq_mipi_csi_sw_reset(state);
>>         if (ret)
> 
>
diff mbox series

Patch

diff --git a/drivers/staging/media/imx/imx8mq-mipi-csi2.c b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
index 32700cb8bc4d..ca2efcc21efe 100644
--- a/drivers/staging/media/imx/imx8mq-mipi-csi2.c
+++ b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
@@ -354,7 +354,7 @@  static int imx8mq_mipi_csi_start_stream(struct csi_state *state,
 					struct v4l2_subdev_state *sd_state)
 {
 	int ret;
-	u32 hs_settle;
+	u32 hs_settle = 0;

 	ret = imx8mq_mipi_csi_sw_reset(state);
 	if (ret)