Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp761527yba; Sat, 20 Apr 2019 12:55:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8Uvm7SotItKH7AKtvJtTkjf1wenO9OQ5jEcM/1Lrju7dWCSIzK8wdLCaMtbcIsm2XVp+T X-Received: by 2002:a17:902:7085:: with SMTP id z5mr1164722plk.78.1555790115284; Sat, 20 Apr 2019 12:55:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555790115; cv=none; d=google.com; s=arc-20160816; b=TvGSbY2j5m6CQ/x/2WcS7KgW9uA0763UB5pwSbvawUmJINjr85/ctM3/aCaF7exrMO bS4343Ak05AyihiTJ1XIlNslsL06SzcE35zR4bhURWxyvSFxZUfVj9UckCQ6oZp9wme4 F7/EMCl690cYfFMSLPJC0Rdkehw+qJ1ci/dCYXuxBcAGnGN/wbLmpFTuBnlVFM/NdCyK 98RYC3FxQwzEb6dbl1bqM5hElw8vK4ymacyq1UWVHzvqv+aX+JKc6lTooSe9fQBqmSlb fptNGQc2jV85umW+hsxCuwtidTq4fn3ba1POppFTbDVu+LJS9V6ztFjGXUHlEOTFE8/6 VR/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Yw6GzaskFpA43QPqloHNLUStO1ykMZF2MNyrCBC8+wM=; b=Rtkbtv+XIsCQ4wRtRrUV5G4jhk7JMaH3X8ukTiEUQ1+mNRxxGhpadIvNfw7qQgg5nN B4I0gmIkQ9ILFNkSWd2+hF4IbBGtB+WfU1IH2lHFWTkWNwj5PXq5HyXiCKWghs8hTeOT SrROiDetGpPL8VRGTq2kFM9tNQaqplUZB4gUbvcvekaX6fBiB6BBzg3LWwtqverx5axh gNZjK3bahOyQlTPnjhqSTgI+eDS4Ebk6/12pS6oICBcAJnFETfUfT8bxovJ6oySDkayo +gigYoN1GucEdK/Wtm9RQqgVh61IwLTZV5gcD7daPXJO1ewdORArhrckxGq+x8Eh5NPv +pgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Au4yafyS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g21si9975779pfg.286.2019.04.20.12.55.00; Sat, 20 Apr 2019 12:55:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Au4yafyS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727792AbfDTTvG (ORCPT + 99 others); Sat, 20 Apr 2019 15:51:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:46994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726537AbfDTTvG (ORCPT ); Sat, 20 Apr 2019 15:51:06 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ED67520833; Sat, 20 Apr 2019 19:51:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555789865; bh=IWyxSI3pim/NYOfv+ZVrKFJhmS8+s9EwNEOMIt55IjE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Au4yafySDZxTkow5xWlbMBUWp+QNkxTgzp2WdPoLOrxR6v5KPYTl8lkQp54eYXn1o HPTNkV0GGeOp3tMuqtssXMPzubStFJhkWY8nnmzjdgrIDujhVhcJ5cUMbAOZWJe3uG On3YuxIjVK4lpQzWUBE1UHfmZaewTOx64nVyP7dU= Date: Sat, 20 Apr 2019 21:51:03 +0200 From: Greg KH To: Madhumitha Prabakaran Cc: eric@anholt.net, stefan.wahren@i2se.com, f.fainelli@gmail.com, rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] Staging: vc04_services: Cleanup in ctrl_set_bitrate() Message-ID: <20190420195103.GA18489@kroah.com> References: <20190420165644.11892-1-madhumithabiw@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190420165644.11892-1-madhumithabiw@gmail.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 20, 2019 at 11:56:44AM -0500, Madhumitha Prabakaran wrote: > Remove unnecessary variable and replace return type. > In addition to that align the function parameters with parentheses to > maintain Linux coding style. > > Issue suggested by Coccinelle. > > Signed-off-by: Madhumitha Prabakaran > > --- > Changes in v2 > > 1) Fix my own error of removing function call from the variable. > 2) Align the function parameters with parentheses. > > --- > --- > .../staging/vc04_services/bcm2835-camera/controls.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c > index e39ab5fae724..71eb349c3138 100644 > --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c > +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c > @@ -607,18 +607,16 @@ static int ctrl_set_bitrate(struct bm2835_mmal_dev *dev, > struct v4l2_ctrl *ctrl, > const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl) > { > - int ret; > struct vchiq_mmal_port *encoder_out; > > dev->capture.encode_bitrate = ctrl->val; > > encoder_out = &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0]; > > - ret = vchiq_mmal_port_parameter_set(dev->instance, encoder_out, > - mmal_ctrl->mmal_id, > - &ctrl->val, sizeof(ctrl->val)); > - ret = 0; > - return ret; > + vchiq_mmal_port_parameter_set(dev->instance, encoder_out, > + mmal_ctrl->mmal_id, &ctrl->val, > + sizeof(ctrl->val)); > + return 0; > } Why does this function even return anything at all if it can not fail? Why not return the value that vchiq_mmal_port_parameter_set() returned? thanks, greg k-h