[bug report] HID: i2c-hid: Fix resume issue on Raydium touchscreen device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Aaron Ma,

The patch 3e83eda46705: "HID: i2c-hid: Fix resume issue on Raydium
touchscreen device" from Apr 9, 2018, leads to the following static
checker warning:

	drivers/hid/i2c-hid/i2c-hid.c:1244 i2c_hid_resume()
	info: return a literal instead of 'ret'

drivers/hid/i2c-hid/i2c-hid.c
  1232          enable_irq(client->irq);
  1233          ret = i2c_hid_hwreset(client);
  1234          if (ret)
  1235                  return ret;
  1236  
  1237          /* RAYDIUM device (2386:3118) need to re-send report descr cmd
  1238           * after resume, after this it will be back normal.
  1239           * otherwise it issues too many incomplete reports.
  1240           */
  1241          if (ihid->quirks & I2C_HID_QUIRK_RESEND_REPORT_DESCR) {
  1242                  ret = i2c_hid_command(client, &hid_report_descr_cmd, NULL, 0);
  1243                  if (!ret)
                            ^^^^
This test looks inverted?  If not then it would be more obvious if we
wrote it like:

			if (!ret)
				return 0;

  1244                          return ret;
  1245          }
  1246  
  1247          if (hid->driver && hid->driver->reset_resume) {
  1248                  ret = hid->driver->reset_resume(hid);
  1249                  return ret;
  1250          }
  1251  
  1252          return 0;
  1253  }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux