From patchwork Sun Nov 6 20:00:43 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: 9414023 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 802256048F for ; Sun, 6 Nov 2016 20:01:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72C4E28F34 for ; Sun, 6 Nov 2016 20:01:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66C8028F93; Sun, 6 Nov 2016 20:01:23 +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 142F928F34 for ; Sun, 6 Nov 2016 20:01:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752013AbcKFUBF (ORCPT ); Sun, 6 Nov 2016 15:01:05 -0500 Received: from mout.web.de ([217.72.192.78]:57651 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751012AbcKFUBE (ORCPT ); Sun, 6 Nov 2016 15:01:04 -0500 Received: from [192.168.1.2] ([77.181.50.2]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0M40zO-1cteSy0ARG-00rcJq; Sun, 06 Nov 2016 21:00:46 +0100 Subject: [PATCH v2 10/34] [media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output() To: Hans Verkuil , "Lad, Prabhakar" , Manjunath Hadli , Mauro Carvalho Chehab , linux-media@vger.kernel.org References: <47590f2e-1cfa-582d-769e-502802171b66@users.sourceforge.net> <680a0feb-3748-da16-9b79-297e1ab9044d@users.sourceforge.net> Cc: Hans Verkuil , LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: Date: Sun, 6 Nov 2016 21:00:43 +0100 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: X-Provags-ID: V03:K0:SvgWHKq0t8vAUicNUwo6jcQ1/mG6pd0kbVL03PohvSMSvasht/c HaojfTD8HaN+gJ0dQeUPzOgMj01O5K25fWBVbM1PTvR80CkwQVB3ERqb91vQEmo4yg2aGR9 J7mkqWBElcEGD2FnkCAYzA/qmXUNj/VyADhM5jH5PG3qCT3hO2D7GPSWN2Bt3r1iy58/5tr IikvGvYjehix1Gf6LZDDA== X-UI-Out-Filterresults: notjunk:1; V01:K0:QabkYblE2tE=:pXwqgcAb8wnS8gs7mdlR3i Tb/I4tDTB+swOfxS4Xkg2XmejHY7miHaE1QbbHVoxMSxiWsO7bDFKyOGvhyYgLxB9GgOq1Q/v F8uhZP35BezrnM+/2fOAuo0SrlqS6jqF9zQ4sF3CfksxLrIIAp1JYBDDADoDn8drJKuCizSPE oqzDrFcKyopP164yyeKSxjIsSv3CyRWDB77QVI+32cjRcejlygFbKtaoHutZQiHuctwwk+GVT rBzwymon/nxhstsIZNd+Pr27Cz+f3XEve9TpGIPixC8wkdkNGUKIcBzEMpdf1XNqI4zk3pIxj VwGhSi6+QB74kAgRff7k29y4nG0zSAIjKt+WNneoEszkNgPxSsHzY3kAevAt2yqZHKmFAkR5y pjCGD6qROCauVuoTj7bTUMM04wzNFo25LMkubFmJK5cZ/IF6YntXfgwaMwgIzrjqSXxd4QbYD rrPaI1E/CqUlCNlXyHPq7YmJLbGLUV1Cz40zYe+TGZ6Uiz/ZJKFII04RKm28MYqnKhQxpGBF5 p4Q3OHQfL3hfkxsRviYxGKwvEPoYwvbu+4+hRk8xFf0hDgHG7XWLC9HiVVxJfOXHh+Xa82/fk Hosd3fXpyUsUmYzqBejx7JpbxyM2nFW+XrzvCfxe/rX3Iqxx7myOYBTVnH3mLQr/q0NyF3XzR d+602oSN/U5xG3qEa7uL2D1+re3ORPNYBR6hnSJ06T6IrsV2CBk3I6F3GENtkwSReXhr6ieuu Np8b2ku+D8UqNJsloChVTDiRHthBfP53UZYOfmABsfAaUbd23VBiNTG24dO4K55O9NbDrFNKC 5yBpOr5 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, 6 Nov 2016 20:40:20 +0100 * A function was called over the pointer "setup_if_config" in the data structure "venc_platform_data". But the return value was not used so far. Thus assign it to the local variable "ret" which will be checked with the next statement. Fixes: 9a7f95ad1c946efdd7a7a72df27db738260a0fd8 ("[media] davinci vpbe: add dm365 VPBE display driver changes") * Pass a value to this function call without storing it in an intermediate variable before. * Delete the local variable "if_params" which became unnecessary with this refactoring. Acked-by: Lad, Prabhakar Reviewed-by: Hans Verkuil Signed-off-by: Markus Elfring --- v2: Keep the assignment statement on one line despite of its length of 82 characters. drivers/media/platform/davinci/vpbe.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/media/platform/davinci/vpbe.c b/drivers/media/platform/davinci/vpbe.c index 19611a2..d04d6b7 100644 --- a/drivers/media/platform/davinci/vpbe.c +++ b/drivers/media/platform/davinci/vpbe.c @@ -227,7 +227,6 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, int index) vpbe_current_encoder_info(vpbe_dev); struct vpbe_config *cfg = vpbe_dev->cfg; struct venc_platform_data *venc_device = vpbe_dev->venc_device; - u32 if_params; int enc_out_index; int sd_index; int ret = 0; @@ -257,5 +257,4 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, int index) } - if_params = cfg->outputs[index].if_params; - venc_device->setup_if_config(if_params); + ret = venc_device->setup_if_config(cfg->outputs[index].if_params); if (ret)