From: Dan Carpenter <dan.carpenter@oracle.com>
To: amit.kucheria@linaro.org
Cc: linux-pm@vger.kernel.org
Subject: [bug report] drivers: thermal: tsens: Add new operation to check if a sensor is enabled
Date: Mon, 13 May 2019 21:18:17 +0300 [thread overview]
Message-ID: <20190513181814.GA25056@mwanda> (raw)
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
reply other threads:[~2019-05-13 18:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190513181814.GA25056@mwanda \
--to=dan.carpenter@oracle.com \
--cc=amit.kucheria@linaro.org \
--cc=linux-pm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.