All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Dorcas Litunya <anonolitunya@gmail.com>
Cc: Julia Lawall <julia.lawall@inria.fr>,
	outreachy@lists.linux.dev, dan.carpenter@linaro.org,
	andi.shyti@linux.intel.com,
	Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Teddy Wang <teddy.wang@siliconmotion.com>,
	linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] staging: sm750fb: Remove unused return value in program_mode_registers()
Date: Wed, 18 Oct 2023 15:23:13 +0200	[thread overview]
Message-ID: <2023101836-earful-freight-9c51@gregkh> (raw)
In-Reply-To: <ZS/Wr9ShnEe3umeY@dorcaslitunya-virtual-machine>

On Wed, Oct 18, 2023 at 03:59:27PM +0300, Dorcas Litunya wrote:
> On Wed, Oct 18, 2023 at 02:06:41PM +0200, Julia Lawall wrote:
> > 
> > 
> > On Wed, 18 Oct 2023, Dorcas AnonoLitunya wrote:
> > 
> > > Modifies the return type of program_mode_registers()
> > > to void from int as the return value is being ignored in
> > > all subsequent function calls.
> > >
> > > This improves code readability and maintainability.
> > >
> > > Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Signed-off-by: Dorcas AnonoLitunya <anonolitunya@gmail.com>
> > > ---
> > >  drivers/staging/sm750fb/ddk750_mode.c | 5 ++---
> > >  1 file changed, 2 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c
> > > index 83ace6cc9583..e15039238232 100644
> > > --- a/drivers/staging/sm750fb/ddk750_mode.c
> > > +++ b/drivers/staging/sm750fb/ddk750_mode.c
> > > @@ -73,8 +73,8 @@ display_control_adjust_sm750le(struct mode_parameter *mode_param,
> > >  }
> > >
> > >  /* only timing related registers will be  programed */
> > > -static int program_mode_registers(struct mode_parameter *mode_param,
> > > -				  struct pll_value *pll)
> > > +static void program_mode_registers(struct mode_parameter *mode_param,
> > > +				   struct pll_value *pll)
> > >  {
> > >  	int ret = 0;
> > >  	int cnt = 0;
> > > @@ -202,7 +202,6 @@ static int program_mode_registers(struct mode_parameter *mode_param,
> > >  	} else {
> > >  		ret = -1;
> > 
> > Is it still useful to have ret = -1?  Maybe the ret variable is not useful
> > at all any more, but one would have to check the parts of the function
> > that aren't shown.
> >
> I agree Julia. I will remove the setting part for ret = -1 but keep the
> ret variable just in case it is being used by parts of the function not
> shown.

No, don't do that, you will trip other static checkers if you do so.
Remove it entirely as it is obviously not needed anymore.

thanks,

greg k-h

  parent reply	other threads:[~2023-10-18 13:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18  9:07 [PATCH 0/2] Remove unused return values from functions Dorcas AnonoLitunya
2023-10-18  9:07 ` Dorcas AnonoLitunya
2023-10-18  9:07 ` [PATCH 1/2] staging: sm750fb: Remove unused return value in display_control_adjust_sm750le() Dorcas AnonoLitunya
2023-10-18  9:07   ` Dorcas AnonoLitunya
2023-10-18  9:07 ` [PATCH 2/2] staging: sm750fb: Remove unused return value in program_mode_registers() Dorcas AnonoLitunya
2023-10-18  9:07   ` Dorcas AnonoLitunya
2023-10-18  9:26   ` Greg Kroah-Hartman
2023-10-18  9:34     ` Dorcas Litunya
2023-10-18 13:25       ` Greg Kroah-Hartman
2023-10-18 13:24         ` Dorcas Litunya
2023-10-18  9:34   ` Dan Carpenter
2023-10-18 12:06   ` Julia Lawall
2023-10-18 12:59     ` Dorcas Litunya
2023-10-18 13:15       ` Julia Lawall
2023-10-18 13:23       ` Greg Kroah-Hartman [this message]
2023-10-18 12:07 ` [PATCH 0/2] Remove unused return values from functions Julia Lawall

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=2023101836-earful-freight-9c51@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=andi.shyti@linux.intel.com \
    --cc=anonolitunya@gmail.com \
    --cc=dan.carpenter@linaro.org \
    --cc=julia.lawall@inria.fr \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=outreachy@lists.linux.dev \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=teddy.wang@siliconmotion.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.