All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Kyle McMartin <kyle@mcmartin.ca>,
	RTCLINUX <rtc-linux@googlegroups.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	Linux-sh list <linux-sh@vger.kernel.org>,
	Parisc List <linux-parisc@vger.kernel.org>,
	linux-m68k <linux-m68k@lists.linux-m68k.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/6] rtc: generic: allow building on all architectures
Date: Wed, 02 Mar 2016 10:05:18 +0100	[thread overview]
Message-ID: <1620536.OtjnSSLgCT__1673.21720296076$1456909618$gmane$org@wuerfel> (raw)
In-Reply-To: <CAMuHMdW5+jZ1n9WnCwBrGSGjUa8ziNTTqf-H15EFTQC_iwnw+Q@mail.gmail.com>

On Wednesday 02 March 2016 09:57:27 Geert Uytterhoeven wrote:
> > @@ -33,13 +35,21 @@ static const struct rtc_class_ops generic_rtc_ops = {
> >         .read_time = generic_get_time,
> >         .set_time = generic_set_time,
> >  };
> > +#else
> > +#define generic_rtc_ops *(struct rtc_class_ops*)NULL
> > +#endif
> >
> >  static int __init generic_rtc_probe(struct platform_device *dev)
> >  {
> >         struct rtc_device *rtc;
> > +       const struct rtc_class_ops *ops;
> > +
> > +       ops = dev_get_platdata(&dev->dev);
> > +       if (!ops)
> > +               ops = &generic_rtc_ops;
> 
> I hope no compiler version treats "&*(struct rtc_class_ops*)NULL" as
> undefined behavior?

It's a bit odd, but I think it's syntactically correct C, and not
much too different from 

#define offsetof(TYPE, MEMBER)  ((size_t)&((TYPE *)0)->MEMBER)

is it? My last patch gets rid of it again.

	Arnd

  reply	other threads:[~2016-03-02  9:05 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 16:59 [PATCH 0/6] rtc: generic: follow up for COMPILE_TEST Arnd Bergmann
2016-03-01 16:59 ` Arnd Bergmann
2016-03-01 16:59 ` [rtc-linux] " Arnd Bergmann
2016-03-01 16:59 ` Arnd Bergmann
2016-03-01 16:59 ` [PATCH 1/6] rtc: generic: allow building on all architectures Arnd Bergmann
2016-03-01 16:59   ` Arnd Bergmann
2016-03-01 16:59   ` [rtc-linux] " Arnd Bergmann
2016-03-01 16:59   ` Arnd Bergmann
2016-03-01 16:59   ` Arnd Bergmann
2016-03-02  8:57   ` Geert Uytterhoeven
2016-03-02  8:57   ` Geert Uytterhoeven
2016-03-02  8:57     ` Geert Uytterhoeven
2016-03-02  8:57     ` [rtc-linux] " Geert Uytterhoeven
2016-03-02  8:57     ` Geert Uytterhoeven
2016-03-02  8:57     ` Geert Uytterhoeven
2016-03-02  9:05     ` Arnd Bergmann [this message]
2016-03-02  9:05     ` Arnd Bergmann
2016-03-02  9:05       ` Arnd Bergmann
2016-03-02  9:05       ` Arnd Bergmann
2016-03-02  9:05       ` [rtc-linux] " Arnd Bergmann
2016-03-02  9:05       ` Arnd Bergmann
2016-03-02  9:05       ` Arnd Bergmann
2016-03-02  9:28     ` Andreas Schwab
2016-03-02  9:28       ` Andreas Schwab
2016-03-02  9:28       ` Andreas Schwab
2016-03-02  9:28       ` [rtc-linux] " Andreas Schwab
2016-03-02  9:28       ` Andreas Schwab
2016-03-02  9:28       ` Andreas Schwab
2016-03-02  9:39       ` Geert Uytterhoeven
2016-03-02  9:39         ` Geert Uytterhoeven
2016-03-02  9:39         ` [rtc-linux] " Geert Uytterhoeven
2016-03-02  9:39         ` Geert Uytterhoeven
2016-03-02  9:39         ` Geert Uytterhoeven
2016-03-02  9:39       ` Geert Uytterhoeven
2016-03-01 16:59 ` [PATCH 2/6] m68k: rtc: provide rtc_class_ops directly Arnd Bergmann
2016-03-01 16:59   ` Arnd Bergmann
2016-03-01 16:59   ` [rtc-linux] " Arnd Bergmann
2016-03-01 16:59   ` Arnd Bergmann
2016-03-01 16:59   ` Arnd Bergmann
2016-03-01 16:59 ` Arnd Bergmann
2016-03-01 16:59 ` [PATCH 3/6] powerpc: " Arnd Bergmann
2016-03-01 16:59 ` Arnd Bergmann
2016-03-01 16:59   ` Arnd Bergmann
2016-03-01 16:59   ` [rtc-linux] " Arnd Bergmann
2016-03-01 16:59   ` Arnd Bergmann
2016-03-01 16:59   ` Arnd Bergmann
2016-03-01 18:37   ` kbuild test robot
2016-03-01 18:37     ` kbuild test robot
2016-03-01 18:37     ` kbuild test robot
2016-03-01 18:37     ` [rtc-linux] " kbuild test robot
2016-03-01 18:37     ` kbuild test robot
2016-03-01 18:37     ` kbuild test robot
2016-03-01 20:31     ` Arnd Bergmann
2016-03-01 20:31     ` Arnd Bergmann
2016-03-01 20:31       ` Arnd Bergmann
2016-03-01 20:31       ` [rtc-linux] " Arnd Bergmann
2016-03-01 20:31       ` Arnd Bergmann
2016-03-01 20:31       ` Arnd Bergmann
2016-03-01 17:00 ` [PATCH 4/6] parisc: " Arnd Bergmann
2016-03-01 17:00   ` Arnd Bergmann
2016-03-01 17:00   ` [rtc-linux] " Arnd Bergmann
2016-03-01 17:00   ` Arnd Bergmann
2016-03-01 17:00   ` Arnd Bergmann
2016-03-01 17:19   ` kbuild test robot
2016-03-01 17:19   ` kbuild test robot
2016-03-01 17:19     ` kbuild test robot
2016-03-01 17:19     ` [rtc-linux] " kbuild test robot
2016-03-01 17:19     ` kbuild test robot
2016-03-01 17:19     ` kbuild test robot
2016-03-10  4:34   ` Alexandre Belloni
2016-03-10  4:34     ` Alexandre Belloni
2016-03-10  4:34     ` [rtc-linux] " Alexandre Belloni
2016-03-10  4:34     ` Alexandre Belloni
2016-03-10  4:34     ` Alexandre Belloni
2016-03-01 17:00 ` Arnd Bergmann
2016-03-01 17:00 ` [PATCH 5/6] sh: " Arnd Bergmann
2016-03-01 17:00   ` Arnd Bergmann
2016-03-01 17:00   ` [rtc-linux] " Arnd Bergmann
2016-03-01 17:00   ` Arnd Bergmann
2016-03-01 17:00   ` Arnd Bergmann
2016-03-01 17:00 ` Arnd Bergmann
2016-03-01 17:00 ` [PATCH 6/6] rtc: generic: remove get_rtc_time/set_rtc_time wrappers Arnd Bergmann
2016-03-01 17:00   ` Arnd Bergmann
2016-03-01 17:00   ` [rtc-linux] " Arnd Bergmann
2016-03-01 17:00   ` Arnd Bergmann
2016-03-01 17:00   ` Arnd Bergmann
2016-03-10  4:41 ` [PATCH 0/6] rtc: generic: follow up for COMPILE_TEST Alexandre Belloni
2016-03-10  4:41 ` Alexandre Belloni
2016-03-10  4:41   ` Alexandre Belloni
2016-03-10  4:41   ` [rtc-linux] " Alexandre Belloni
2016-03-10  4:41   ` 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='1620536.OtjnSSLgCT__1673.21720296076$1456909618$gmane$org@wuerfel' \
    --to=arnd@arndb.de \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=geert@linux-m68k.org \
    --cc=kyle@mcmartin.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=rtc-linux@googlegroups.com \
    /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.