From patchwork Sun Sep 3 20:32:03 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: 9936565 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 6B82E6038C for ; Sun, 3 Sep 2017 20:32:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F94B285EF for ; Sun, 3 Sep 2017 20:32:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 549D72863D; Sun, 3 Sep 2017 20:32:54 +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 7BACD286B3 for ; Sun, 3 Sep 2017 20:32:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752983AbdICUcZ (ORCPT ); Sun, 3 Sep 2017 16:32:25 -0400 Received: from mout.web.de ([212.227.15.3]:60443 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752329AbdICUcY (ORCPT ); Sun, 3 Sep 2017 16:32:24 -0400 Received: from [192.168.1.2] ([78.48.243.242]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lx7OL-1dQk4D3QVd-016e4D; Sun, 03 Sep 2017 22:32:04 +0200 Subject: [PATCH 2/7] [media] saa7164: Improve a size determination in two functions From: SF Markus Elfring To: linux-media@vger.kernel.org, Hans Verkuil , Mauro Carvalho Chehab , Sakari Ailus Cc: LKML , kernel-janitors@vger.kernel.org References: <170abf7f-3b62-a37c-966a-8b574acae230@users.sourceforge.net> Message-ID: <76397eaa-9c30-af07-e7be-cecee2a9abc6@users.sourceforge.net> Date: Sun, 3 Sep 2017 22:32:03 +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: <170abf7f-3b62-a37c-966a-8b574acae230@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:OXSyTJNFs/nUHYfanlOho0+4uM3iTmr9IrZist+3zkHjhm7UeiN ORB9TfgThGX5eur2R6+qTEgRIwUbu6ZNAewT4R9upYx8WjQ0Qs2IE9ZssDlM3wGkLVNAchN J+kU9icoGE/x3rOT4OjO85fG0vHZ+6GgmEVbsgRB7uogD5y9+3DHM1w34lFyB6Bt6CKFGGk hkNuzD87mxEfc9qho8gEQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:vKLRROcWbP8=:gkzvBry+Kha61TaUCw8ug2 8tWnNk9uP4WXpfJFy+t2CTvSamrkiaFDuzhsFoDOOunUFRHrf4IZT7Tgg5OvGgCP5FA6VzezY dBdULE+ZpuFeFSlVkVSwivR0THsUNRgKLM41sp9uUmrG46HqMeRnrWag0V6UDIOsipd5ZjzsC lXNn5VJS3KEfVE8AX6RrCIJeXKBtxfC+amK4GrpQaYht/cnfUZdFroYpeJYtEwPn/caufzxYm R0YxS2mg//mPAm8t5QNyDlesg64PJkKH0EygNHWKwJl0EXiFEB3cHSFY+f7F+O8SBDgYo555u WX5YTWhFhflYgeFiQHGWNaNvmCtz3F8WeYWtJ3Lg1AO4Y1+qanmRw8KDlT9VJ9w89MWi0nj0P 0WFShBeR61ndMhekV768tNf3QsPeYkEfvW1SxS1ISSjTouzWBoatB+Qw8AWJm+eRXacyC55pI nu7mwMnXpAdGKT0DstmyQJHf4IGdPhWhniefUchMUeUZsA5hNRQ6pLR75KHcjQ4E0SKjqGhKw HOVeuakJ5+3UkoXsO2YySEJjLzrvCL1kfy3S33kCCm82rKBqBMhYu0+7v9Te4Ym0AZbuZQY5g t1awCrAQUclWa2LPxYYDSfYrXlAXHAFHm8NEqP+6T3Ze+Wm67nwU/hRdBLqSxijZNMN1W+b5O roSJFbI0DsPtcLr08deQ6ihNW0sxXppGfSG1hX1jYRNdr/q9PTGMjgm6Ua2aJW7+poL0f0nz8 Qope5GFBJPqyYAsugHo/sPg30wcV/92JDuMaVtzly594BCqWSTy98uxY93OC6wRxiq2PGTQoy TZzCTDjdsCDlmqKhuwsfRaAV7Tnt/AvEg4HWLhg37vyB7TXbvs= 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, 3 Sep 2017 17:53:05 +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/pci/saa7164/saa7164-buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/saa7164/saa7164-buffer.c b/drivers/media/pci/saa7164/saa7164-buffer.c index 6bd665ea190d..c83b2e914dcb 100644 --- a/drivers/media/pci/saa7164/saa7164-buffer.c +++ b/drivers/media/pci/saa7164/saa7164-buffer.c @@ -98,5 +98,5 @@ struct saa7164_buffer *saa7164_buffer_alloc(struct saa7164_port *port, goto ret; } - buf = kzalloc(sizeof(struct saa7164_buffer), GFP_KERNEL); + buf = kzalloc(sizeof(*buf), GFP_KERNEL); if (!buf) @@ -281,5 +281,5 @@ struct saa7164_user_buffer *saa7164_buffer_alloc_user(struct saa7164_dev *dev, { struct saa7164_user_buffer *buf; - buf = kzalloc(sizeof(struct saa7164_user_buffer), GFP_KERNEL); + buf = kzalloc(sizeof(*buf), GFP_KERNEL); if (!buf)