[bug report] rtc: ds1307: rx8130: honor Voltage Loss Flag when reading the time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Uwe Kleine-König,

The patch 501f98266cad: "rtc: ds1307: rx8130: honor Voltage Loss Flag
when reading the time" from Jan 25, 2019, leads to the following
static checker warning:

	drivers/rtc/rtc-ds1307.c:314 ds1307_set_time()
	warn: this cast is a no-op

drivers/rtc/rtc-ds1307.c
    304 	result = regmap_bulk_write(ds1307->regmap, chip->offset, regs,
    305 				   sizeof(regs));
    306 	if (result) {
    307 		dev_err(dev, "%s error %d\n", "write", result);
    308 		return result;
    309 	}
    310 
    311 	if (ds1307->type == rx_8130) {
    312 		/* clear Voltage Loss Flag as data is available now */
    313 		result = regmap_write(ds1307->regmap, RX8130_REG_FLAG,
--> 314 				      ~(u8)RX8130_REG_FLAG_VLF);
                                               ^^^^^^^^^^^^^^^^^^^^^^^^
RX8130_REG_FLAG_VLF is 0x2.  The cast to u8 doesn't change anything
because it gets type promoted to int.  I don't know what was intended.

    315 		if (result) {
    316 			dev_err(dev, "%s error %d\n", "write", result);
    317 			return result;
    318 		}
    319 	}
    320 
    321 	return 0;
    322 }

regards,
dan carpenter



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux