[PATCH linux-next] macintosh/windfarm: fix comparing pointer to 0

Arnd Bergmann arnd at arndb.de
Mon Sep 19 03:45:22 AEST 2022


On Sun, Sep 18, 2022, at 5:50 PM, cgel.zte at gmail.com wrote:
> @@ -970,7 +970,7 @@ static int pm121_init_pm(void)
>         const struct smu_sdbp_header *hdr;
>
>         hdr = smu_get_sdb_partition(SMU_SDB_SENSORTREE_ID, NULL);
> -       if (hdr != 0) {
> +       if (hdr != NULL) {
>                 struct smu_sdbp_sensortree *st =
>                         (struct smu_sdbp_sensortree *)&hdr[1];

The more common way of writing this in the kernel is 
"if (hdr)".

     Arnd


More information about the Linuxppc-dev mailing list