From patchwork Sat Sep 2 18:42:04 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: 9935687 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 8C569603B5 for ; Sat, 2 Sep 2017 18:43:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82351285D8 for ; Sat, 2 Sep 2017 18:43:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76DCB28689; Sat, 2 Sep 2017 18:43:24 +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 32D1C28680 for ; Sat, 2 Sep 2017 18:43:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752766AbdIBSmT (ORCPT ); Sat, 2 Sep 2017 14:42:19 -0400 Received: from mout.web.de ([212.227.17.11]:49987 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751596AbdIBSmS (ORCPT ); Sat, 2 Sep 2017 14:42:18 -0400 Received: from [192.168.1.2] ([78.48.84.48]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MDP6H-1divtQ0153-00GmS1; Sat, 02 Sep 2017 20:42:05 +0200 Subject: [PATCH 2/3] [media] cx18: Improve a size determination in cx18_probe() From: SF Markus Elfring To: linux-media@vger.kernel.org, Andy Walls , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <016d4c9c-1d8e-e277-5d7c-f433553cf0fa@users.sourceforge.net> Message-ID: Date: Sat, 2 Sep 2017 20:42:04 +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: <016d4c9c-1d8e-e277-5d7c-f433553cf0fa@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:ZbCUVZrgaqwRxRzFhQ97Gi48TcgW+35Bz9541zWURMVIKXGgysn YoOKhFW3A5H/dQLJH6DuuZnkQAGz1Da5/KQflVfy5WGDV8Y7pnPF3fzo6TpSnV3Q61e3j6O OfVJTlS7ZMkMNJUlpkO+ptpHnA8rhG/lXiOmyQNbAeDvSG5CqsacXV7+OLlJqwv85tLNlGh RXzS7ItjIXkET73ui1OIA== X-UI-Out-Filterresults: notjunk:1; V01:K0:Bl2OK7xb5nQ=:mEjgxlyzI3xnVZ+WfqOvsD 7WeXYjraBJH4Y1yMciXzLjhkAOIwxyRt2IN2syLQ/7XTyKUC17bhnnZtFa3vNfoYvzU2qqbkl M2PlR6ck98p9C6NHaMdgdl46J3n5yYwh51Bncd9j74vxCgm954q+WAzuFMfzDTCUvnyIdCfZ4 4B6HdaS0mTBsyimdfkanl0EZXZXVXxWhRgywtkIvVQyPqzyfzkNsU/vJ9aByfQCQ/To+D88GH 4zdaPCNky0WSTgkpUC6Jxr3sZFSl1wrxueTIVY5UCoHQpzufGI3OKRQnEvrgPRAzik6iREApP JEBgBubha9JzViPbzHPwrJMKDYxYfAuwve/MZbzRLarfiJnLvk3uJtZHHrBwKWLVMdstL4Yai wQ2Uqk9sCuNeUCJ9/zmBv0MZL5ECRkaN7pR2AkXu8wL7GA8HdNvzBrVRcb58AQXlSEe52yT/j BCU2LwOnyhC5YDPILfkMfyG2qm47NE3k3mp3/ApN8XoS9P5byHnkuotj1KaPNDQA9TL/ffkKZ xAiKtH5hJKy636MULvwyH0CV5UvHO1aOp0pBPkovJFrRv9WEaX8EYo+PUtd2uBm4w3qpmtIJl 4voUP854Wh48cy7xKqtU2bzCdwH1sPoFfd4OKKgfREBImPyN8pKrqzDRXgTJsoorbjwb7W422 ynw2vgBMsYp6PbytVj0CC30AZ0KcTPN2Ch9lb1D84It6Qc1BeE7+98ERQkIVMCTKu1ypTBrOG +KuZDn37xMqAvI9/QW2gtuHPTXT+UTNjOM/I5Q9tI9liiKH9DudJDoOGevrhVDTgipDKZYOb5 JmG0o/ZTSRgpfXRjFAXYp4LdDpk8aTfnKwRfNAP+INu0IwtjAE= 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, 2 Sep 2017 19:42:12 +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/pci/cx18/cx18-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c index b267590e0877..49fc9b72ada5 100644 --- a/drivers/media/pci/cx18/cx18-driver.c +++ b/drivers/media/pci/cx18/cx18-driver.c @@ -909,5 +909,5 @@ static int cx18_probe(struct pci_dev *pci_dev, return -ENOMEM; } - cx = kzalloc(sizeof(struct cx18), GFP_ATOMIC); + cx = kzalloc(sizeof(*cx), GFP_ATOMIC); if (!cx)