From: Kiran Padwal <kiran.padwal@smartplayin.com>
To: "Ivan T. Ivanov" <iivanov@mm-sol.com>
Cc: Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
Grant Likely <grant.likely@linaro.org>,
Zhang Rui <rui.zhang@intel.com>,
Eduardo Valentin <edubezval@gmail.com>,
linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
David Collins <collinsd@codeaurora.org>
Subject: Re: [PATCH v2] thermal: Add QPNP PMIC temperature alarm driver
Date: Tue, 30 Sep 2014 10:00:23 +0530 [thread overview]
Message-ID: <542A31DF.7020402@smartplayin.com> (raw)
In-Reply-To: <1411998865.5395.5.camel@iivanov-dev>
On Monday 29 September 2014 07:24 PM, Ivan T. Ivanov wrote:
> On Fri, 2014-09-26 at 16:51 +0530, Kiran Padwal wrote:
>> On Thursday 25 September 2014 07:00 PM, Ivan T. Ivanov wrote:
>>> Add support for the temperature alarm peripheral found inside
>>> Qualcomm plug-and-play (QPNP) PMIC chips. The temperature alarm
>>> peripheral outputs a pulse on an interrupt line whenever the
>>> thermal over temperature stage value changes. Implement an ISR
>>> to manage this interrupt.
>>>
>>
>> <snip>
>>
>>> + * This function updates the internal temp value based on the
>>> + * current thermal stage and threshold as well as the previous stage
>>> + */
>>> +static int qpnp_tm_update_temp_no_adc(struct qpnp_tm_chip *chip)
>>> +{
>>> + unsigned int stage;
>>> + int rc;
>>> + u8 reg;
>>> +
>>> + rc = qpnp_tm_read(chip, QPNP_TM_REG_STATUS, ®);
>>> + if (rc < 0)
>>> + return rc;
>>> +
>>> + stage = reg & STATUS_STAGE_MASK;
>>
>> During compilation, getting a waring as below,
>>
>> drivers/thermal/qpnp-temp-alarm.c: In function ‘qpnp_tm_update_temp_no_adc’:
>> drivers/thermal/qpnp-temp-alarm.c:135:8: warning: ‘reg’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>> stage = reg & STATUS_STAGE_MASK;
>
> Could you share compiler version and options which you are using.
> I am unable to trigger this warning. Looking code I can not
> see how this could happen.
I have Linaro cross tool chain with version-4.8.3 and I am simply doing "make zImage" without any option.
Thanks,
--Kiran
>
>>
>>> +
>>> + if (stage > chip->stage) {
>>> + /* increasing stage, use lower bound */
>>> + chip->temp = (stage - 1) * TEMP_STAGE_STEP +
>>> + chip->thresh * TEMP_THRESH_STEP +
>>> + TEMP_STAGE_HYSTERESIS + TEMP_THRESH_MIN;
>>> + } else if (stage < chip->stage) {
>>> + /* decreasing stage, use upper bound */
>>> + chip->temp = stage * TEMP_STAGE_STEP +
>>> + chip->thresh * TEMP_THRESH_STEP -
>>> + TEMP_STAGE_HYSTERESIS + TEMP_THRESH_MIN;
>>> + }
>>> +
>>> + chip->stage = stage;
>>> +
>>> + return 0;
>>> +}
>>> +
>>
>> <snip>
>>
>>> +
>>> +#define QPNP_TM_PM_OPS (&qpnp_tm_pm_ops)
>>> +#else
>>> +#define QPNP_TM_PM_OPS NULL
>>> +#endif
>>> +
>>> +static struct of_device_id qpnp_tm_match_table[] = {
>>
>> It must be static const struct of_device_id, because all OF functions handle it as const.
>
> Sure, will fix it.
>
> Thank you,
> Ivan
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2014-09-30 4:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-25 13:30 [PATCH v2] thermal: Add QPNP PMIC temperature alarm driver Ivan T. Ivanov
2014-09-26 11:21 ` Kiran Padwal
[not found] ` <54254C4E.3070807-edOiRQu9Xnj5XLMNweQjbQ@public.gmane.org>
2014-09-29 13:54 ` Ivan T. Ivanov
2014-09-30 4:30 ` Kiran Padwal [this message]
2014-09-30 7:36 ` Ivan T. Ivanov
2014-09-30 8:46 ` Kiran Padwal
2014-09-30 19:46 ` Stephen Boyd
[not found] ` <542B088A.1050601-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2014-10-01 11:36 ` Ivan T. Ivanov
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=542A31DF.7020402@smartplayin.com \
--to=kiran.padwal@smartplayin.com \
--cc=collinsd@codeaurora.org \
--cc=devicetree@vger.kernel.org \
--cc=edubezval@gmail.com \
--cc=galak@codeaurora.org \
--cc=grant.likely@linaro.org \
--cc=iivanov@mm-sol.com \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=rui.zhang@intel.com \
/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 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).