From patchwork Mon Sep 18 08:14:37 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: 9955689 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 E933A60385 for ; Mon, 18 Sep 2017 08:15:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA5F028BC4 for ; Mon, 18 Sep 2017 08:15:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF5A428BCD; Mon, 18 Sep 2017 08:15:57 +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 8545628BCC for ; Mon, 18 Sep 2017 08:15:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752388AbdIRIOu (ORCPT ); Mon, 18 Sep 2017 04:14:50 -0400 Received: from mout.web.de ([212.227.17.12]:49409 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751611AbdIRIOt (ORCPT ); Mon, 18 Sep 2017 04:14:49 -0400 Received: from [192.168.1.2] ([78.48.130.71]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0ML8X7-1dtaDU3Nyr-000KYd; Mon, 18 Sep 2017 10:14:37 +0200 Subject: [PATCH 2/2] [media] dvb_usb_core: Improve a size determination in two functions From: SF Markus Elfring To: linux-media@vger.kernel.org, Antti Palosaari , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <38627457-f64f-7356-bf5e-fc41296a26e4@users.sourceforge.net> Message-ID: <204db820-7fd1-579e-442d-ff2b983148f9@users.sourceforge.net> Date: Mon, 18 Sep 2017 10:14:37 +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: <38627457-f64f-7356-bf5e-fc41296a26e4@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:DO3/Ef32K+XNTaPqDWBQ+JNFmZe1AITevjUA9P6QdyNwhIx2Xwk bCxK13g3priAYwgTuCqZ2f3OVX3ghtpIU2kTQVMPQOgYuZNaNaZqMFlXrIu6dbkvrGWFMMq wAoG4xnPmCzRqVKomcsE9DeFXVPxHWzKtj1B+jYlkEvyZvtau6IsIIiD6JsJFSCAv19+S3J U5ihwUodCccEZW53LqXzw== X-UI-Out-Filterresults: notjunk:1; V01:K0:HwR28RTlBBc=:Zk2lGKunplcUeqKKtW/S09 h1EIx2mNRipqBeqQQOZdFcUXpjekBHUwGE6DhnsPVnqx3r+Kwv86ZrEU19igGPyJ558aiomQA SBXL369Eno4m1PskCKU+dkfFJa3OIcz6JibUOE6LDQObsPUfQG3Z5khPM+FKlbA9CcJlcqvYq zgAMue2YkI/UNGSFWZPOw7dqETIhF3XgdgsBJDTtHC8D40sojQQO+6F2QMzWya78o0i+XNpTo sJuN1knJJ92yaL80IxJ9Ng0T1SR7inLtdR0lQlIl4yiIIHRJXpfZ0RiuTsi+QZjOAJDhtW2bF niGjj9o9sbTMPMos9VwTHbBqbmwT0YRV0lDdCqxebUKN3TohTrg5VUDiQxz8PT0bGxbjHx4TV FpO8e/bZm8qkPLY7sNA3MsjieAgAo9wuSGiYwGN3bpYJBfjtW4rRiOSjHwkJkqWa+lsRHyGzj tqGstbIlp1scylOa+GCDKNRw/e0HvmJpbPU/Zks5hvP9iOxtpUtlC+OcWIrFstKTcLsKAdlIY Xzljr+j1kd3Vy7SNAFrysajcIcocgCebrF25u2g6S9JS0CtaIwrxtIdSG6pG23gMgphf3C4U1 C45sejdM75+OnOglFn/Uf8fXrLwoYODL17tuB2twJxygpJi4N/7Jm1RU82GluFwDWhKnLFgWh fyMgBCDm0AF/yi2zDASFqTC8OSr0zlBlzYPwKoncLpnuGdYWLyJp+RcVVgrLn3j/SdoktcO74 EQJ0cCZNxkP7K8og+f+/+yyYDt35+iF+C6li/kBfmQGVZzWiNVkLJo9S3f2iGo/bBNpglNUxu IyGVxS5IqQUXYSgq/Yo2pR9l1kV58ErUVSFsRkpIShkHzrd1nE= 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: Mon, 18 Sep 2017 09:36:33 +0200 Replace the specification of data structures by variable references as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c index d0fbf0b0b1cb..f0b225ee4515 100644 --- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c @@ -279,5 +279,5 @@ static int dvb_usb_start_feed(struct dvb_demux_feed *dvbdmxfeed) if (d->props->get_stream_config) { memcpy(&stream_props, &adap->props->stream, - sizeof(struct usb_data_stream_properties)); + sizeof(stream_props)); ret = d->props->get_stream_config(adap->fe[adap->active_fe], &adap->ts_type, &stream_props); @@ -919,5 +919,5 @@ int dvb_usbv2_probe(struct usb_interface *intf, goto err; } - d = kzalloc(sizeof(struct dvb_usb_device), GFP_KERNEL); + d = kzalloc(sizeof(*d), GFP_KERNEL); if (!d) {