From patchwork Mon Nov 27 21:25:38 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: 10078133 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 A5C4A602BC for ; Mon, 27 Nov 2017 21:26:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9569728F8C for ; Mon, 27 Nov 2017 21:26:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 88DBD28FF8; Mon, 27 Nov 2017 21:26:10 +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 3A4E328F8C for ; Mon, 27 Nov 2017 21:26:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751741AbdK0VZz (ORCPT ); Mon, 27 Nov 2017 16:25:55 -0500 Received: from mout.web.de ([212.227.15.3]:52240 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751608AbdK0VZy (ORCPT ); Mon, 27 Nov 2017 16:25:54 -0500 Received: from [192.168.1.3] ([77.182.143.129]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Ls9F9-1fGWz433jL-013xhe; Mon, 27 Nov 2017 22:25:42 +0100 Subject: [PATCH 2/5] radeon_backlight: Improve a size determination in radeonfb_bl_init() From: SF Markus Elfring To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz , Benjamin Herrenschmidt Cc: LKML , kernel-janitors@vger.kernel.org References: <93c99f89-2d97-0e95-fe57-7b7a0824e864@users.sourceforge.net> Message-ID: Date: Mon, 27 Nov 2017 22:25:38 +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: <93c99f89-2d97-0e95-fe57-7b7a0824e864@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:CvDwiPNbED9+t59L9aCi75ALE7TF6UdL0IWBfrzoI3goFdqrPt4 YmIvEC90+Ea694CON7GdzihTmtC4XNHb/YEXWPauzd2q/EUUSEffqm7un+zJONbXT6O4UNJ Be/UA6fQXJxpES+zW7FZ9cgttdWIuNF9nfYIRDNBdhYePd4TUl0yydmKd/vmBfcg28+E3tp BTUW7i/PmkM+LzFFvjAQg== X-UI-Out-Filterresults: notjunk:1; V01:K0:/tggKFcl+1g=:b56oub8oAoR0h38OEHpN8c edxY8d9J0twokct8IU3eMzAADi+N1N5B8FFSfQUjbzetTVM37d98vz8agEO9USxCkL2Jg1CgK R+Zw8K1bJAlI0nP5JeqmvF65i4GhzEDrqU0AyQPayX8Ck+HeBNWPdfhZ5ah9T1lXNdOnjZCwJ /eCkFtsS0Lk1fhine4FD+14/vafcfAphqmbJUp3ro0YJ936DYgpD33x/o3TgOwbWt/qt2Ltq6 2ZY+JMrYE1PoAwnZ37Jr4RAQnK/9F++Kuic5UKFCCaETwr5qYq77L4GsWLCZHKFWblzWl54b5 ksThRYWYM6uSdlJiNZeqILqz470fJ9LKjhpwNSUNIeKp3ml/AEMx7SMRblALTGPIi5Bvbw5FB PZS3XENY/82vJIAV4WtmMDitEI4YlTktVN2YA7oU03MiMtlSikPnmCQiJYgfxQ56a8PwY69B3 ISGb7w6MlAUEMRUwuXmPeXPArsInRVMm7jjZbFl4SHhgMX33Ata24m4SDB61maa/MzjU/a44k DKr3eb4sG7qbPc6gOce4VvM5DzYM+/nRlO2qiyIS1AuAGsE3BqSiJZ9QKenPaPmD4sOrH0cO6 Rm8JJIP+7QSNu4hkq3kv1I0t54R6Hv0WdNNk1f4PZqHM4c8pgJconkycJc24ZDKDvulszZcdE 92HrasRk7pKNJGNH16MT8jrqTlipLbh9yK+ffgTKMyzBS/N2Ee2KhboPDQb6dNCytz0gYxSK+ ACuA8f0O1LXyVovHHPOS2mVJbiL0ElZRx3uhW2gXIrJ+JyAaBjTjgAKsIMbGFYrYK/iJaGcxI ABeX6hV5I17xCJGv1AdbVIxm8AZo5ACtMWpPNQc+frNwwMQraY= 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: Mon, 27 Nov 2017 21:30:06 +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/video/fbdev/aty/radeon_backlight.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/aty/radeon_backlight.c b/drivers/video/fbdev/aty/radeon_backlight.c index ce5b22d710b3..78c36c8d5e57 100644 --- a/drivers/video/fbdev/aty/radeon_backlight.c +++ b/drivers/video/fbdev/aty/radeon_backlight.c @@ -143,7 +143,7 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo) return; #endif - pdata = kmalloc(sizeof(struct radeon_bl_privdata), GFP_KERNEL); + pdata = kmalloc(sizeof(*pdata), GFP_KERNEL); if (!pdata) goto error;