From patchwork Thu Oct 13 16:28:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9375399 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 C9ED660865 for ; Thu, 13 Oct 2016 16:32:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA3F72A16A for ; Thu, 13 Oct 2016 16:32:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AEE5E2A16C; Thu, 13 Oct 2016 16:32:46 +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=ham 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 4D72C2A16B for ; Thu, 13 Oct 2016 16:32:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756709AbcJMQcm (ORCPT ); Thu, 13 Oct 2016 12:32:42 -0400 Received: from mout.web.de ([212.227.15.14]:52352 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756893AbcJMQbF (ORCPT ); Thu, 13 Oct 2016 12:31:05 -0400 Received: from [192.168.1.2] ([77.182.72.22]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0M7scS-1azRPl0fk8-00vSSW; Thu, 13 Oct 2016 18:28:33 +0200 Subject: [PATCH 07/18] [media] RedRat3: Improve another size determination in redrat3_reset() To: linux-media@vger.kernel.org, Hans Verkuil , Mauro Carvalho Chehab , Sean Young , Wolfram Sang References: <566ABCD9.1060404@users.sourceforge.net> <81cef537-4ad0-3a74-8bde-94707dcd03f4@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <35a71a36-7542-68a9-c33c-55df256efc57@users.sourceforge.net> Date: Thu, 13 Oct 2016 18:28:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <81cef537-4ad0-3a74-8bde-94707dcd03f4@users.sourceforge.net> X-Provags-ID: V03:K0:Pa5CDPrN3nLs7S8GSxO76juAqOxLmTtrC8eFJnMCCOIys0fNh61 EH+BtpDpVxfvsj8Cj1Z19vfIEqDdAUgr0GFWtPasx760BUEKiaKpKUfEr42TIN/z8++1+Nc Exu9e+U2bOdp9uSWJWrkCnN74MzbS+y4Ss7Qj2ea18bLaeDaUrcy+oLAz736yQMlacoLsKR kjYjTODprGPwHcrq708Ng== X-UI-Out-Filterresults: notjunk:1; V01:K0:vSxrDUc9kkk=:n2Dyg24XfkGyAnX/7fqFri jBtZF4++1pCbAa7oiGJ+W3paPoztoPYA6A/ESuv+KZPii4qJIx2DdFn8XVTsE4dCmegTRIIEb FSdHlSaG3Az9qxCbh5SGCz4Fqjp6HfGRBU0cOQzUd8ETxhKYF+eTHohBKZJMxPh+BKOVkZ7ip 9acD+G6T3Wq8dzRKZatjDiR2xjHIwRWnhePUhg1jzXluSn6Tw9L6LNEdestKtXymfQ9k1JUuN MrfRFHQ5qZckkeKwVIq8xvIQ6VWkmfzg2nHi60pN7As/Z3fkqVbi80zVTc5Q1JWCdoOTQ/Vwb nWUtguADjg3OQ6bEDCvTLbeZrPWhDcHnRqDCWBJNYo7ejDIVjz1JPYdb2C/kyXwz6Xanh2wD6 40Mas+YqhLhlNWSzqzljzCM4QsOmc3tivmFxuiSy/HckDky70LETFetiO8ofEivQFH12kirOA X8J2OYq7I4RwJ/7zP8HQ0usHjT7Id/mo3u7wcMp+Y8LGiQ7kBdEaVKbs6yzi1Oxx7jy5goyAd trZorHok8VdWDh80eXIA3K513v3w84w28DMKfOLqbtIt4llLaH549+f5EjLLG0IHTA+0I91eB jf4i9zpBJXHSVE5L8SU+G2XzW1K7kOmRCkpwBHTZ+ranvy2Qcj4SREjoNBNvg+MldRv3xHSrb UzMGXv2xCyETR4de7T4dwdq3myYpevzoDDIqUEiUc/oG+eHzMiL/MM7k0vincthmkWNWzwgpT 4t0/GvKES72z/UkK9y4YmoY4gQzknBME5YluqwZ7ZCh6BBmRgt/TpYA7H7MuikjKkaemQLKbD t80myGj 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: Thu, 13 Oct 2016 13:23:22 +0200 Replace the specification of a data type by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer. Signed-off-by: Markus Elfring --- drivers/media/rc/redrat3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c index 0ac96a4..5832e6f 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c @@ -510,7 +510,7 @@ static void redrat3_reset(struct redrat3_dev *rr3) struct device *dev = rr3->dev; int rc, rxpipe, txpipe; u8 *val; - int len = sizeof(u8); + size_t const len = sizeof(*val); rxpipe = usb_rcvctrlpipe(udev, 0); txpipe = usb_sndctrlpipe(udev, 0);