Re: [PATCH 1/2] Staging: common: iblib: Changed ibrsc function type
From: Greg KH
Date: Sat May 10 2025 - 12:44:49 EST
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@xxxxxxxxx>
> ---
> 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