On Wed, Apr 18, 2018 at 9:23 AM, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote: > [ This code is several years old now. - dan ] Did I miss an earlier bug report? > Hello Rob Herring, > > The patch 3cdf4ad9633e: "rtc: pxa: convert to use shared sa1100 > functions" from May 13, 2015, leads to the following static checker > warning: > > drivers/rtc/rtc-pxa.c:368 pxa_rtc_probe() > info: return a literal instead of 'ret' > > drivers/rtc/rtc-pxa.c > 352 pxa_rtc->base = devm_ioremap(dev, pxa_rtc->ress->start, > 353 resource_size(pxa_rtc->ress)); > 354 if (!pxa_rtc->base) { > 355 dev_err(dev, "Unable to map pxa RTC I/O memory\n"); > 356 return -ENOMEM; > 357 } > 358 > 359 pxa_rtc_open(dev); > 360 > 361 sa1100_rtc->rcnr = pxa_rtc->base + 0x0; > 362 sa1100_rtc->rtsr = pxa_rtc->base + 0x8; > 363 sa1100_rtc->rtar = pxa_rtc->base + 0x4; > 364 sa1100_rtc->rttr = pxa_rtc->base + 0xc; > 365 ret = sa1100_rtc_init(pdev, sa1100_rtc); > 366 if (!ret) { > ^^^^ > This test really looks like it's inverted to me. Indeed. Nice to see no one seems to have noticed or care. Rob