[PATCH] mtd: nand: raw: atmel: remove unnecessary return value

Marcus Folkesson marcus.folkesson at gmail.com
Fri Aug 9 15:05:02 CEST 2024


Hello Alexander,

Thanks for fast response!

On Fri, Aug 09, 2024 at 02:25:04PM +0200, Alexander Dahl wrote:
> Hello Marcus,
> 
> Am Fri, Aug 09, 2024 at 02:15:43PM +0200 schrieb Marcus Folkesson:
> > The condition 'ret' is always true as it is never set to other than
> > -EIO.
> 
> Technically, you're right.
> 
> I quickly compared with the same driver in Linux.  That has some
> additional lines for DMA transfers which probably got removed when
> porting the driver.

Yes, I thought is was something like that.
> 
> Does the code before your patch throw compiler warnings?  If not, I

Not the compiler, but vim-ale (lint engine) is yelling loudly at me.

> would keep it as is.  The compiler will probably optimize it away
> anyway, and it would make future ports from Linux easier.

I understand your reasoning but not sure I agree.

I don't think it significantly complicates any porting and the code becomes cleaner.

I also think that the porting become less error-prone because it becomes a 
conscious choice to introduce and use ret if needed.

That is what I think, but I don't really have a very strong opinion about it.

> 
> Greets
> Alex
> 

Best regards,
Marcus Folkesson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240809/881da98c/attachment.sig>


More information about the U-Boot mailing list