[PATCH 1/2] tty: hvc: Make hvc_remove() return no value
Nicholas Piggin
npiggin at gmail.com
Mon Nov 13 21:24:33 AEDT 2023
On Mon Nov 13, 2023 at 7:57 PM AEST, Uwe Kleine-König wrote:
> On Mon, Nov 13, 2023 at 07:45:27PM +1000, Nicholas Piggin wrote:
> > On Mon Nov 6, 2023 at 7:44 AM AEST, Uwe Kleine-König wrote:
> > > The function hvc_remove() returns zero unconditionally. Make it return
> > > void instead to make it obvious that the caller doesn't need to do any
> > > error handling. Accordingly drop the error handling from
> > > hvc_opal_remove().
> > >
> > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> >
> > IIUC these are functionally no change, just tidying and removing
> > dead code?
>
> In case this isn't only a rethorical question: There is indeed no
> change in behaviour.
Thanks, it wasn't. Your changelog and code seemed to be quite clear,
I just wanted to confirm I didn't misread or misunderstand it.
Thanks,
Nick
> hvc_remove() returned always zero, so
>
> rc = hvc_remove(hp);
> if (rc == 0) {
> ... some code not changing rc ...
> }
> ... some more code not changing rc ...
> return rc
>
> can be simplified to
>
> hvc_remove(hp);
> ... some code not changing rc ...
> ... some more code not changing rc ...
> return 0;
>
> Best regards
> Uwe
More information about the Linuxppc-dev
mailing list