From patchwork Fri Sep 1 19:43:42 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: 9935215 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 397F06038C for ; Fri, 1 Sep 2017 19:44:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 292621FFF9 for ; Fri, 1 Sep 2017 19:44:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D0BB20243; Fri, 1 Sep 2017 19:44:22 +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 BD5BE1FFF9 for ; Fri, 1 Sep 2017 19:44:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752302AbdIAToG (ORCPT ); Fri, 1 Sep 2017 15:44:06 -0400 Received: from mout.web.de ([212.227.15.3]:53266 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752245AbdIAToF (ORCPT ); Fri, 1 Sep 2017 15:44:05 -0400 Received: from [192.168.1.2] ([77.182.57.191]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LaTpn-1d4sBa3QUR-00mMR5; Fri, 01 Sep 2017 21:43:54 +0200 Subject: [PATCH 2/4] [media] sp2: Improve a size determination in sp2_probe() From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Olli Salonen Cc: LKML , kernel-janitors@vger.kernel.org References: <6142ca34-fcda-f2b6-bc35-dbbde0d34378@users.sourceforge.net> Message-ID: Date: Fri, 1 Sep 2017 21:43:42 +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: <6142ca34-fcda-f2b6-bc35-dbbde0d34378@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:uwJvuOEyUso0qXMAdptTtuEkTBOJLgkYjlUkgJCVpMKiqZ4RjWT OCQ86N28QcBfzH2OHQuwkHHmNrQkTtwbBeexWsJKT2TXkKKDuvzO2eO0hkQxa5gJlXdAPzm xCq0+lnceA7fir1tfYWonscASi5L5PBsKIZ5G4zHJEU1JHto6IkkOuelrCR6XrLiYafMPzr Ini7SX8ztqJIRXyu5PdDg== X-UI-Out-Filterresults: notjunk:1; V01:K0:WHKN7hb+Tjg=:SvuafRRHI8O5Pv+aYnyNYH sb3r1Yk6RlPC541qyRdcpmRf1nMFqardaqzDjtRpqOJ/3fKqxd9vsCjSVz4LPEzfLMw10G8d8 V89MdvwAVFshSBgXTmwXnmeJ1LT797y8uZteVCsUAQ+ymiG2WQ7PmD7wGZPQB1bJ5VZwck9gf x6WwQNchOp7QQx0Dlr7SqAmDWSmlintjL9NoNheZaqFRLRP3bcAHNMwWtQo3u1lMkkmZMfjCl OG5CdhvE4MpkGGz0FhX3Jdj0JEY8xjc/xjnNnISFDuI+PcS9S8lsPSTjKtYAyseAhT2K3//dN G+aS2r+d3NPVDk9qq0xJcqzzsx3q+KI2q3+K15eyUQsgSTtkNZaLu7yCyGqvPvI6KNBb3nbPf tBDXWiAjODB471n7ugozhdivC6U0ZqoLeMrdmVl6f4P+B+3JUwgABsqbGCctJldqmaDPucFr/ xYg4FbKxY2yyvOOllR03bRW27tTE79sZCjQ/1TLU+VVGDwz0kOsi3852dgu1d7fjd6WNQrNbw k/8OmAgONL83UCGyjH/nGeRnGME8fz7U3rcv8z5ioy+Jcyt9/67qBslQcE/xNWbI4uKeZGABR JO30F2SnivJxOj0m1wBc3sjpJoccJvGYjWAR4fii9jQ5Y5w1Ogwoohq+PWoK+ndcVPd0VJzGt hHaTWqSk3dUDrBGNpJ0HqNoe6TMbFcVZgGukIEb5s3nfKH8p7hqBKoEkZQw7EUISwy9AY4U6I fBj2A1p8Me3IrSWtqaSQmCvsNt278e+1/DGPe52ulKrOCAtvV/EWrbqJgR1/uS9DYKhjHmcAB o8Gws7CYeyzP1/HEfbCp3jKZn+cJj++/tsQ3u7gDp/Vw7+j4mo= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Fri, 1 Sep 2017 20:46:18 +0200 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/media/dvb-frontends/sp2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/sp2.c b/drivers/media/dvb-frontends/sp2.c index d3b4f8822096..dd556012ceb6 100644 --- a/drivers/media/dvb-frontends/sp2.c +++ b/drivers/media/dvb-frontends/sp2.c @@ -381,6 +381,6 @@ static int sp2_probe(struct i2c_client *client, dev_dbg(&client->dev, "\n"); - s = kzalloc(sizeof(struct sp2), GFP_KERNEL); + s = kzalloc(sizeof(*s), GFP_KERNEL); if (!s) { ret = -ENOMEM;