From patchwork Sun Nov 26 14:17:34 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: 10075403 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 278A160353 for ; Sun, 26 Nov 2017 14:17:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A085285E3 for ; Sun, 26 Nov 2017 14:17:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DFDD2899A; Sun, 26 Nov 2017 14:17:59 +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=ham 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 9F881285E3 for ; Sun, 26 Nov 2017 14:17:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752222AbdKZORp (ORCPT ); Sun, 26 Nov 2017 09:17:45 -0500 Received: from mout.web.de ([212.227.15.14]:49656 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752169AbdKZORo (ORCPT ); Sun, 26 Nov 2017 09:17:44 -0500 Received: from [192.168.1.3] ([78.49.168.181]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LcUIo-1f1P6P36uM-00jpJK; Sun, 26 Nov 2017 15:17:35 +0100 Subject: [PATCH 2/2] video: s3c-fb: Improve a size determination in s3c_fb_probe() From: SF Markus Elfring To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz , Jingoo Han Cc: LKML , kernel-janitors@vger.kernel.org References: <2c837da0-6b0f-12e7-4d76-960b660a8911@users.sourceforge.net> Message-ID: <3eb68979-60cd-81e2-7a6b-9caf4afc1737@users.sourceforge.net> Date: Sun, 26 Nov 2017 15:17:34 +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: <2c837da0-6b0f-12e7-4d76-960b660a8911@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:F7V24WDdoTAO9Kv+AJnBp3F8kETErOJ8vjVkEmCpbSVAfNUaaSu ofKaxdsdiM4NrL6Ofrkf+DdeEe+zGaSUktq4XTf+J7/9aSIXGCicq0+HYjdLKkWEVHP7OCO lmAn8anuoAVrbSi2hgCh6b4iBzrJsWMJpsrH3wuG5HWzDeQqnrq0mj7Par+TPJCB5kVMzmN Q4+bDml4KH/nufWXuJ/5g== X-UI-Out-Filterresults: notjunk:1; V01:K0:lWeTeJOtK5s=:qDZdEbI51xDPPkXTExFI9t YGq3LPiArlXikEgG/sDZN4o0tCkV6XSyQ/hrC/YDifTZYMBtHfbrdhSJPDjjeH9cgT+Gsh5ug PX18/p78zg62D4JR+WFcm9mIFz3vPeLkH09vd3fiEncMoLrIeIARsSrNc9qcn0NzvOGjLP/cE lx1dyxBeXdM9wM2phG1rtLF9w2G4aEtY/aUEXu+mahMyWvZ0BfWo+ZioiEv75YmuYDrdb4xgG iBRC4Zu5weK14Ermlxviw+xIhFCMQEo02FcaAayPYQVPNJnEL5eglWLRExj+lWDZ8yVpZ77Qs CwuFmXHSh4gdIZ3P8pUGlroePoH0hflqZBkLIouZOSdfx/7S6e5M4PY2rocbuN1YDpZZltjg9 Yv5nEKYoUD5aDVkwb+gnxD7JNEphiCOPhwLm1yqt5yIhHa81JpOu1Zw+E/7dBFeIyTecBdOpr qzB5FqCyRVZ7ko4+e4XJqs9o6Bt2UpoauAHL2u+v0dGzJdKqDsDHiyCVw4uHVKP64z1aZIBjl 0spRoHu9bbhb9+3F5fq8rWHBLiOciNRjLKyuXIEQKUWS7mHVVlBxD/KSU10wO/QyPpUXtVH8c Ropt9DgwYxBEVSGZqDZm988HYrsLMkQbpknyPAjghXUtvjrTOz+p+E/cwSCuq5GcE6zogYHzW oGNXt5X/PLJpaeVI1163Gb2Pwr0IY/w+FHLXVFcE/tDbagNb/OQsXay1QTZmJFA6JwtfucRXb LdHR4Wce7nR1qqScvJZ0G5nwG2bgDh3CTeQ5MsvUlaNe08ElH0ItPZIJooEfmVNlaoBlr+J8Q E3Vhm3kIOX3KlPbCZr5aUHZGc2R9xfcHcActGYy5RI2Rh0Rzes= Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 26 Nov 2017 15:03:03 +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 Acked-by: Jingoo Han --- drivers/video/fbdev/s3c-fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c index 0914c973cbd9..8c7623d63eb1 100644 --- a/drivers/video/fbdev/s3c-fb.c +++ b/drivers/video/fbdev/s3c-fb.c @@ -1383,7 +1383,7 @@ static int s3c_fb_probe(struct platform_device *pdev) return -EINVAL; } - sfb = devm_kzalloc(dev, sizeof(struct s3c_fb), GFP_KERNEL); + sfb = devm_kzalloc(dev, sizeof(*sfb), GFP_KERNEL); if (!sfb) return -ENOMEM;