lkml.org 
[lkml]   [2013]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] extcon: arizona: Fix reset of HPDET after race with removal
On Mon, Nov 04, 2013 at 09:32:50AM +0900, Chanwoo Choi wrote:
> The arizona_hpdet_do_id() return only either -EAGIN or 0(zero).
> extcon-arizona driver could never execute 'goto done;' statement.
>
> ret = arizona_hpdet_do_id(info, &reading, &mic);
> if (ret == -EAGAIN) {
> goto out;
> } else if (ret < 0) {
> goto done;
> }

True that else if is redundant at the moment, but personally I
would be inclined to leave it in, it feels safer against possible
future edits of arizona_hpdet_do_id. It would be reasonable for
someone to assume that other return values are acceptable whilst
editing it but they would then not be handled.

Thanks,
Charles


\
 
 \ /
  Last update: 2013-11-04 11:01    [W:0.236 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site