[RFC 3/7] staging: fbtft: add lcd controller abstraction

Noralf Trønnes noralf at tronnes.org
Tue Mar 3 14:08:19 UTC 2015


Den 03.03.2015 13:04, skrev Dan Carpenter:
> On Tue, Mar 03, 2015 at 12:57:29PM +0100, Noralf Trønnes wrote:
>>>> +	ret = ctrl->rotate(ctrl, rotation);
>>>> +	if (!ret)
>>>> +		ctrl->rotation = rotation;
>>>> +
>>>> +	return ret;
>>> Better to check "if (ret)" consistently (error handling vs success
>>> handling).
>> Like this?
>>
>> 	ret = ctrl->rotate(ctrl, rotation);
>> 	if (ret)
>> 		return ret;
>>
>> 	ctrl->rotation = rotation;
>>
>> 	return 0;
>>
> Yeah.  This is a tiny nit.  I feel a bit silly for commenting on it now.

No need to be. If this enhances readability even just a tiny bit, I 
welcome it.
I've read enough kernel code now to be amazed of how readable and 
understandable it is.
This becomes very evident when reading some out-of-tree drivers, and 
*cough* fbtft.
I'm practically blind to the code in this patchset, as it has gone 
through several iterations
over the past months. To me it looks very good, but obviously not 
without room for
improvements :-)


Noralf.



More information about the devel mailing list