2023-05-03 10:46:57

by Dan Carpenter

[permalink] [raw]
Subject: [PATCH] accel/qaic: silence some uninitialized variable warnings

Smatch complains that these are not initialized if get_cntl_version()
fails but we still print them in the debug message. Not the end of
the world, but true enough. Let's just initialize them to a dummy value
to make the checker happy.

Signed-off-by: Dan Carpenter <[email protected]>
---
drivers/accel/qaic/qaic_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/accel/qaic/qaic_drv.c b/drivers/accel/qaic/qaic_drv.c
index ff80eb571729..e10e8b603e37 100644
--- a/drivers/accel/qaic/qaic_drv.c
+++ b/drivers/accel/qaic/qaic_drv.c
@@ -263,7 +263,7 @@ static void qaic_destroy_drm_device(struct qaic_device *qdev, s32 partition_id)
static int qaic_mhi_probe(struct mhi_device *mhi_dev, const struct mhi_device_id *id)
{
struct qaic_device *qdev;
- u16 major, minor;
+ u16 major = -1, minor = -1;
int ret;

/*
--
2.39.2


2023-05-10 15:07:56

by Jeffrey Hugo

[permalink] [raw]
Subject: Re: [PATCH] accel/qaic: silence some uninitialized variable warnings

On 5/3/2023 4:41 AM, Dan Carpenter wrote:
> Smatch complains that these are not initialized if get_cntl_version()
> fails but we still print them in the debug message. Not the end of
> the world, but true enough. Let's just initialize them to a dummy value
> to make the checker happy.
>
> Signed-off-by: Dan Carpenter <[email protected]>

Thanks for the cleanup.

Reviewed-by: Jeffrey Hugo <[email protected]>

Could use a fixes tag, and also I'd prefer to maintain the style of
sorting the variable declaration lines by line length. Given the minor
nature of these nits, I plan to address them.

2023-05-10 16:59:10

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH] accel/qaic: silence some uninitialized variable warnings

On Wed, May 10, 2023 at 08:57:03AM -0600, Jeffrey Hugo wrote:
> On 5/3/2023 4:41 AM, Dan Carpenter wrote:
> > Smatch complains that these are not initialized if get_cntl_version()
> > fails but we still print them in the debug message. Not the end of
> > the world, but true enough. Let's just initialize them to a dummy value
> > to make the checker happy.
> >
> > Signed-off-by: Dan Carpenter <[email protected]>
>
> Thanks for the cleanup.
>
> Reviewed-by: Jeffrey Hugo <[email protected]>
>
> Could use a fixes tag

The fixes tag thing could have gone either way. It's really minor.

> and also I'd prefer to maintain the style of sorting
> the variable declaration lines by line length. Given the minor nature of
> these nits, I plan to address them.

Thanks!

regards,
dan carpenter

2023-05-11 15:44:06

by Carl Vanderlip

[permalink] [raw]
Subject: Re: [PATCH] accel/qaic: silence some uninitialized variable warnings

On 5/3/2023 3:41 AM, Dan Carpenter wrote:
> Smatch complains that these are not initialized if get_cntl_version()
> fails but we still print them in the debug message. Not the end of
> the world, but true enough. Let's just initialize them to a dummy value
> to make the checker happy.
>
> Signed-off-by: Dan Carpenter <[email protected]>

LGTM

Reviewed-by: Carl Vanderlip <[email protected]>

Subject: Re: [PATCH] accel/qaic: silence some uninitialized variable warnings



On 5/3/2023 4:11 PM, Dan Carpenter wrote:
> Smatch complains that these are not initialized if get_cntl_version()
> fails but we still print them in the debug message. Not the end of
> the world, but true enough. Let's just initialize them to a dummy value
> to make the checker happy.
>
> Signed-off-by: Dan Carpenter <[email protected]>
> ---
> drivers/accel/qaic/qaic_drv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/accel/qaic/qaic_drv.c b/drivers/accel/qaic/qaic_drv.c
> index ff80eb571729..e10e8b603e37 100644
> --- a/drivers/accel/qaic/qaic_drv.c
> +++ b/drivers/accel/qaic/qaic_drv.c
> @@ -263,7 +263,7 @@ static void qaic_destroy_drm_device(struct qaic_device *qdev, s32 partition_id)
> static int qaic_mhi_probe(struct mhi_device *mhi_dev, const struct mhi_device_id *id)
> {
> struct qaic_device *qdev;
> - u16 major, minor;
> + u16 major = -1, minor = -1;
> int ret;
>
> /*
>

Thank you Dan for the patch.

Reviewed-by: Pranjal Ramajor Asha Kanojiya <[email protected]>

I agree with Jeff's comment to sort the variable declaration length wise.

2023-05-16 19:37:47

by Jeffrey Hugo

[permalink] [raw]
Subject: Re: [PATCH] accel/qaic: silence some uninitialized variable warnings

On 5/10/2023 10:48 AM, Dan Carpenter wrote:
> On Wed, May 10, 2023 at 08:57:03AM -0600, Jeffrey Hugo wrote:
>> On 5/3/2023 4:41 AM, Dan Carpenter wrote:
>>> Smatch complains that these are not initialized if get_cntl_version()
>>> fails but we still print them in the debug message. Not the end of
>>> the world, but true enough. Let's just initialize them to a dummy value
>>> to make the checker happy.
>>>
>>> Signed-off-by: Dan Carpenter <[email protected]>
>>
>> Thanks for the cleanup.
>>
>> Reviewed-by: Jeffrey Hugo <[email protected]>
>>
>> Could use a fixes tag
>
> The fixes tag thing could have gone either way. It's really minor.
>
>> and also I'd prefer to maintain the style of sorting
>> the variable declaration lines by line length. Given the minor nature of
>> these nits, I plan to address them.
>
> Thanks!

Pushed to drm-misc-fixes

-Jeff