OSDN Git Service

spi: ppc4xx: add parenthesis for sizeof
authorZhiqi Song <songzhiqi1@huawei.com>
Tue, 18 May 2021 01:38:22 +0000 (09:38 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 20 May 2021 17:00:40 +0000 (18:00 +0100)
Fix missing parenthesis of sizeof reported by checkpatch.pl:
 WARNING: sizeof *pp should be sizeof(*pp).

The kernel coding style suggests thinking of sizeof as a function
and add parenthesis.

Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
Link: https://lore.kernel.org/r/1621301902-64158-8-git-send-email-songzhiqi1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-ppc4xx.c

index 59d201a..d65f047 100644 (file)
@@ -223,7 +223,7 @@ static int spi_ppc4xx_setup(struct spi_device *spi)
        }
 
        if (cs == NULL) {
-               cs = kzalloc(sizeof *cs, GFP_KERNEL);
+               cs = kzalloc(sizeof(*cs), GFP_KERNEL);
                if (!cs)
                        return -ENOMEM;
                spi->controller_state = cs;
@@ -349,7 +349,7 @@ static int spi_ppc4xx_of_probe(struct platform_device *op)
        int ret;
        const unsigned int *clk;
 
-       master = spi_alloc_master(dev, sizeof *hw);
+       master = spi_alloc_master(dev, sizeof(*hw));
        if (master == NULL)
                return -ENOMEM;
        master->dev.of_node = np;