From patchwork Fri Aug 25 20:25:17 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: 9922755 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 1E9C5602BD for ; Fri, 25 Aug 2017 20:26:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11EE42852A for ; Fri, 25 Aug 2017 20:26:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06F322852B; Fri, 25 Aug 2017 20:26:09 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5CD22852C for ; Fri, 25 Aug 2017 20:26:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932206AbdHYUZa (ORCPT ); Fri, 25 Aug 2017 16:25:30 -0400 Received: from mout.web.de ([212.227.15.14]:55055 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755890AbdHYUZ3 (ORCPT ); Fri, 25 Aug 2017 16:25:29 -0400 Received: from [192.168.1.2] ([78.48.209.8]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LcgYZ-1d59mT3dCx-00kC1o; Fri, 25 Aug 2017 22:25:18 +0200 Subject: [PATCH 2/3] SCSI-sg: Improve a size determination in sg_alloc() From: SF Markus Elfring To: linux-scsi@vger.kernel.org, Doug Gilbert , "James E. J. Bottomley" , "Martin K. Petersen" Cc: LKML , kernel-janitors@vger.kernel.org References: <0fffccee-7cc1-1321-2c6b-00ac06b304b8@users.sourceforge.net> Message-ID: Date: Fri, 25 Aug 2017 22:25:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <0fffccee-7cc1-1321-2c6b-00ac06b304b8@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:uoyUC6ldag52/XufiHvAi0yyNgmvvQzGfv2gT3BAniXISaD35xo y0pzUQkpqNopKwG86LE7J3IKWpqz0LXKfS30mhylBfpH+huiKR0Z/xqEZANHHMo7swfCc+a qQbCnOVSZq1uy/L7Y5jPncM72sQc991EaE1OOBx/Hkh0jAjrLriYRmCSbhhq1ZGBL8DrSr6 91K2AoXW2Yf7vxYZ4rI8Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:eHoYhsoNOY8=:A1pJp0U5dMzk1JgjYIw+k8 3pXoRV7TNoR8YGeHQj+0FnFGjdp45BqV284f8UCZ/IbSaQWQ4DFhCaQs2EL4oNED5ud+4s5h0 s9NYUMVRD/hXCunDVcE678tPNvm/N0N+6mb2Vxjd5yrRAoeI0yYv5WH5h3AAuIXQj6nUraeE2 E/I7gAprW2+us5OAfszu7O/lRBWf8guX+/Go6FTM4HAPPFXKNPM5cETCNXxjBBKpIAs42WR4m LaD8deGZ/UEH4yNvL3tUFF1tio6iblUbBMytqruBwuoO2s+11IlR7E6KwmuyRQfx6a8xfPnAR x7I0MaX/rh3wP+2IeVUpOdCuO5uOC4JTDekGVD+uHEv56KCmtN13qUQptM+Qm+q3IchwmEShn 6KZOt+z1tVLEQEDoeq9TnB01M0SgILdS4+9DgXVngOyh17VLY1kp/7HtzNUz2wvXH3fBMMGPb N8viE/bd3jyiBIfybECG6rsgcnCFVvjXDqbuzLvPza7ZePu/tuSb+61ZwNDWcXgYb6Mbpg2BP lmNQHJl1g2WT1g8abLhxNIL63YFtAkPhfOvVRoAkClANlOf4NrxpKZC5TCQgN6Wzr25ViUCOO 2p0RVMLFHmg+hCOMMsvWruIbkKaG8Gypq2xJhMDLO35qT0sx8K6AEAJce+jumbvMCQW4PVYO/ sz2qjzZ68EGdEzIzgDoEqrtbSb7sUl2FazRoYNkR86HsPq26bo25ZZgHTzYGTieAX0VQUz630 hf4R4c7vhQuCqTRT2T8LHvTMOidHJy3vL+nnIkhJfcqDX6khgs32WmTPdm0qxjjbzjGu3Uwae RumI9G6Wx1eq3SIhRQYRTLtkGEL5kYQ/f8i++3OIH64mlM4wZA= Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Fri, 25 Aug 2017 21:55:14 +0200 Replace the specification of a data type 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. Signed-off-by: Markus Elfring --- drivers/scsi/sg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 8ca10a2fc1a0..4a2db7ff14cc 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1403,7 +1403,7 @@ sg_alloc(struct gendisk *disk, struct scsi_device *scsidp) int error; u32 k; - sdp = kzalloc(sizeof(Sg_device), GFP_KERNEL); + sdp = kzalloc(sizeof(*sdp), GFP_KERNEL); if (!sdp) return ERR_PTR(-ENOMEM);