public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Davide Gianforte <davide@gengisdave.org>
Cc: "devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	kernel-janitors <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH 2/2] staging: silicom: function return fixes
Date: Wed, 9 Jul 2014 11:59:14 -0700	[thread overview]
Message-ID: <20140709185914.GA28612@kroah.com> (raw)
In-Reply-To: <1488578.ritUTSl26I@mayhem>

On Tue, Jul 01, 2014 at 02:33:43PM +0200, Davide Gianforte wrote:
> Function return fixes
> 
> Some functions don't need a temporary variable to store return value.
> 
> Where functions always return 0, changed into void functions.
> 
> Signed-off-by: Davide Gianforte <davide@gengisdave.org>
> --
> 
>  drivers/staging/silicom/bpctl_mod.c | 62 ++++++++++---------------------------
>  1 file changed, 16 insertions(+), 46 deletions(-)
> 
> diff --git a/drivers/staging/silicom/bpctl_mod.c b/drivers/staging/silicom/bpctl_mod.c
> index 1322437..c9a4c40 100644
> --- a/drivers/staging/silicom/bpctl_mod.c
> +++ b/drivers/staging/silicom/bpctl_mod.c
> @@ -117,7 +117,7 @@ static struct bpctl_dev *get_status_port_fn(struct bpctl_dev *pbpctl_dev);
>  static void if_scan_init(void);
>  
>  static int bypass_proc_create_dev_sd(struct bpctl_dev *pbp_device_block);
> -static int bypass_proc_remove_dev_sd(struct bpctl_dev *pbp_device_block);
> +static void bypass_proc_remove_dev_sd(struct bpctl_dev *pbp_device_block);
>  
>  static int is_bypass_fn(struct bpctl_dev *pbpctl_dev);
>  static int get_dev_idx_bsf(int bus, int slot, int func);
> @@ -1458,9 +1458,8 @@ static int send_wdt_pulse(struct bpctl_dev *pbpctl_dev)
>  static void send_bypass_clear_pulse(struct bpctl_dev *pbpctl_dev,
>  				    unsigned int value)
>  {
> -	uint32_t ctrl_ext = 0;
> +	uint32_t ctrl_ext = BPCTL_READ_REG(pbpctl_dev, CTRL_EXT);
>  
> -	ctrl_ext = BPCTL_READ_REG(pbpctl_dev, CTRL_EXT);

How about just removing the " = 0;" part of the variable definition?
That would be a smaller patch, and still keep everything "clean".

thanks,

greg k-h

  reply	other threads:[~2014-07-09 18:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-01 12:24 [PATCH 1/2] staging: silicom: checkpatch fixes Davide Gianforte
2014-07-01 12:33 ` [PATCH 2/2] staging: silicom: function return fixes Davide Gianforte
2014-07-09 18:59   ` Greg Kroah-Hartman [this message]
2014-07-11  7:12     ` Davide Gianforte
2014-07-11 13:31   ` Dan Carpenter
2014-07-09  9:38 ` [PATCH 1/2] staging: silicom: checkpatch fixes Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140709185914.GA28612@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=davide@gengisdave.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox