public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
To: Kiran Padwal <kiran.padwal@smartplayin.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: Mon, 29 Sep 2014 16:54:25 +0300	[thread overview]
Message-ID: <1411998865.5395.5.camel@iivanov-dev> (raw)
In-Reply-To: <54254C4E.3070807@smartplayin.com>

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, &reg);
> > +	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.

> 
> > +
> > +	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


  reply	other threads:[~2014-09-29 13:54 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
2014-09-29 13:54   ` Ivan T. Ivanov [this message]
2014-09-30  4:30     ` Kiran Padwal
2014-09-30  7:36       ` Ivan T. Ivanov
2014-09-30  8:46         ` Kiran Padwal
2014-09-30 19:46         ` Stephen Boyd
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=1411998865.5395.5.camel@iivanov-dev \
    --to=iivanov@mm-sol.com \
    --cc=collinsd@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=edubezval@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=kiran.padwal@smartplayin.com \
    --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