From patchwork Sat Sep 16 16:19: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: 9954395 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 537BE601C0 for ; Sat, 16 Sep 2017 16:19:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4303C28B1D for ; Sat, 16 Sep 2017 16:19:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 347F828AFD; Sat, 16 Sep 2017 16:19: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=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 D825228AFD for ; Sat, 16 Sep 2017 16:19:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751272AbdIPQTq (ORCPT ); Sat, 16 Sep 2017 12:19:46 -0400 Received: from mout.web.de ([212.227.15.3]:56215 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751223AbdIPQTp (ORCPT ); Sat, 16 Sep 2017 12:19:45 -0400 Received: from [192.168.1.2] ([78.48.47.134]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MYZ8c-1dyBW90RX8-00VO6o; Sat, 16 Sep 2017 18:19:35 +0200 Subject: [PATCH 2/2] [media] fc0012: Improve a size determination in fc0012_attach() From: SF Markus Elfring To: linux-media@vger.kernel.org, Colin Ian King , Hans Verkuil , Mauro Carvalho Chehab , Max Kellermann , Sakari Ailus Cc: LKML , kernel-janitors@vger.kernel.org References: <8f64b84d-cca0-d618-eb62-ec12f42b8c06@users.sourceforge.net> Message-ID: <27e2548c-09cb-2adb-9f65-f06c0e4ba86d@users.sourceforge.net> Date: Sat, 16 Sep 2017 18:19:34 +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: <8f64b84d-cca0-d618-eb62-ec12f42b8c06@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:zjmlXmxuwpAYenH6nhjN7VBeT19TQeQIZDbXvmNCON4qxQspm2V U/5Pc6JsruVig8hPMJyVdAqBkfgfhrtSCbe7RLkkmmIzKyVpNNwUq4IgBkMmSt+Jx+2Ztif puQdERyoagPdM2tLNu6S7WNZpULcMUatiRNY7vJLKAzKbYw/LpvxXrEiyMkMdlC8qyu/Nvu ML+NDy26f04xxnT8TQ8Tg== X-UI-Out-Filterresults: notjunk:1; V01:K0:+CvqKX1n81Q=:3yJTEnvzFKReBXIS+oAXVj GLz1pWtMtQa9d2pBvY1Muc0858OG75n9zVzjTEkK0JCORP0AklUQxhx14gUx4FVvh1Eljit3z QPlo8lqBO2oLgtP2/qRyBwBvTRCcOAVF/JrwgfNkVojcNNqfn+LYPk/4FJXNzBpetRlLg2C+X auVXD5RO6204Drq1C43KIVNFWY0kBVzRhoVMJC0ZbEded6IEK8gQVn3J3OpiB/66mET9AH/w4 J7iy8nqHKvD9BMs/nZZ5d+XH3EiRZO08sgHgvwcG2tYkpnChmgGqYVve1GAGnft9EOZTMX2Zl RuZA07TCrsHXYbaOv3cmTtZmIsXIHxGCTgF3q4yVwciGh87TuBVv9b8uxf28fO6C5wGaJTVdt UgM387S1tA1W2rbYn6XkXvjzpTEXCm5d0jgiabm0AOA2nLhiwIsNEXEVldCxg/2/rfv/VL1B5 2/iU3bjrrUf3/+5ua2oXBq/vM+bt5zvPXDxPHPF02zUx1Uwt/C5S1T0EPtS1sYxFWqOxe5OLE wspxYK5hRKSz/163yuC2NyQQzZTPPPKUkG7yFikH2ZjYt7myXL4PhlptyUfwlkiHNord0ubh0 8ByLQgip+sPOYqo2Pfaz67hyn+UoT55ZcN9EJ39WYnWTnKMjfkgjGd6NrfqnNLqDgO9nd0szC slbivoP4erbiaMUaPj3xO7Ap5j3Tk8gkxT9L/dtYOJ5eS4ahXkXgae2UJ7D/9AgoIJqXKPKek kzDxn5pSH+ROu6Qf1qgobaKvcYSHgYlMlWTpXPpd+3eZ+jzHkBKzjyqBtOwZBzJuPtNEOF3j6 N+wGQfz+6VpWpKHeCi5QoOoUYWTAqvB33qHfgHGsmActIBdbI8= 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: Sat, 16 Sep 2017 17:55:27 +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/tuners/fc0012.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/tuners/fc0012.c b/drivers/media/tuners/fc0012.c index 7126dd1d5151..c008513bd64a 100644 --- a/drivers/media/tuners/fc0012.c +++ b/drivers/media/tuners/fc0012.c @@ -445,5 +445,5 @@ struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe, if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1); - priv = kzalloc(sizeof(struct fc0012_priv), GFP_KERNEL); + priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) {