On Mon, 2021-03-15 at 11:24 +0000, [email protected] wrote: > On 3/15/21 8:53 AM, Joe Perches wrote: > > On Mon, 2021-03-08 at 11:58 +0530, Pratyush Yadav wrote: > > > On 06/03/21 11:50AM, Tudor Ambarus wrote: > > > > else is not generally useful after a break or return. > > > > > > > > Signed-off-by: Tudor Ambarus <[email protected]> > > > > > > Reviewed-by: Pratyush Yadav <[email protected]> > > > > > > > I don't think this improves the code. > > > > Generally, checkpatch is a stupid little script. > > > > This code uses a form like: > > if (foo) > > return bar; > > else > > return baz; > > Isn't else redundant? What are the benefits of keeping the else?
Visual consistency and it's a widely used style. A long time ago Al Viro wrote: https://lore.kernel.org/lkml/[email protected]/ which resulted in the patch to checkpatch that tries to ignore that style. https://lore.kernel.org/lkml/1411621434.4026.9.camel@joe-AO725/ > > I think better would be to change the code to use temporaries > > and convert the functions to bool. > returning one is wrong indeed, would you submit a patch for the conversion > of the functions to bool? Just a suggestion...

