public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Andreas Färber" <afaerber@suse.de>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>,
	linux-rtc@vger.kernel.org,
	Alessandro Zummo <a.zummo@towertech.it>, Roc He <hepeng@zidoo.tv>,
	????????? <jiang.liqin@geniatech.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 2/3] rtc: Add Realtek RTD1295
Date: Sun, 27 Aug 2017 15:37:51 +0200	[thread overview]
Message-ID: <20170827133751.GD13622@lunn.ch> (raw)
In-Reply-To: <d20fbc21-bd8f-c191-ed51-03487868e7b0@suse.de>

> >> +static inline int rtd119x_rtc_year_days(int year)
> >> +{
> >> +	return rtc_year_days(1, 12, year);
> > 
> > I'm not sure it is worth wrapping rtc_year_days
> [snip]
> 
> Well, I found your rtc_year_days rather confusing and had to play with
> the arguments until I got it working as expected, so I wanted an inline
> function (or macro) as abstraction from my three callers.

I agree with that. I was wondering why 1st December was being used. I
would say this API does not do too well on Rusty's API Design
Manifesto.

It does at least get the day/month/year in the right order ;-)

	Andrew

  reply	other threads:[~2017-08-27 13:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-27  0:33 [PATCH v2 0/3] arm64: Realtek RTD1295 RTC Andreas Färber
2017-08-27  0:33 ` [PATCH v2 1/3] dt-bindings: rtc: Add Realtek RTD1295 Andreas Färber
2017-08-27  0:33 ` [PATCH v2 2/3] " Andreas Färber
2017-08-27  2:05   ` Andrew Lunn
2017-08-27  2:30     ` Andreas Färber
2017-08-27  3:27       ` Andrew Lunn
2017-08-27 10:21         ` Andreas Färber
2017-08-27  8:27       ` Alexandre Belloni
2017-08-27 10:28         ` Andreas Färber
2017-08-27  9:13   ` Alexandre Belloni
2017-08-27 11:30     ` Andreas Färber
2017-08-27 13:37       ` Andrew Lunn [this message]
2017-08-27 19:26         ` Alexandre Belloni
2017-08-28 15:50       ` Alexandre Belloni
2017-08-27  0:33 ` [PATCH v2 3/3] arm64: dts: realtek: Add RTD1295 RTC node Andreas Färber

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=20170827133751.GD13622@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=a.zummo@towertech.it \
    --cc=afaerber@suse.de \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=hepeng@zidoo.tv \
    --cc=jiang.liqin@geniatech.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --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