[flashrom] [PATCH] Use a distinct return code for invalid SPI command length

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Tue Jul 14 12:30:50 CEST 2009


On 14.07.2009 12:09, Stefan Reinauer wrote:
> On 14.07.2009 12:01 Uhr, Carl-Daniel Hailfinger wrote:
>   
>> Use a distinct return code for SPI commands with unsupported/invalid length.
>> Some drivers support only a few combinations of read/write length and
>> return error otherwise. Having a distinct return code for this error
>> means we can handle it in upper layers.
>>
>> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>  
>>     
>
> Maybe it would be better style to use an enum instead of #defines but
> that's a different story.
>   

There are quite a few #defines which would benefit from being enums, but
here I see no way to have enums count backwards. We could make the error
codes positive values and return -ESOMETHING if we really want to
convert to enums here.

> Acked-by: Stefan Reinauer <stepan at coresystems.de>
>   

Thanks, r653.

Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/





More information about the flashrom mailing list