All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	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:28:40 +0100	[thread overview]
Message-ID: <mvmwpplns8n.fsf@hawking.suse.de> (raw)
In-Reply-To: <CAMuHMdW5+jZ1n9WnCwBrGSGjUa8ziNTTqf-H15EFTQC_iwnw+Q@mail.gmail.com> (Geert Uytterhoeven's message of "Wed, 2 Mar 2016 09:57:27 +0100")

Geert Uytterhoeven <geert@linux-m68k.org> writes:

>> +#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?

Yes, that is guaranteed, the operations cancel each other (6.5.3.2#3: If
the operand is the result of a unary * operator, neither that operator
nor the & operator is evaluated and the result is as if both were
omitted).

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

WARNING: multiple messages have this Message-ID (diff)
From: Andreas Schwab <schwab@linux-m68k.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	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:28:40 +0100	[thread overview]
Message-ID: <mvmwpplns8n.fsf@hawking.suse.de> (raw)
In-Reply-To: <CAMuHMdW5+jZ1n9WnCwBrGSGjUa8ziNTTqf-H15EFTQC_iwnw+Q@mail.gmail.com> (Geert Uytterhoeven's message of "Wed, 2 Mar 2016 09:57:27 +0100")

Geert Uytterhoeven <geert@linux-m68k.org> writes:

>> +#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?

Yes, that is guaranteed, the operations cancel each other (6.5.3.2#3: If
the operand is the result of a unary * operator, neither that operator
nor the & operator is evaluated and the result is as if both were
omitted).

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

WARNING: multiple messages have this Message-ID (diff)
From: Andreas Schwab <schwab@linux-m68k.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	 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: [rtc-linux] Re: [PATCH 1/6] rtc: generic: allow building on all architectures
Date: Wed, 02 Mar 2016 10:28:40 +0100	[thread overview]
Message-ID: <mvmwpplns8n.fsf@hawking.suse.de> (raw)
In-Reply-To: <CAMuHMdW5+jZ1n9WnCwBrGSGjUa8ziNTTqf-H15EFTQC_iwnw+Q@mail.gmail.com> (Geert Uytterhoeven's message of "Wed, 2 Mar 2016 09:57:27 +0100")

Geert Uytterhoeven <geert@linux-m68k.org> writes:

>> +#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?

Yes, that is guaranteed, the operations cancel each other (6.5.3.2#3: If
the operand is the result of a unary * operator, neither that operator
nor the & operator is evaluated and the result is as if both were
omitted).

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

-- 
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

WARNING: multiple messages have this Message-ID (diff)
From: Andreas Schwab <schwab@linux-m68k.org>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/6] rtc: generic: allow building on all architectures
Date: Wed, 02 Mar 2016 09:28:40 +0000	[thread overview]
Message-ID: <mvmwpplns8n.fsf@hawking.suse.de> (raw)
In-Reply-To: <CAMuHMdW5+jZ1n9WnCwBrGSGjUa8ziNTTqf-H15EFTQC_iwnw+Q@mail.gmail.com> (Geert Uytterhoeven's message of "Wed, 2 Mar 2016 09:57:27 +0100")

Geert Uytterhoeven <geert@linux-m68k.org> writes:

>> +#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?

Yes, that is guaranteed, the operations cancel each other (6.5.3.2#3: If
the operand is the result of a unary * operator, neither that operator
nor the & operator is evaluated and the result is as if both were
omitted).

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

WARNING: multiple messages have this Message-ID (diff)
From: schwab@linux-m68k.org (Andreas Schwab)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/6] rtc: generic: allow building on all architectures
Date: Wed, 02 Mar 2016 10:28:40 +0100	[thread overview]
Message-ID: <mvmwpplns8n.fsf@hawking.suse.de> (raw)
In-Reply-To: <CAMuHMdW5+jZ1n9WnCwBrGSGjUa8ziNTTqf-H15EFTQC_iwnw+Q@mail.gmail.com> (Geert Uytterhoeven's message of "Wed, 2 Mar 2016 09:57:27 +0100")

Geert Uytterhoeven <geert@linux-m68k.org> writes:

>> +#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?

Yes, that is guaranteed, the operations cancel each other (6.5.3.2#3: If
the operand is the result of a unary * operator, neither that operator
nor the & operator is evaluated and the result is as if both were
omitted).

Andreas.

-- 
Andreas Schwab, schwab at linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

WARNING: multiple messages have this Message-ID (diff)
From: Andreas Schwab <schwab@linux-m68k.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	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@vger.kernel.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:28:40 +0100	[thread overview]
Message-ID: <mvmwpplns8n.fsf@hawking.suse.de> (raw)
In-Reply-To: <CAMuHMdW5+jZ1n9WnCwBrGSGjUa8ziNTTqf-H15EFTQC_iwnw+Q@mail.gmail.com> (Geert Uytterhoeven's message of "Wed, 2 Mar 2016 09:57:27 +0100")

Geert Uytterhoeven <geert@linux-m68k.org> writes:

>> +#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?

Yes, that is guaranteed, the operations cancel each other (6.5.3.2#3: If
the operand is the result of a unary * operator, neither that operator
nor the & operator is evaluated and the result is as if both were
omitted).

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  parent reply	other threads:[~2016-03-02  9:28 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 ` Arnd Bergmann
2016-03-01 16:59 ` [rtc-linux] " 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   ` Arnd Bergmann
2016-03-01 16:59   ` Arnd Bergmann
2016-03-01 16:59   ` [rtc-linux] " 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     ` Geert Uytterhoeven
2016-03-02  8:57     ` Geert Uytterhoeven
2016-03-02  8:57     ` [rtc-linux] " Geert Uytterhoeven
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       ` 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:28     ` Andreas Schwab [this message]
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:39       ` 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-02  9:39         ` [rtc-linux] " 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   ` 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 3/6] powerpc: " 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   ` Arnd Bergmann
2016-03-01 16:59   ` [rtc-linux] " 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     ` kbuild test robot
2016-03-01 18:37     ` [rtc-linux] " 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       ` Arnd Bergmann
2016-03-01 20:31       ` Arnd Bergmann
2016-03-01 20:31       ` [rtc-linux] " 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   ` Arnd Bergmann
2016-03-01 17:00   ` Arnd Bergmann
2016-03-01 17:00   ` Arnd Bergmann
2016-03-01 17:00   ` [rtc-linux] " 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     ` kbuild test robot
2016-03-01 17:19     ` kbuild test robot
2016-03-01 17:19     ` [rtc-linux] " kbuild test robot
2016-03-10  4:34   ` Alexandre Belloni
2016-03-10  4:34     ` Alexandre Belloni
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-01 17:00 ` [PATCH 5/6] sh: " 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   ` [rtc-linux] " 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   ` Arnd Bergmann
2016-03-01 17:00   ` Arnd Bergmann
2016-03-01 17:00   ` [rtc-linux] " 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=mvmwpplns8n.fsf@hawking.suse.de \
    --to=schwab@linux-m68k.org \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=arnd@arndb.de \
    --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.