linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] drivers: thermal: tsens: Add new operation to check if a sensor is enabled
@ 2019-05-13 18:18 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2019-05-13 18:18 UTC (permalink / raw)
  To: amit.kucheria; +Cc: linux-pm

Hello Amit Kucheria,

The patch 686539daac9f: "drivers: thermal: tsens: Add new operation
to check if a sensor is enabled" from Mar 20, 2019, leads to the
following static checker warning:

	drivers/thermal/qcom/tsens-common.c:73 is_sensor_enabled()
	warn: signedness bug returning '(-22)'

drivers/thermal/qcom/tsens-common.c
    67  bool is_sensor_enabled(struct tsens_priv *priv, u32 hw_id)
        ^^^^

    68  {
    69          u32 val;
    70          int ret;
    71  
    72          if ((hw_id > (priv->num_sensors - 1)) || (hw_id < 0))
    73                  return -EINVAL;
                        ^^^^^^^^^^^^^^
    74          ret = regmap_field_read(priv->rf[SENSOR_EN], &val);
    75          if (ret)
    76                  return ret;
                        ^^^^^^^^^^
    77  
    78          return val & (1 << hw_id);
    79  }


regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-13 18:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-13 18:18 [bug report] drivers: thermal: tsens: Add new operation to check if a sensor is enabled Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).