All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Thomas Andreatta <thomasandreatta2000@gmail.com>
Cc: dpenkler@gmail.com, linux-kernel@vger.kernel.org,
	linux-staging@lists.linux.dev,
	Thomas Andreatta <thomas.andreatta2000@gmail.com>
Subject: Re: [PATCH 1/2] Staging: common: iblib: Changed ibrsc function type
Date: Sat, 10 May 2025 18:44:38 +0200	[thread overview]
Message-ID: <2025051025-slate-grape-37ce@gregkh> (raw)
In-Reply-To: <20250510153800.130974-1-thomas.andreatta2000@gmail.com>

On Sat, May 10, 2025 at 05:37:59PM +0200, Thomas Andreatta wrote:
> Function ibrsc type changed from void to int.

You need to explain more here.

> Returning 0 for success.

Yes, but it can not fail:

> 
> Signed-off-by: Thomas Andreatta <thomas.andreatta2000@gmail.com>
> ---
>  drivers/staging/gpib/common/iblib.c       | 4 ++--
>  drivers/staging/gpib/include/gpib_proto.h | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/gpib/common/iblib.c b/drivers/staging/gpib/common/iblib.c
> index b297261818f2..8b4280309ae7 100644
> --- a/drivers/staging/gpib/common/iblib.c
> +++ b/drivers/staging/gpib/common/iblib.c
> @@ -418,12 +418,12 @@ int ibsic(struct gpib_board *board, unsigned int usec_duration)
>  	return 0;
>  }
>  
> -	/* FIXME make int */
> -void ibrsc(struct gpib_board *board, int request_control)
> +int ibrsc(struct gpib_board *board, int request_control)
>  {
>  	board->master = request_control != 0;
>  	if (board->interface->request_system_control)
>  		board->interface->request_system_control(board, request_control);
> +	return 0;

If this can not fail, and request_system_control() can not fail, why
does this function need to return anything?

And you aren't checking the return value of it either, so why change it?

On another note, it's not a good name for a global function :)

thanks,

greg k-h

  parent reply	other threads:[~2025-05-10 16:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-10 15:37 [PATCH 1/2] Staging: common: iblib: Changed ibrsc function type Thomas Andreatta
2025-05-10 15:38 ` [PATCH 2/2] Staging: common: gpib_os: `request_system_control_ioctl` return value Thomas Andreatta
2025-05-10 16:45   ` Greg KH
2025-05-10 17:43     ` [PATCH 2/2] Staging: common: gpib_os: simplify return value handling Thomas Andreatta
2025-05-10 16:44 ` Greg KH [this message]
2025-05-12 14:48 ` [PATCH 1/2] Staging: common: iblib: Changed ibrsc function type 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=2025051025-slate-grape-37ce@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=dpenkler@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=thomas.andreatta2000@gmail.com \
    --cc=thomasandreatta2000@gmail.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.