On Thu, Sep 24, 2015 at 08:41:37PM +0200, Dan Carpenter wrote: > "state" is a bool so it's never less than zero. The intent was to test > "ret" instead. > > Fixes: 56d7df8716b2 ('power: Add Qualcomm SMBB driver') > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> > > diff --git a/drivers/power/qcom_smbb.c b/drivers/power/qcom_smbb.c > index 0dabfe8..5eb1e9e 100644 > --- a/drivers/power/qcom_smbb.c > +++ b/drivers/power/qcom_smbb.c > @@ -351,7 +351,7 @@ static void smbb_set_line_flag(struct smbb_charger *chg, int irq, int flag) > int ret; > > ret = irq_get_irqchip_state(irq, IRQCHIP_STATE_LINE_LEVEL, &state); > - if (state < 0) { > + if (ret < 0) { > dev_err(chg->dev, "failed to read irq line\n"); > return; > } Hrm. This must be a leftover from when this was using Bjorn's irq_read_line(). Thanks! I guess you caught this with smatch? Neither sparse nor gcc give me a warning here, which is disappointing. -Courtney -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html