* [PATCH -next] ata: pata_macio: fix comparing pointer to 0
@ 2020-01-21 1:28 ` Chen Zhou
2020-01-21 10:58 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 2+ messages in thread
From: Chen Zhou @ 2020-01-21 1:28 UTC (permalink / raw)
To: b.zolnierkie, axboe; +Cc: linux-ide, linux-kernel, chenzhou10
Fixes coccicheck warning:
./drivers/ata/pata_macio.c:982:31-32:
WARNING comparing pointer to 0, suggest !E
Compare pointer-typed values to NULL rather than 0.
Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
---
drivers/ata/pata_macio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
index 1bfd015..e47a282 100644
--- a/drivers/ata/pata_macio.c
+++ b/drivers/ata/pata_macio.c
@@ -979,7 +979,7 @@ static void pata_macio_invariants(struct pata_macio_priv *priv)
priv->aapl_bus_id = bidp ? *bidp : 0;
/* Fixup missing Apple bus ID in case of media-bay */
- if (priv->mediabay && bidp == 0)
+ if (priv->mediabay && !bidp)
priv->aapl_bus_id = 1;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] ata: pata_macio: fix comparing pointer to 0
2020-01-21 1:28 ` [PATCH -next] ata: pata_macio: fix comparing pointer to 0 Chen Zhou
@ 2020-01-21 10:58 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-01-21 10:58 UTC (permalink / raw)
To: Chen Zhou; +Cc: axboe, linux-ide, linux-kernel
On 1/21/20 2:28 AM, Chen Zhou wrote:
> Fixes coccicheck warning:
>
> ./drivers/ata/pata_macio.c:982:31-32:
> WARNING comparing pointer to 0, suggest !E
>
> Compare pointer-typed values to NULL rather than 0.
>
> Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/ata/pata_macio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
> index 1bfd015..e47a282 100644
> --- a/drivers/ata/pata_macio.c
> +++ b/drivers/ata/pata_macio.c
> @@ -979,7 +979,7 @@ static void pata_macio_invariants(struct pata_macio_priv *priv)
> priv->aapl_bus_id = bidp ? *bidp : 0;
>
> /* Fixup missing Apple bus ID in case of media-bay */
> - if (priv->mediabay && bidp == 0)
> + if (priv->mediabay && !bidp)
> priv->aapl_bus_id = 1;
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-21 10:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20200121013332eucas1p223fe0dd6da9ac002f3d5dd152d4ea7a8@eucas1p2.samsung.com>
2020-01-21 1:28 ` [PATCH -next] ata: pata_macio: fix comparing pointer to 0 Chen Zhou
2020-01-21 10:58 ` Bartlomiej Zolnierkiewicz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).