From: Dan Carpenter <dan.carpenter@oracle.com>
To: andriy.shevchenko@linux.intel.com
Cc: linux-rtc@vger.kernel.org
Subject: [bug report] rtc: rx8025: Switch to use %ptR
Date: Tue, 9 Apr 2019 14:49:11 +0300 [thread overview]
Message-ID: <20190409114911.GA16122@kadam> (raw)
Hello Andy Shevchenko,
The patch 1921cab11723: "rtc: rx8025: Switch to use %ptR" from Dec 4,
2018, leads to the following static checker warning:
drivers/rtc/rtc-rx8025.c:314 rx8025_read_alarm()
error: '%ptR' expects argument of type struct 'rtc_time', argument 5 has type 'struct rtc_wkalrm*'
drivers/rtc/rtc-rx8025.c
284 static int rx8025_read_alarm(struct device *dev, struct rtc_wkalrm *t)
^^^^^^^^^^^^^^^^^^^^
285 {
286 struct rx8025_data *rx8025 = dev_get_drvdata(dev);
287 struct i2c_client *client = rx8025->client;
288 u8 ald[2];
289 int ctrl2, err;
290
291 if (client->irq <= 0)
292 return -EINVAL;
293
294 err = rx8025_read_regs(client, RX8025_REG_ALDMIN, 2, ald);
295 if (err)
296 return err;
297
298 ctrl2 = rx8025_read_reg(client, RX8025_REG_CTRL2);
299 if (ctrl2 < 0)
300 return ctrl2;
301
302 dev_dbg(dev, "%s: read alarm 0x%02x 0x%02x ctrl2 %02x\n",
303 __func__, ald[0], ald[1], ctrl2);
304
305 /* Hardware alarms precision is 1 minute! */
306 t->time.tm_sec = 0;
307 t->time.tm_min = bcd2bin(ald[0] & 0x7f);
308 if (rx8025->ctrl1 & RX8025_BIT_CTRL1_1224)
309 t->time.tm_hour = bcd2bin(ald[1] & 0x3f);
310 else
311 t->time.tm_hour = bcd2bin(ald[1] & 0x1f) % 12
312 + (ald[1] & 0x20 ? 12 : 0);
313
--> 314 dev_dbg(dev, "%s: date: %ptRr\n", __func__, t);
^^^^^ ^
You mean t->time?
315 t->enabled = !!(rx8025->ctrl1 & RX8025_BIT_CTRL1_DALE);
316 t->pending = (ctrl2 & RX8025_BIT_CTRL2_DAFG) && t->enabled;
317
318 return err;
319 }
regards,
dan carpenter
next reply other threads:[~2019-04-09 11:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-09 11:49 Dan Carpenter [this message]
2019-04-09 14:43 ` [bug report] rtc: rx8025: Switch to use %ptR Andy Shevchenko
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=20190409114911.GA16122@kadam \
--to=dan.carpenter@oracle.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-rtc@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).