From patchwork Wed Oct 12 14:47:25 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: 9373329 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 2B02C60839 for ; Wed, 12 Oct 2016 14:48:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1900F29E21 for ; Wed, 12 Oct 2016 14:48:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 046A529E1C; Wed, 12 Oct 2016 14:48:02 +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 9D59629E17 for ; Wed, 12 Oct 2016 14:48:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933773AbcJLOrr (ORCPT ); Wed, 12 Oct 2016 10:47:47 -0400 Received: from mout.web.de ([217.72.192.78]:62464 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933224AbcJLOrp (ORCPT ); Wed, 12 Oct 2016 10:47:45 -0400 Received: from [192.168.1.2] ([78.49.9.22]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0MCImL-1blqN81eAT-009Ce6; Wed, 12 Oct 2016 16:47:31 +0200 Subject: [PATCH 10/34] [media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output() To: linux-media@vger.kernel.org, Hans Verkuil , "Lad, Prabhakar" , Manjunath Hadli , Mauro Carvalho Chehab References: Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <47590f2e-1cfa-582d-769e-502802171b66@users.sourceforge.net> Date: Wed, 12 Oct 2016 16:47:25 +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: X-Provags-ID: V03:K0:JRBf3ASWRUWeW7hqkmDTiosTdOvAZghZhcvTN/4rmRm/54JUVSH xpyAY21gR2vAl8hBfw3MghIegc6WP0L3lfJx6i0V1HRbDsO8YEWOB2JNplH07Qk5SrGBhQY 2YUx4EqIHgMAhPVXUv5xxpNCxFvYaLMLqrK+VPcMsjXX5L0rvMAgPm3DqVvFTTCNFVgkT4s J0yLff7QuRxOkcSXItQDQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:SdOzijLdTBY=:iMRf11C/xESStizmJrvnxu wYu28Jtncy/Udngc+PUVJ8dKidgtPqurrXNVRdY2CUi4tabObjJz4PQY4LPYHASgocndQQG3c 31FpJ/4w595q42aWFQh/WN/l5GYHrdSooa7KRw7Ya/iOrNWk6moBnjII6b/AqYUKkusmFPJ5w 9Ttn9xaEqJRXRpwrLtDya+oJ5Q4n4GrrVZ6FRv6hPx/bdvhxYRsr7YBpKlrBPDpLqFB1wipE7 LsXOff8+2ScKK6zNF0rmjXKlUEAzziOAvCr620VmTuXBk0eHSHQbo9/UdqOfP+0aSA2W+hAdE y2r0uc7Kyog3Df8/GG21PruUWyqoCbE3dQbBXqnughxObtW58GRiaxD5VoQ9ignES7ZFgWcWT Xd2V7zXi7vhNp5+Nh5sFVaIVB2JLry57phfJKCHo1EmVrrCemKltJbUTgYUO9i0DhxNES6uXK 4tD4Y5getmAH+COknAejqnktEZVXGZ7MHR9RDMLoMNaxLkTD7QqTW3KBVnxUb6itFRwJLCDgy NGw0uDTypA30fnsmWlqaHSmgKL3Fn4xQ2UGwr9nhn7XpfmOP8MFbP3Hqr4Um1o1C6/ni/5Qa0 fkTYMAQbwRGfbizSRxzCKw/k8wGbcPK6QCb2Uz6PzagfWZUInrs3QToLqcckjsy4c5cZtrVkh dLzHYgJ8cErYVQSGnuKw7nJkJl5mg0g9fFsMsvJwaZE8lFYnJo+3Awgq0bmCx2uyTlAQ/0tFX OOZRWN1L1tvYsZHQAzqc2Mo9zrk69gfXLdnxBIUquMsIp+jVLDj/GUM9RYNun37svvkcc62rt jrGRiLL 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: Wed, 12 Oct 2016 09:56:56 +0200 * 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. Signed-off-by: Markus Elfring --- drivers/media/platform/davinci/vpbe.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/davinci/vpbe.c b/drivers/media/platform/davinci/vpbe.c index 19611a2..6e7b0df 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,8 +256,8 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, int index) goto out; } - 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) goto out; }