From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Denis OSTERLAND <denis.osterland@diehl.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"mgr@pengutronix.de" <mgr@pengutronix.de>,
"m.grzeschik@pengutronix.de" <m.grzeschik@pengutronix.de>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"a.zummo@towertech.it" <a.zummo@towertech.it>,
"linux@roeck-us.net" <linux@roeck-us.net>,
"jdelvare@suse.com" <jdelvare@suse.com>,
"linux-rtc@vger.kernel.org" <linux-rtc@vger.kernel.org>,
"kernel@pengutronix.de" <kernel@pengutronix.de>
Subject: Re: [PATCH v3 3/4] rtc: isl1208: add support for isl1219 with tamper detection
Date: Thu, 8 Mar 2018 13:05:49 +0100 [thread overview]
Message-ID: <20180308120549.GG20370@piout.net> (raw)
In-Reply-To: <1520509988.5415.17.camel@diehl.com>
On 08/03/2018 at 11:53:09 +0000, Denis OSTERLAND wrote:
> Am Mittwoch, den 07.03.2018, 11:47 +0100 schrieb Alexandre Belloni:
> > > > > +
> > > > > + tv64.tv_sec = rtc_tm_to_time64(&tm);
> > > > Why not using an unsigned long long directly here? time64_t is not the
> > > > correct type.
> > > Do you mean timespec64 is not the correct type here?
> > > Then yes, sould be time64_t.
> > > If you mean time64_t is not the correct type here,
> > > then can you give me some detail why there is no rtc_tm_to_u64,
> > > or something like that?
> > The rtc subsystem forbids negative times, the proper type should be
> > unsigned.
> I will add rtc_vaild_tm check.
>
> Which sequence for time conversion would you expect?
>
> time64_t secs = rtc_tm_to_time64(&tm);
> BUG_ON(secs < 0);
> return sprintf(buf, "%llu\n", (unsigned long long)secs);
>
> or
>
> return sprintf(buf, "%llu\n", (unsigned long long)rtc_tm_to_time64(&tm));
rtc_vaild_tm will already return EINVAL in case of negative time so this
is the one you should use.
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2018-03-08 12:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-05 10:43 [PATCH v3 0/4] rtc: isl1208: fixes, documentation and isl1219 support Denis OSTERLAND
2018-03-05 10:43 ` [PATCH v3 3/4] rtc: isl1208: add support for isl1219 with tamper detection Denis OSTERLAND
2018-03-06 20:42 ` Alexandre Belloni
2018-03-07 8:19 ` Denis OSTERLAND
2018-03-07 8:19 ` Denis OSTERLAND
2018-03-07 10:47 ` Alexandre Belloni
2018-03-08 11:53 ` Denis OSTERLAND
2018-03-08 11:53 ` Denis OSTERLAND
2018-03-08 12:05 ` Alexandre Belloni [this message]
2018-03-07 22:02 ` Rob Herring
2018-03-05 10:43 ` [PATCH v3 4/4] rtc: isl1208: Add "evdet" interrupt source for isl1219 Denis OSTERLAND
2018-03-05 10:43 ` [PATCH v3 1/4] rtc: isl1208: enable interrupt after context preparation Denis OSTERLAND
2018-03-06 20:20 ` Alexandre Belloni
2018-03-05 10:43 ` [PATCH v3 2/4] rtc: isl1208: switch to rtc_register_device Denis OSTERLAND
2018-03-06 20:20 ` Alexandre Belloni
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=20180308120549.GG20370@piout.net \
--to=alexandre.belloni@free-electrons.com \
--cc=a.zummo@towertech.it \
--cc=denis.osterland@diehl.com \
--cc=devicetree@vger.kernel.org \
--cc=jdelvare@suse.com \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=m.grzeschik@pengutronix.de \
--cc=mgr@pengutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.