Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752164AbeAPUlE (ORCPT + 1 other); Tue, 16 Jan 2018 15:41:04 -0500 Received: from mout.web.de ([212.227.17.12]:63201 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751071AbeAPUlC (ORCPT ); Tue, 16 Jan 2018 15:41:02 -0500 Subject: [PATCH 2/2] macintosh/rack-meter: Improve a size determination in rackmeter_probe() From: SF Markus Elfring To: linuxppc-dev@lists.ozlabs.org, Benjamin Herrenschmidt Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <862e3609-1010-95d8-0d64-0493f5759f78@users.sourceforge.net> Date: Tue, 16 Jan 2018 21:40:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:sZZEW/D1awxVThn1rBNlC5l45mhkrDcyT/kqqbslsRPsLss+wbz Mk1s3NdzzFzTMdc1tWXWj7u2GruD7mzEgr16obU5h9dgwo3ylM3Afvn4N7HWLWTZlyyjNy8 eyPWkWS8/L4XfDDGVQXOQ/RB/dfc3SMlIKlUvanFF0g1prgRL3wdfQ+Hlxp1DUROLFL8OOD 7tdEhVW4WLx4cOGxHCazw== X-UI-Out-Filterresults: notjunk:1;V01:K0:yPtU8BUIA7U=:njoo/M2C8R0TAX0HGfSp9H l8BiUfAExFK9bZ3KFB0TV1RoQq+A11fPZD1npPYjj/MaQzvW3jxWbUvFOODC5Fou2MqlNhMWI yXiUvnPJ8Ygmc1BK6INhUWidSVt9FPpV57fRD7BBKVgkykfmMfryS9xfuh82MIWNExoJErhsm 2rCeJk7yR3EHEsCk0501QGM1cbMOmKIlUOJbV1IlxVxchICWs11x0bpvUCaV8cwPQtfa6fR3A dpSsw8NdB9+zknJHCz0ZDdga5WEPHWwu426bThcWv9dnEUPBhX5K+DH/yQFOZV0lBNrID3TJq KlQgDMevKsOMtT1jbk7hUp2g22Rlo2zIHDJ51oVGr0TRTwg8ElLREtZpbTRZPZ77T/u1U9qvO 8nP+Ikzj96cYtQsk3xkodpvonjwoY/kK0IxYIwqVbSE08ngrnVlpFDxgPSU+o4DVa33pETb2j SwVCr9lAYr9RjVrXODGblUvJhczNTmD594f3Y4X4k4Lh1EhVNyqu364PHQkAlJbSJM/l9s85i Id6JmzQj+ZCPHCX0HRjw/ReJRBhTWxMA1SW2L5tPhJhIsYaq6XfQVK/1lPV/FMikHnneRjnh/ qUCmEPXHDOclF92ZKe0SohtFD2K7MvUhTBrRkvUkxflOaPJ1NrUHwOhxcJbi3DMemfrRSejel 7wMiO470/4XaGoOnbdym6LlNPGwZr+m5VozJIR5Qky8r4rUPnNbw0MdjidStYcATzb3pvQ/f0 lgvWI6d/BYPHbfYCp8Ds17WsoqV50EF0V0RV20oGo5vLydaltZmFUKSHTc7kFhK51Jlm7gr3A Rhobsr1szueASRAB0CtFqtg80mriyEvOfYF6DqW1xu81qeKN4U= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Tue, 16 Jan 2018 21:26:52 +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/macintosh/rack-meter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c index 0796b74174d4..800fc6822ad8 100644 --- a/drivers/macintosh/rack-meter.c +++ b/drivers/macintosh/rack-meter.c @@ -397,7 +397,7 @@ static int rackmeter_probe(struct macio_dev* mdev, } /* Create and initialize our instance data */ - rm = kzalloc(sizeof(struct rackmeter), GFP_KERNEL); + rm = kzalloc(sizeof(*rm), GFP_KERNEL); if (rm == NULL) { rc = -ENOMEM; goto bail_release; -- 2.15.1