From patchwork Fri Sep 8 19:44:06 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: 9944949 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 F3D51604D5 for ; Fri, 8 Sep 2017 19:45:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA9F3288B8 for ; Fri, 8 Sep 2017 19:45:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF80E288B0; Fri, 8 Sep 2017 19:45:11 +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 A5D37288B8 for ; Fri, 8 Sep 2017 19:45:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757007AbdIHToU (ORCPT ); Fri, 8 Sep 2017 15:44:20 -0400 Received: from mout.web.de ([212.227.17.11]:55027 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756958AbdIHToR (ORCPT ); Fri, 8 Sep 2017 15:44:17 -0400 Received: from [192.168.1.2] ([92.228.166.205]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MZDP6-1eBFSv2ciS-00L1og; Fri, 08 Sep 2017 21:44:09 +0200 Subject: [PATCH 2/3] [media] fsl-viu: Improve two size determinations in viu_of_probe() From: SF Markus Elfring To: linux-media@vger.kernel.org, Arvind Yadav , Bhumika Goyal , Geliang Tang , Hans Verkuil , Mauro Carvalho Chehab , Prabhakar Lad Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <44462eba-a9dd-2af7-b187-9607fe8dc1ee@users.sourceforge.net> Date: Fri, 8 Sep 2017 21:44:06 +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:8idM/nYFpy23Hg6+y6bS3xsrtH4y/vup+xUS2tgoHIYIaWkuS8X nFO5QBhhrkedCeTzWx8AsxhyYEnpInjB+CRUTTtNzil/eRYjzHfnA8LhUXAn9jQSbk1ZRP2 WsYtz9liXwQ4xf+SejgIDvwY1V0PlqZ9cjbgkFWEyfCP1CVCKK1iNYNxl0T4LMYutmE+R0I hKBwFu6a0BEm89DgsAoNA== X-UI-Out-Filterresults: notjunk:1; V01:K0:4g/qArMmC0E=:8L6eAdZGIu+a9SD+H5HyqD 44maOktUWSGGBlvPIgfFt4K7dO3IxHcjEca/lMQBDGmE1Etv3g3JcVggjOuo/rmTGQ0r/cAa2 54pqMlqgpEQWpeDD948WQoJO8OotwRa293RdqBXtFo8K5GK38fk0PbKO94CSe8DUOaWtWFqYa G7ne8/NjLP5IJxO1L2pBWwDrRyR18u+OhFXxoAOVSXMrRiNKzqY9d3jydIPh7wvN45J77+38s Wdsh3j3BIGzFiezYp0uJpnNvpizEtCiSMY4XQhcWtzMtPACGcQHueSKQA4DUNNQ6/hY6o38iT JNS7iAguHCu9kIIcQjB7hYtog+wpWYw/h5LrKwzyBjyZ/Vs4S1gqDQ57RVnX81h927JYBupf2 xNAYxX/ZidAs7sklxAAsWIs8eei5r1G2E7I0QibwXPXo1MSpRWzKnnhlJLPzbKR7kiXreCkOH Sh3AJfEmuQ6T18c32RycZLJwCHy/oYeXIBBGL2pG7g9jADYQU3/QKpH4iBSPboueheo1ZRMU/ aRY5Gyhl6NEW/4lx7XPP/P3xV1Lmf0uc5f2iZP1JERCfkHjyWYWGJDARBfhBXeYbUKycmMri8 G1sUw6RcXyI5efjDFY4Yp5SqZHGwrGd0StDEc3ahcYZQAFjQAXJpGWAc6nov9zmKmNhJFEUCl aQdmw9s1n5BvMZSlMq0Oi4Xctifk/FBACtLHZ/P3RhLczYJVmhnVCWxUG31s7wzvehGyefzn/ iM56im9WSqrw39YwcGo2PV1gtEWahoiRsQ/jR0sG6WFqfzEOjs+9QORiQQxW6lHtFcKI4KhF+ kA/6zAyAaZ0fFcSkAAUn4YtfUWwCvyJu+06/Vwe7nWzNJl2lAI= 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: Fri, 8 Sep 2017 21:12:52 +0200 Replace the specification of data structures by pointer dereferences 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/platform/fsl-viu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c index 526f80649864..1fe2a295db93 100644 --- a/drivers/media/platform/fsl-viu.c +++ b/drivers/media/platform/fsl-viu.c @@ -1421,5 +1421,5 @@ static int viu_of_probe(struct platform_device *op) } /* remap registers */ - viu_regs = devm_ioremap(&op->dev, r.start, sizeof(struct viu_reg)); + viu_regs = devm_ioremap(&op->dev, r.start, sizeof(*viu_regs)); if (!viu_regs) { @@ -1429,5 +1429,5 @@ static int viu_of_probe(struct platform_device *op) } /* Prepare our private structure */ - viu_dev = devm_kzalloc(&op->dev, sizeof(struct viu_dev), GFP_ATOMIC); + viu_dev = devm_kzalloc(&op->dev, sizeof(*viu_dev), GFP_ATOMIC); if (!viu_dev) {