diff mbox series

[2/2] usb: pci-quirks: Remove a useless initialization

Message ID a3c703152d89a2c6b34b31f0158f84ba504e24d8.1679434951.git.christophe.jaillet@wanadoo.fr
State New
Headers show
Series [1/2] usb: pci-quirks: Reduce the length of a spinlock section in usb_amd_find_chipset_info() | expand

Commit Message

Christophe JAILLET March 21, 2023, 9:43 p.m. UTC
'info' is memset()'ed a few lines below and is not use in the between.

There is no need to initialize one of its field to false here.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/usb/host/pci-quirks.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Greg Kroah-Hartman March 23, 2023, 4:32 p.m. UTC | #1
On Tue, Mar 21, 2023 at 10:43:10PM +0100, Christophe JAILLET wrote:
> 'info' is memset()'ed a few lines below and is not use in the between.
> 
> There is no need to initialize one of its field to false here.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/usb/host/pci-quirks.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
> index 6b741327d2c4..46f2412dcb40 100644
> --- a/drivers/usb/host/pci-quirks.c
> +++ b/drivers/usb/host/pci-quirks.c
> @@ -208,7 +208,6 @@ static void usb_amd_find_chipset_info(void)
>  {
>  	unsigned long flags;
>  	struct amd_chipset_info info;
> -	info.need_pll_quirk = false;

Why not just change the line above it to:
	struct amd_chipset_info info = { };
and drop the call to memset entirely?

thanks,

greg k-h
Christophe JAILLET March 23, 2023, 7:17 p.m. UTC | #2
Le 23/03/2023 à 17:32, Greg Kroah-Hartman a écrit :
> On Tue, Mar 21, 2023 at 10:43:10PM +0100, Christophe JAILLET wrote:
>> 'info' is memset()'ed a few lines below and is not use in the between.
>>
>> There is no need to initialize one of its field to false here.
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> ---
>>   drivers/usb/host/pci-quirks.c | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
>> index 6b741327d2c4..46f2412dcb40 100644
>> --- a/drivers/usb/host/pci-quirks.c
>> +++ b/drivers/usb/host/pci-quirks.c
>> @@ -208,7 +208,6 @@ static void usb_amd_find_chipset_info(void)
>>   {
>>   	unsigned long flags;
>>   	struct amd_chipset_info info;
>> -	info.need_pll_quirk = false;
> Why not just change the line above it to:
> 	struct amd_chipset_info info = { };
> and drop the call to memset entirely?

I find an explicit memset() more readable, but it's mostly a matter of 
taste.

I'll send a v2.

CJ


> thanks,
>
> greg k-h
diff mbox series

Patch

diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index 6b741327d2c4..46f2412dcb40 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -208,7 +208,6 @@  static void usb_amd_find_chipset_info(void)
 {
 	unsigned long flags;
 	struct amd_chipset_info info;
-	info.need_pll_quirk = false;
 
 	spin_lock_irqsave(&amd_lock, flags);