[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2025051025-slate-grape-37ce@gregkh>
Date: Sat, 10 May 2025 18:44:38 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Thomas Andreatta <thomasandreatta2000@...il.com>
Cc: dpenkler@...il.com, linux-kernel@...r.kernel.org,
linux-staging@...ts.linux.dev,
Thomas Andreatta <thomas.andreatta2000@...il.com>
Subject: Re: [PATCH 1/2] Staging: common: iblib: Changed ibrsc function type
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@...il.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
Powered by blists - more mailing lists