From patchwork Tue Dec 29 11:32:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Manuel_P=C3=A9gouri=C3=A9-Gonnard?= X-Patchwork-Id: 561537 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6291A140C8F for ; Tue, 29 Dec 2015 22:37:32 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aDsXG-0005nu-K9; Tue, 29 Dec 2015 11:33:50 +0000 Received: from mordell.elzevir.fr ([92.243.3.74]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aDsXA-0005lH-Jt for linux-mtd@lists.infradead.org; Tue, 29 Dec 2015 11:33:45 +0000 Received: from dyson.elzevir.fr (thue.elzevir.fr [88.165.216.11]) by mordell.elzevir.fr (Postfix) with ESMTPS id 5CE2316076; Tue, 29 Dec 2015 12:33:18 +0100 (CET) Received: by dyson.elzevir.fr (Postfix, from userid 1000) id CFB6DE2B39; Tue, 29 Dec 2015 12:33:17 +0100 (CET) From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= To: kamlakant.patel@broadcom.com Subject: [PATCH 1/4] staging: mt29f: fix malloc style for structs Date: Tue, 29 Dec 2015 12:32:19 +0100 Message-Id: <1451388742-22964-1-git-send-email-mpg@elzevir.fr> X-Mailer: git-send-email 2.6.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151229_033344_886027_4C031BB4 X-CRM114-Status: UNSURE ( 8.41 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gregkh@linuxfoundation.org, =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= , linux-mtd@lists.infradead.org, manonuevo@micron.com Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org According to CodingStyle, sizeof(*p) is better than sizeof(struct foo). Signed-off-by: Manuel Pégourié-Gonnard --- drivers/staging/mt29f_spinand/mt29f_spinand.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c b/drivers/staging/mt29f_spinand/mt29f_spinand.c index 47bb56f1f8c0..dc2b1fc995c2 100644 --- a/drivers/staging/mt29f_spinand/mt29f_spinand.c +++ b/drivers/staging/mt29f_spinand/mt29f_spinand.c @@ -852,8 +852,7 @@ static int spinand_probe(struct spi_device *spi_nand) struct spinand_state *state; struct mtd_part_parser_data ppdata; - info = devm_kzalloc(&spi_nand->dev, sizeof(struct spinand_info), - GFP_KERNEL); + info = devm_kzalloc(&spi_nand->dev, sizeof(*info), GFP_KERNEL); if (!info) return -ENOMEM; @@ -861,8 +860,7 @@ static int spinand_probe(struct spi_device *spi_nand) spinand_lock_block(spi_nand, BL_ALL_UNLOCKED); - state = devm_kzalloc(&spi_nand->dev, sizeof(struct spinand_state), - GFP_KERNEL); + state = devm_kzalloc(&spi_nand->dev, sizeof(*state), GFP_KERNEL); if (!state) return -ENOMEM; @@ -872,8 +870,7 @@ static int spinand_probe(struct spi_device *spi_nand) if (!state->buf) return -ENOMEM; - chip = devm_kzalloc(&spi_nand->dev, sizeof(struct nand_chip), - GFP_KERNEL); + chip = devm_kzalloc(&spi_nand->dev, sizeof(*chip), GFP_KERNEL); if (!chip) return -ENOMEM; @@ -903,7 +900,7 @@ static int spinand_probe(struct spi_device *spi_nand) chip->options |= NAND_CACHEPRG; chip->select_chip = spinand_select_chip; - mtd = devm_kzalloc(&spi_nand->dev, sizeof(struct mtd_info), GFP_KERNEL); + mtd = devm_kzalloc(&spi_nand->dev, sizeof(*mtd), GFP_KERNEL); if (!mtd) return -ENOMEM;