From patchwork Sat Nov 11 19:22:36 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: 10054485 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 4238760632 for ; Sat, 11 Nov 2017 19:22:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EB57297D0 for ; Sat, 11 Nov 2017 19:22:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23A0329A16; Sat, 11 Nov 2017 19:22:47 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 691FF297D0 for ; Sat, 11 Nov 2017 19:22:46 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 13D112671DF; Sat, 11 Nov 2017 20:22:45 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 87CBA2671E7; Sat, 11 Nov 2017 20:22:43 +0100 (CET) Received: from mout.web.de (mout.web.de [212.227.15.3]) by alsa0.perex.cz (Postfix) with ESMTP id 9834E2671DF for ; Sat, 11 Nov 2017 20:22:41 +0100 (CET) Received: from [192.168.1.3] ([77.181.92.20]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LmhQx-1em7261TbX-00aAqi; Sat, 11 Nov 2017 20:22:37 +0100 From: SF Markus Elfring To: alsa-devel@alsa-project.org, Arvind Yadav , Bhumika Goyal , Jaroslav Kysela , Mark Brown , Takashi Iwai References: Message-ID: Date: Sat, 11 Nov 2017 20:22:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:UMM7c9Yej6i6EZUYT2HHvrtufepa++0Z3csQ9b5KjaZ7pN4kw/6 4Zo0So5ZppT2fAYyCexREDu9zAlcVYbasbfbUssHJS/a6JGtRq2216X71e6ASRCIbYV/UJ9 b2dZ5DY7wQlrJTZMa5/Wf/VrwlhKLpD5/dEFe4WicYJQOCXm9jV38J2sG5UEirf2SY+gRRu vxuQ72IW64k5aNIMeU6xA== X-UI-Out-Filterresults: notjunk:1; V01:K0:OKb6/MPxtCQ=:rsNOs1BFRVjKzLzmu9HWvA E/On2IxB3z0Va4bpP5ay3pnJgtaHZnggsKj+q5cKjT2kREeh51umivcrUAzGVizUWrQiLrDt9 COyeYhCHn81uPtPJCYqUX79VISqaQeh+lcJl1wIQYgmrsMFi48LAMoZhzsSWtIwISZPiEvqlE MHgfhjzw/pEAllShLJCJvXqzIGmJRZcBtaJRm9wdzoQv3fh5Mj/VWNK2gvK4R4FpsAjpWIwEU 2jL+Q23camlNwCOSnhc0wZ2Gst6RoGatVxSmq5/LoPH8dXrQ89wSae44YKym0gNL1F+j8D7Co FTvj7OFM5n6O4gkrChPFzWyV0O/a1JlyQae3epdUmFB7mVu5AbRe0w/GmREPdvV8yvRe0B3l6 J6zRoKu9Wk+mNqk8rlHsYN4halKbZYZNjEF/fjakRo6z8qbD+fvR8TU94uj5cbux9II4DsSJ9 uyVMotYmq/UXBGA3y3zCsfI+k7DOlOutrrJU8Hiy4XuOcMF+FDftaX/WowX+yZinMLhgmUGpg TvIcxxwDJ2ARMtwPHzW5OhBdtdFUKFo/xokbzuUR4QvdTPZGNX+TrxUO352WEzg6y9D2oc+jO cDTJLomfZb2U792bawVogpTrSqEN98s5ysTpEHAJc17DrwL8KzudjpQCiIxctd3QQwrfiUnzr JbuvBG821WDS05DLOVLgs1FToD1P+bN5HniIDODuuBzk7UrQLOE2Kf/xfVCthfygm06+qedDw 9ujFSk6FXUwi8TzZOp32HGLxZ15DXE0bJximBmIkYHh6crKh21rQys8XSMc0IFPwMitUHLtKE /qzUG4MzxLevQ24zAdF8J5anAs271hvhqzDEGkBppWLUx3DV3E= Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH 2/3] ALSA: sgio2audio: Improve a size determination in snd_sgio2audio_create() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 11 Nov 2017 20:02:07 +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 --- sound/mips/sgio2audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c index 62715a01f507..9e175a184b66 100644 --- a/sound/mips/sgio2audio.c +++ b/sound/mips/sgio2audio.c @@ -840,7 +840,7 @@ static int snd_sgio2audio_create(struct snd_card *card, if (!(readq(&mace->perif.audio.control) & AUDIO_CONTROL_CODEC_PRESENT)) return -ENOENT; - chip = kzalloc(sizeof(struct snd_sgio2audio), GFP_KERNEL); + chip = kzalloc(sizeof(*chip), GFP_KERNEL); if (chip == NULL) return -ENOMEM;