From patchwork Wed Dec 6 21:12:39 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: 845358 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ysWkp6PJ7z9s74 for ; Thu, 7 Dec 2017 08:21:22 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3ysWkp5JSCzF0Gr for ; Thu, 7 Dec 2017 08:21:22 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=users.sourceforge.net (client-ip=212.227.15.4; helo=mout.web.de; envelope-from=elfring@users.sourceforge.net; receiver=) Received: from mout.web.de (mout.web.de [212.227.15.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3ysWgh6GKdzF06C for ; Thu, 7 Dec 2017 08:18:40 +1100 (AEDT) Received: from [192.168.1.3] ([77.182.86.166]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LnSOM-1ezqm73eCk-00hbPi; Wed, 06 Dec 2017 22:13:22 +0100 Subject: [PATCH 2/3] tty/serial/ucc_uart: Improve a size determination in ucc_uart_probe() From: SF Markus Elfring To: linuxppc-dev@lists.ozlabs.org, linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Timur Tabi References: <5c6d363d-398b-4695-78c3-33b9e8dbffa3@users.sourceforge.net> Message-ID: <38dd53cc-f7e8-57b9-bd0f-0946c787ac2e@users.sourceforge.net> Date: Wed, 6 Dec 2017 22:12:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <5c6d363d-398b-4695-78c3-33b9e8dbffa3@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:NCNzkvvHHx8nJskUWjGDBxV79mC1P1iIcKBRFlxye25z4GLQPMn cBsmCRKSIXvTRo7YT6KhzIcemL8j/x1uprkRuyaDPkxDOiReXJZtoW9F4xLd1/uXfnZ8uJ5 bknOF6rYEXlUpSM5aMkgOrncKg2coYdxY9ht+G+pMdQkDUr9JovmtqMQNRBl6p78ADWCuix 5979hBWfoF114Yd/mqB1g== X-UI-Out-Filterresults: notjunk:1; V01:K0:pphOAcwKPYA=:WewVIfi1KdvhZDwO+K+oO/ vRlSwoW43Mu56XATbOSfi4mfAno52YErP8BvM7Dkl7N9n12ZwkNiJPb4O7WVUk/OINhScB9x4 /DaCX5265znuaKU06zd9IXvE2ECR/r2gF4onBrQmNKmeul3SsgyG1SNEeiMoln84ukGwjlpRL bhI4RMsgJFvPLz1utG3I4yWINW4uXBU8qnTD9C2OzwOZWsxfLnElK/ZJ8GaEf/3Cx93KhRslT x0jCUMEXS5okR9Du1jqGcx3FZkyastkzzhe2zIO5FNAEhjFZiJpJH3pMrfSFirY3AT7xJRlOR VWXgBMlkUM/KQ9HIAMxRlNomGYbi6qt+51nIMtmuD1CwR8HCFomNtDCAsIG2WoH+OYCzunSwg adUws3JeIcGArHewnX4ctBnbvedYsHkfHxyjFGw8jxl8U414Y5BasvwCxBT30Rtz06jHOHW95 oqC0cfzeVo6Dt1csOWVvg5fz4+0dCpAY1B96mIr3yJSeEcd/uFcb48aJVHNbA5laRvDRnpO/g mK2AT4mWeZEwUqq/+PttlHpUnl2jSc+plQAe8rtc8Jj0vb/cEmv/e+U/peNnu0fvtRtEA2IQv v3tJQU00Q+T/Ad4osP/RvXPZRjGzEIfTftwW2S2kKYXnFt2KYOliaW/ENoV92RqLDmt1iAHk5 t/qtYBupwMqA6FjDISlBK5mRtgeR9no/eeDrcBr1BW8ihBVKaid1MUv3SieJG3tGUELRG/iEv iiDC0NJAbq1WFQXi756p/8YOBscRKtI+/Cn4SZVaelUznFgxDIy7qEgxjvFfn3r3+rVdgZ7Ea /ielcPrEUbpbrTtN66vJnUKHWSXzkVt+eQt8UZsGEIpWCReFUobFyk8VkjQI+9rQ/zJ2Hdi X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, LKML Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Markus Elfring Date: Wed, 6 Dec 2017 21:45:32 +0100 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/tty/serial/ucc_uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c index 48364f0eba72..a9ce652899aa 100644 --- a/drivers/tty/serial/ucc_uart.c +++ b/drivers/tty/serial/ucc_uart.c @@ -1253,7 +1253,7 @@ static int ucc_uart_probe(struct platform_device *ofdev) } } - qe_port = kzalloc(sizeof(struct uart_qe_port), GFP_KERNEL); + qe_port = kzalloc(sizeof(*qe_port), GFP_KERNEL); if (!qe_port) return -ENOMEM;