lkml.org 
[lkml]   [2017]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Sony-laptop: Use common error handling code in sony_nc_setup_rfkill()
From
Date
> Apparently this patch done without reading the actual code.

I performed another simple software refactoring.


> NAK.
>
> -1 is EPERM which sounds wrong here. If you would like to fix it,
> propagate a real error codes from sony_call_snc_handle().

I do not know at the moment why an error code which you find
questionable was suggested by Marco Chiappero on 2012-05-19
and committed by Matthew Garrett on 2012-05-31 (according the
commit d6f15ed876b83a1a0eba1d0473eef58acc95444a: use soft rfkill
status stored in hw).


>> if (!rfk)
>> return -ENOMEM;
>
> Okay error code.

Can any other identifier make more sense there?


>> - }
>> + if (sony_call_snc_handle(sony_rfkill_handle, 0x200, &result) < 0)
>> + goto destroy_rfk;
>> +
>> hwblock = !(result & 0x1);
>>
>> if (sony_call_snc_handle(sony_rfkill_handle,
>> - sony_rfkill_address[nc_type],
>> - &result) < 0) {
>> - rfkill_destroy(rfk);
>> - return -1;
>
> Not okay and it might be different from previous case.

The shown function call was repeated with an other parameter.
Which error reporting would you find more appropriate then?


> P.S. Don't bother us with patches on which you didn't do your home work.

Do we occasionally need to distinguish better between an ordinary
refactoring and the adjustments for additional software improvements?

Regards,
Markus

\
 
 \ /
  Last update: 2017-10-31 15:24    [W:0.121 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site