From patchwork Wed Dec 13 17:34:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10110487 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 DFB7860352 for ; Wed, 13 Dec 2017 17:40:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2C5B28F09 for ; Wed, 13 Dec 2017 17:40:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6DC428E51; Wed, 13 Dec 2017 17:40:20 +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 51E0E28E56 for ; Wed, 13 Dec 2017 17:40:20 +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=5nbsUNZodnDvo4Lgpw7zQ6BY3ZsDjnNS/xopX8BHa4Q=; b=J8qazLsvvV8INk iRQ29V8e1SM76ZXOe3ldJOrJi0YnkBLeShvChS+TsB9mwgk6YiX60RzWAEdaiyJ1gLhE8FpKDR6g3 1qpPlI3rj6Wp8RtFsiNC0uuCGyQ1uZ2RJLUTdC2X6QB+8Qs4glvC9At15nX51Nj0cQnpTWlmFN6M9 L9ThS5VT2xzNsOD6NXwxM8fZ0OaqUH4AfoQ2Y8EaZHz0Ccl4fQsfAjPhp+iG4VQ5rPAX1ROe1Kzo9 VyC5V9QNLASHGTKlimrKNU4NFHtf3QUl8hZQxKeXgHTVL2hPIFaZVYQa5M/CCPA9UH53cfdVWEztI CWFPKLJ2i9o/rEFveQMg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ePB11-0004Zz-Nk; Wed, 13 Dec 2017 17:40:19 +0000 Received: from mout.web.de ([212.227.15.3]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ePB0x-00030N-RE for linux-arm-kernel@lists.infradead.org; Wed, 13 Dec 2017 17:40:17 +0000 Received: from [192.168.1.3] ([77.181.208.154]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M6DjG-1fEQ012e1C-00yBR3; Wed, 13 Dec 2017 18:34:43 +0100 Subject: [PATCH 2/3] soc/fsl/qe: Improve a size determination in two functions From: SF Markus Elfring To: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Li Yang , Qiang Zhao References: <07738369-a787-98b4-41a5-71b7d630c356@users.sourceforge.net> Message-ID: <24d6e67d-6bbf-5d2b-5003-79b50a84f268@users.sourceforge.net> Date: Wed, 13 Dec 2017 18:34:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <07738369-a787-98b4-41a5-71b7d630c356@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:Bknh5tprI4K9hLjM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F0FLVNCc6LQqe3jZCkG9gdkUjsNmWOuWEfMGtUcwgC0= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171213_094016_222385_F38E93C9 X-CRM114-Status: UNSURE ( 9.67 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.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: Wed, 13 Dec 2017 17:51:21 +0100 Replace the specification of data structures by pointer dereferences 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/soc/fsl/qe/ucc_fast.c | 2 +- drivers/soc/fsl/qe/ucc_slow.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/fsl/qe/ucc_fast.c b/drivers/soc/fsl/qe/ucc_fast.c index 59b68bf4aebb..2092bfdcf1bc 100644 --- a/drivers/soc/fsl/qe/ucc_fast.c +++ b/drivers/soc/fsl/qe/ucc_fast.c @@ -194,7 +194,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc return -EINVAL; } - uccf = kzalloc(sizeof(struct ucc_fast_private), GFP_KERNEL); + uccf = kzalloc(sizeof(*uccf), GFP_KERNEL); if (!uccf) return -ENOMEM; diff --git a/drivers/soc/fsl/qe/ucc_slow.c b/drivers/soc/fsl/qe/ucc_slow.c index fc91412e2300..c21a42c11080 100644 --- a/drivers/soc/fsl/qe/ucc_slow.c +++ b/drivers/soc/fsl/qe/ucc_slow.c @@ -152,7 +152,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc return -EINVAL; } - uccs = kzalloc(sizeof(struct ucc_slow_private), GFP_KERNEL); + uccs = kzalloc(sizeof(*uccs), GFP_KERNEL); if (!uccs) return -ENOMEM;