pata_ipx4xx_cf: Fix unsigned comparison with less than zero
PATCH 1/1 pata_ipx4xx_cf: Fix unsigned comparison with less than zero
From: Junlin Yang <[email protected]>
The return from the call to platform_get_irq() is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'irq', so making 'irq' an int, and change the position to keep the code format.
./drivers/ata/pata_ixp4xx_cf.c:168:5-8:
WARNING: Unsigned expression compared with zero: irq > 0
--- drivers/ata/pata_ixp4xx_cf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/pata_ixp4xx_cf.c +1 -1
@@ -135,12 +135,12 @@ static void ixp4xx_setup_port(struct ata_port *ap,static int ixp4xx_pata_probe (struct platform_device *pdev) { -unsigned int irq;struct resource *cs0, *cs1;struct ata_host *host;struct ata_port *ap;struct ixp4xx_pata_data *data =dev_get_platdata (&pdev->dev);int ret; +int irq; cs0 =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); cs1 =platform_get_resource (pdev,IORESOURCE_MEM ,1 );
Signature · 1 line
1.9.1
Jens Axboe
AppliedQuoted 9 lines · angkery
From: Junlin Yang <[email protected]>
The return from the call to
platform_get_irq()is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'irq', so making 'irq' an int, and change the position to keep the code format../drivers/ata/pata_ixp4xx_cf.c:168:5-8:
WARNING: Unsigned expression compared with zero: irq > 0
Applied, thanks.
Signature · 1 line
Jens Axboe
Quoted 9 lines · angkery
From: Junlin Yang <[email protected]>
The return from the call to
platform_get_irq()is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'irq', so making 'irq' an int, and change the position to keep the code format../drivers/ata/pata_ixp4xx_cf.c:168:5-8:
WARNING: Unsigned expression compared with zero: irq > 0
I'd understand < 0... but > 0? What tool warned about this issue?
Quoted 10 lines
Signed-off-by Junlin Yang <[email protected]>--- drivers/ata/pata_ixp4xx_cf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/ata/pata_ixp4xx_cf.c +0
-0
drivers/ata/pata_ixp4xx_cf.c static void ixp4xx_setup_port(struct ata_port *ap, · line 138
Quoted 4 lines
drivers/ata/pata_ixp4xx_cf.c +0
-1@@ -135,12 +135,12 @@ static void ixp4xx_setup_port(struct ata_port *ap,static int ixp4xx_pata_probe (struct platform_device *pdev) { -unsigned int irq;
Oops, not sure how I missed that. :-/
Thanks for fixing my overlook. :-)
[...]
MBR, Sergei
Sergei Shtylyov
Reviewed-byQuoted 23 lines · Sergei Shtylyov
Quoted 9 lines
From: Junlin Yang <[email protected]>
The return from the call to
platform_get_irq()is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'irq', so making 'irq' an int, and change the position to keep the code format../drivers/ata/pata_ixp4xx_cf.c:168:5-8:
WARNING: Unsigned expression compared with zero: irq > 0I'd understand < 0... but > 0? What tool warned about this issue?
Quoted 11 lines
Signed-off-by Junlin Yang <[email protected]>--- drivers/ata/pata_ixp4xx_cf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/ata/pata_ixp4xx_cf.c +0
-0@@ -135,12 +135,12 @@ static void ixp4xx_setup_port(struct ata_port *ap,
Quoted 6 lines
drivers/ata/pata_ixp4xx_cf.c static void ixp4xx_setup_port(struct ata_port *ap, · line 138
Quoted 3 lines
drivers/ata/pata_ixp4xx_cf.c +0
-1static int ixp4xx_pata_probe (struct platform_device *pdev) { -unsigned int irq;Oops, not sure how I missed that. :-/
Thanks for fixing my overlook. :-)
Forgot to add my
Quoted 1 line
[...]
MBR, Sergei
Quoted 41 lines · On Fri, 9 Apr 2021 20:02:56 +0300 Sergei Shtylyov <[email protected]>…
Quoted 19 lines · Sergei Shtylyov
Quoted 9 lines
From: Junlin Yang <[email protected]>
The return from the call to
platform_get_irq()is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'irq', so making 'irq' an int, and change the position to keep the code format../drivers/ata/pata_ixp4xx_cf.c:168:5-8:
WARNING: Unsigned expression compared with zero: irq > 0I'd understand < 0... but > 0? What tool warned about this issue?
Quoted 7 lines
yes, by coccicheck, i will update commits information.
Signed-off-by Junlin Yang <[email protected]>--- drivers/ata/pata_ixp4xx_cf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 12 lines
drivers/ata/pata_ixp4xx_cf.c static void ixp4xx_setup_port(struct · line 138
Quoted 9 lines
(quoted diff) +0
-0
b/drivers/ata/pata_ixp4xx_cf.cindex abc0e87..43215a4 100644drivers/ata/pata_ixp4xx_cf.c +0
-1@@ -135,12 +135,12 @@ static void ixp4xx_setup_port(struct ata_port *ap, static int ixp4xx_pata_probe(struct platform_device *pdev) { - unsigned int irq;Oops, not sure how I missed that. :-/
Thanks for fixing my overlook. :-)Forgot to add my
Reviewed-by Sergei Shtylyov <[email protected]>Quoted 1 line
[...]
MBR, Sergei
Quoted 12 lines · angkery
Quoted 9 lines · On Fri, 9 Apr 2021 20:02:56 +0300 Sergei Shtylyov <[email protected]>…
Quoted 7 lines · Sergei Shtylyov
Quoted 7 lines
From: Junlin Yang <[email protected]>
The return from the call to
platform_get_irq()is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'irq', so making 'irq' an int, and change the position to keep the code format.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
./drivers/ata/pata_ixp4xx_cf.c:168:5-8:
WARNING: Unsigned expression compared with zero: irq > 0I'd understand < 0... but > 0? What tool warned about this issue?
Quoted 1 line
yes, by coccicheck, i will update commits information.
Thanks!
Yet, looking at your subject, the above should read irq < 0, not > 0.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Signed-off-by Junlin Yang <[email protected]>