diff mbox series

AW: [PATCH][next] SFH: fix error return check for -ERESTARTSYS

Message ID 7f7ed9ecdd05422ab83e0c08918063bc@bfs.de (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show
Series AW: [PATCH][next] SFH: fix error return check for -ERESTARTSYS | expand

Commit Message

Walter Harms Oct. 30, 2020, 2:40 p.m. UTC
nit picking:
i would  without "else" to improve readability:

       if (ret == -ERESTARTSYS)
                 return -ERESTARTSYS;

        if (ret < 0)
              return -ETIMEDOUT;

          return 0;

jm2c
 wh
diff mbox series

Patch

diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_hid.c b/drivers/hid/amd-sfh-hid/amd_sfh_hid.c
index a471079a3bd0..4f989483aa03 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_hid.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_hid.c
@@ -88,10 +88,10 @@  static int amdtp_wait_for_response(struct hid_device *hid)
                ret = wait_event_interruptible_timeout(hid_data->hid_wait,
                                                       cli_data->request_done[i],
                                                       msecs_to_jiffies(AMD_SFH_RESPONSE_TIMEOUT));
-       if (ret < 0)
-               return -ETIMEDOUT;
-       else if (ret == -ERESTARTSYS)
+       if (ret == -ERESTARTSYS)
                return -ERESTARTSYS;
+       else if (ret < 0)
+               return -ETIMEDOUT;
        else
                return 0;
 }