From patchwork Fri Feb 2 15:40:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10197049 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B78C86037D for ; Fri, 2 Feb 2018 15:40:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5E0728EB3 for ; Fri, 2 Feb 2018 15:40:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9973A28EB6; Fri, 2 Feb 2018 15:40:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2E29E28EB3 for ; Fri, 2 Feb 2018 15:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LDKppyiijDznLl0+ytsqEPVclVzMvWEWbSoDED7PIZo=; b=ervKIp50pYahto S6O4wV/iMhOH72rEEqYV5/wd3PDUKuzSqanKIg/YtTsM+RhWwmLymBGcgi4p885D1oli/0q/hetYe 02HQ/xp66PLCU2IOOfjlcasThqO6lpEe3UzPhTDbcsd+qC6/WctXq+9YKnQKIdrGZsAqqjnYxSCGQ PqK85aR6qBPOGBz+iH/Zx/uXMV2YByp7uHDCLgk6yPHjh2uFaP9ANlPwgujhtk7RC2mcfR+Z0TACD j7L4CLcqd/uguq40XnbY739jjxNXyXKU8rs/btv7AuKItz9nXD0Ee7rytD6VFywsbAISUcsacBJXv En++FjGIRblsNh8S72Zw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ehdS6-0004e3-B1; Fri, 02 Feb 2018 15:40:34 +0000 Received: from mout.web.de ([212.227.15.4]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ehdS3-0004df-DQ for linux-arm-kernel@lists.infradead.org; Fri, 02 Feb 2018 15:40:33 +0000 Received: from [192.168.1.2] ([92.228.169.238]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MejjU-1eNvmE2H8q-00OEV3; Fri, 02 Feb 2018 16:40:18 +0100 Subject: [PATCH 2/2] i2c-nomadik: Improve a size determination in nmk_i2c_probe() From: SF Markus Elfring To: linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linus Walleij , Wolfram Sang References: <97f41346-6abb-1c14-f536-ad12bbcb4c60@users.sourceforge.net> Message-ID: Date: Fri, 2 Feb 2018 16:40:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <97f41346-6abb-1c14-f536-ad12bbcb4c60@users.sourceforge.net> Content-Language: en-US X-Provags-ID: V03:K0:YyIlpzs0C6ZKp9YaS9+pr3tGNMOKDIhj50srxdbvfHZMgFHy9zz CKYEZ0UOk5FrAlqhV3AEYOmZG/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radead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, LKML Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Fri, 2 Feb 2018 16:28:20 +0100 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/i2c/busses/i2c-nomadik.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index a783ad25fe19..e353b528140e 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c @@ -973,7 +973,7 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id) struct i2c_vendor_data *vendor = id->data; u32 max_fifo_threshold = (vendor->fifodepth / 2) - 1; - dev = devm_kzalloc(&adev->dev, sizeof(struct nmk_i2c_dev), GFP_KERNEL); + dev = devm_kzalloc(&adev->dev, sizeof(*dev), GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto err_no_mem;