From patchwork Sun Sep 17 09:20:28 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: 9954693 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 69F426028A for ; Sun, 17 Sep 2017 09:20:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6915D28BDA for ; Sun, 17 Sep 2017 09:20:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D32528BDB; Sun, 17 Sep 2017 09:20:55 +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 2707A28BD4 for ; Sun, 17 Sep 2017 09:20:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751343AbdIQJUm (ORCPT ); Sun, 17 Sep 2017 05:20:42 -0400 Received: from mout.web.de ([212.227.17.11]:51566 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750793AbdIQJUl (ORCPT ); Sun, 17 Sep 2017 05:20:41 -0400 Received: from [192.168.1.2] ([77.181.201.34]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M1G20-1dZuUv2Pd2-00tFsY; Sun, 17 Sep 2017 11:20:29 +0200 Subject: [PATCH 2/2] [media] airspy: Improve a size determination in airspy_probe() From: SF Markus Elfring To: linux-media@vger.kernel.org, Antti Palosaari , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <27a527c5-8d41-f54d-6d1d-132f0b37acbb@users.sourceforge.net> Date: Sun, 17 Sep 2017 11:20:28 +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: Content-Language: en-GB X-Provags-ID: V03:K0:R2XgD4elSOMDKqCrlHXulDOngsf/pgHpwXKsNYhtIAcGbAuyIAE uiYOcESZb3O+teKxz+07S61cJNKpq3YNYjwSvDaUVI6O57idlC55oAyuGi46sKbpurXrK/d xZXNDpMYDCNd7P2KztbtSY9lBES8Q28HN5gsSjOXX2jCTfRQhqMPQ3J4EzXwy4kReOX6N5/ 0s3Y4WFLk4IXo2DOk2MiA== X-UI-Out-Filterresults: notjunk:1; V01:K0:EPQMow28XA0=:v4BvQcwGyoTaRymBLiwaiH RrvvKajKIika4TudviPq26ZKk/EltdLRJ8QhcyBH8sghRwtiBDNrgn4Uam1TGm3B7TPQKRT3Z D/fuPAgd/MvIgWG7wwawCO6MNZwQOQ01wv8g1YgsUxmG3lH8vKNAuPcpcGq2bueYB9hROaPt/ CViDQ47bGAtPSec9BSKXqr2v/dYNiKQE4MdfeN7QNkYlORY3efj/2yUIWANR/685tGv7/exHM sgCqTJYgg6Lygh8R0N/YK4AyATHJvILRmC6mEUvChjrvTz+kiVhppPMzznOXRYOMYkFUkwkgL 118WL9JEHTrDciW34Bklwkr9Iv5IgApp9mujkbC69iScFpAyhXmZ87S5JD1u73DXGeVT+Vo/C r87VtQweFg88gA2uF0pimQtvfAhagrKRHdwMPi3XXfdFvnZcs1c5l/z64zhdyyJWiwPnSmOsK mV9n41IlDW9WskLOXAUfKkpJGPwzv8vgZi5VfCw12TGHz42fs4zKYhYveFUFzw4MQTMUo20x+ BwaqVtob0NqhYcspxdU0XHG6hi9kFwdjDD1iDcWuZylspcYAJGJm4T8cz57Y2MCWuKsuWoQCl Rii8oYchjMll5E1Lm3bRw2YPJ1V5TAS0hEKrR9RViUOErihSb5YTgNqCATdsNEUHnsRuLWMP7 V1iIOPLXquMET18OMRWxa52Zc/buWEwd58VJMgiQVWskoBmNl3BrQnKWmnzhwRvYVJiB7mAYh TnY+lNyrnhZ03bs0/noYdtgjlOPMDv+wX+sjr18tfUB1vehWDMJaFlo77mjIgyzoUW65vEtd1 qB5e8czbxwvPqk/VvyNaId255Bv+tn3z0tAn0zub4CQwKMsdOc= 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: Sun, 17 Sep 2017 11:03:21 +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/usb/airspy/airspy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/airspy/airspy.c b/drivers/media/usb/airspy/airspy.c index 72b36dbcc0ba..5810c05f6300 100644 --- a/drivers/media/usb/airspy/airspy.c +++ b/drivers/media/usb/airspy/airspy.c @@ -981,5 +981,5 @@ static int airspy_probe(struct usb_interface *intf, int ret; u8 u8tmp, buf[BUF_SIZE]; - s = kzalloc(sizeof(struct airspy), GFP_KERNEL); + s = kzalloc(sizeof(*s), GFP_KERNEL); if (!s)