* re: power_supply: Add support for TI BQ25890 charger chip
@ 2015-05-26 9:04 Dan Carpenter
[not found] ` <CAD03FC+H0JQUR32eGLrVWe_OaiiMTxUmCxdBwuWnPwMRz8XSOQ@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2015-05-26 9:04 UTC (permalink / raw)
To: laurentiu.palcu; +Cc: linux-pm
Hello Laurentiu Palcu,
The patch 4aeae9cb0dad: "power_supply: Add support for TI BQ25890
charger chip" from May 19, 2015, leads to the following static
checker warning:
drivers/power/bq25890_charger.c:843 bq25890_probe()
warn: impossible condition '(bq->chip_id < 0) => (0-255 < 0)'
drivers/power/bq25890_charger.c
841
842 bq->chip_id = bq25890_field_read(bq, F_PN);
843 if (bq->chip_id < 0) {
^^^^^^^^^^^^^^^
Never true.
844 dev_err(dev, "Cannot read chip ID.\n");
845 return ret;
846 }
847
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread[parent not found: <CAD03FC+H0JQUR32eGLrVWe_OaiiMTxUmCxdBwuWnPwMRz8XSOQ@mail.gmail.com>]
* Re: power_supply: Add support for TI BQ25890 charger chip [not found] ` <CAD03FC+H0JQUR32eGLrVWe_OaiiMTxUmCxdBwuWnPwMRz8XSOQ@mail.gmail.com> @ 2015-05-26 20:32 ` Sebastian Reichel 2015-05-27 9:27 ` Dan Carpenter 1 sibling, 0 replies; 3+ messages in thread From: Sebastian Reichel @ 2015-05-26 20:32 UTC (permalink / raw) To: Laurentiu Palcu; +Cc: Dan Carpenter, laurentiu.palcu, linux-pm [-- Attachment #1: Type: text/plain, Size: 1044 bytes --] Hi, On Tue, May 26, 2015 at 09:08:46PM +0300, Laurentiu Palcu wrote: > On 26 May 2015 17:45, "Dan Carpenter" <dan.carpenter@oracle.com> wrote: > > The patch 4aeae9cb0dad: "power_supply: Add support for TI BQ25890 > > charger chip" from May 19, 2015, leads to the following static > > checker warning: > > > > drivers/power/bq25890_charger.c:843 bq25890_probe() > > warn: impossible condition '(bq->chip_id < 0) => (0-255 < 0)' > > > > drivers/power/bq25890_charger.c > > 841 > > 842 bq->chip_id = bq25890_field_read(bq, F_PN); > > 843 if (bq->chip_id < 0) { > > ^^^^^^^^^^^^^^^ > > Never true. > Damn it... :/ I totally missed this. Thanks for catching it. chip_id should > be int... Out of curiosity, what static checker did you use? > > Sebastian, do you prefer another patch revision or just a separate patch > with the fix? Either way, it'll probably be early next week since I'm > travelling this one. Please send a separate patch. -- Sebastian [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: power_supply: Add support for TI BQ25890 charger chip [not found] ` <CAD03FC+H0JQUR32eGLrVWe_OaiiMTxUmCxdBwuWnPwMRz8XSOQ@mail.gmail.com> 2015-05-26 20:32 ` Sebastian Reichel @ 2015-05-27 9:27 ` Dan Carpenter 1 sibling, 0 replies; 3+ messages in thread From: Dan Carpenter @ 2015-05-27 9:27 UTC (permalink / raw) To: Laurentiu Palcu; +Cc: sre, laurentiu.palcu, linux-pm On Tue, May 26, 2015 at 09:08:46PM +0300, Laurentiu Palcu wrote: > Hi Dan, > > On 26 May 2015 17:45, "Dan Carpenter" <dan.carpenter@oracle.com> wrote: > > > > Hello Laurentiu Palcu, > > > > The patch 4aeae9cb0dad: "power_supply: Add support for TI BQ25890 > > charger chip" from May 19, 2015, leads to the following static > > checker warning: > > > > drivers/power/bq25890_charger.c:843 bq25890_probe() > > warn: impossible condition '(bq->chip_id < 0) => (0-255 < 0)' > > > > drivers/power/bq25890_charger.c > > 841 > > 842 bq->chip_id = bq25890_field_read(bq, F_PN); > > 843 if (bq->chip_id < 0) { > > ^^^^^^^^^^^^^^^ > > Never true. > Damn it... :/ I totally missed this. Thanks for catching it. chip_id should > be int... Out of curiosity, what static checker did you use? This was a Smatch warning. regards, dan carpenter ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-27 9:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-26 9:04 power_supply: Add support for TI BQ25890 charger chip Dan Carpenter
[not found] ` <CAD03FC+H0JQUR32eGLrVWe_OaiiMTxUmCxdBwuWnPwMRz8XSOQ@mail.gmail.com>
2015-05-26 20:32 ` Sebastian Reichel
2015-05-27 9:27 ` 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).