devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] simplefb: Fix build failure on Sparc
@ 2015-01-05  8:15 Hans de Goede
       [not found] ` <1420445716-13468-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2015-01-05  8:15 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: kbuild test robot, linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	Hans de Goede

of_platform_device_create is only defined when CONFIG_OF_ADDRESS is set,
which is normally always the case when CONFIG_OF is defined, except on Sparc,
so explicitly check for CONFIG_OF_ADDRESS rather then for CONFIG_OF.

Reported-by: kbuild test robot <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 drivers/video/fbdev/simplefb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
index 92cac80..1085c04 100644
--- a/drivers/video/fbdev/simplefb.c
+++ b/drivers/video/fbdev/simplefb.c
@@ -402,7 +402,7 @@ static int __init simplefb_init(void)
 	if (ret)
 		return ret;
 
-	if (IS_ENABLED(CONFIG_OF) && of_chosen) {
+	if (IS_ENABLED(CONFIG_OF_ADDRESS) && of_chosen) {
 		for_each_child_of_node(of_chosen, np) {
 			if (of_device_is_compatible(np, "simple-framebuffer"))
 				of_platform_device_create(np, NULL, NULL);
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] simplefb: Fix build failure on Sparc
       [not found] ` <1420445716-13468-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2015-01-05 11:17   ` Tomi Valkeinen
       [not found]     ` <54AA72CB.1020303-l0cyMroinI0@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Tomi Valkeinen @ 2015-01-05 11:17 UTC (permalink / raw)
  To: Hans de Goede
  Cc: kbuild test robot, linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree

[-- Attachment #1: Type: text/plain, Size: 1250 bytes --]

On 05/01/15 10:15, Hans de Goede wrote:
> of_platform_device_create is only defined when CONFIG_OF_ADDRESS is set,
> which is normally always the case when CONFIG_OF is defined, except on Sparc,
> so explicitly check for CONFIG_OF_ADDRESS rather then for CONFIG_OF.
> 
> Reported-by: kbuild test robot <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  drivers/video/fbdev/simplefb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
> index 92cac80..1085c04 100644
> --- a/drivers/video/fbdev/simplefb.c
> +++ b/drivers/video/fbdev/simplefb.c
> @@ -402,7 +402,7 @@ static int __init simplefb_init(void)
>  	if (ret)
>  		return ret;
>  
> -	if (IS_ENABLED(CONFIG_OF) && of_chosen) {
> +	if (IS_ENABLED(CONFIG_OF_ADDRESS) && of_chosen) {
>  		for_each_child_of_node(of_chosen, np) {
>  			if (of_device_is_compatible(np, "simple-framebuffer"))
>  				of_platform_device_create(np, NULL, NULL);
> 

Doesn't this depend on the compiler optimizing the
of_platform_device_create call away? Isn't that rather dangerous assumption?

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] simplefb: Fix build failure on Sparc
       [not found]     ` <54AA72CB.1020303-l0cyMroinI0@public.gmane.org>
@ 2015-01-05 11:21       ` Hans de Goede
       [not found]         ` <54AA73D1.3-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2015-01-05 11:21 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: kbuild test robot, linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree

Hi,

On 05-01-15 12:17, Tomi Valkeinen wrote:
> On 05/01/15 10:15, Hans de Goede wrote:
>> of_platform_device_create is only defined when CONFIG_OF_ADDRESS is set,
>> which is normally always the case when CONFIG_OF is defined, except on Sparc,
>> so explicitly check for CONFIG_OF_ADDRESS rather then for CONFIG_OF.
>>
>> Reported-by: kbuild test robot <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>> ---
>>   drivers/video/fbdev/simplefb.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
>> index 92cac80..1085c04 100644
>> --- a/drivers/video/fbdev/simplefb.c
>> +++ b/drivers/video/fbdev/simplefb.c
>> @@ -402,7 +402,7 @@ static int __init simplefb_init(void)
>>   	if (ret)
>>   		return ret;
>>
>> -	if (IS_ENABLED(CONFIG_OF) && of_chosen) {
>> +	if (IS_ENABLED(CONFIG_OF_ADDRESS) && of_chosen) {
>>   		for_each_child_of_node(of_chosen, np) {
>>   			if (of_device_is_compatible(np, "simple-framebuffer"))
>>   				of_platform_device_create(np, NULL, NULL);
>>
>
> Doesn't this depend on the compiler optimizing the
> of_platform_device_create call away?

Yes it does.

> Isn't that rather dangerous assumption?

The kernel relies on being build with optimization enabled in various places,
this specific construction was suggested during review (by Grant Likely IIRC)
I initially had an #ifdef here. Note that this construction is used in various
places throughout the kernel and it seems to be used more and more often.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] simplefb: Fix build failure on Sparc
       [not found]         ` <54AA73D1.3-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2015-01-05 12:13           ` Tomi Valkeinen
  0 siblings, 0 replies; 4+ messages in thread
From: Tomi Valkeinen @ 2015-01-05 12:13 UTC (permalink / raw)
  To: Hans de Goede
  Cc: kbuild test robot, linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree

[-- Attachment #1: Type: text/plain, Size: 1956 bytes --]

On 05/01/15 13:21, Hans de Goede wrote:
> Hi,
> 
> On 05-01-15 12:17, Tomi Valkeinen wrote:
>> On 05/01/15 10:15, Hans de Goede wrote:
>>> of_platform_device_create is only defined when CONFIG_OF_ADDRESS is set,
>>> which is normally always the case when CONFIG_OF is defined, except
>>> on Sparc,
>>> so explicitly check for CONFIG_OF_ADDRESS rather then for CONFIG_OF.
>>>
>>> Reported-by: kbuild test robot <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>>> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>>> ---
>>>   drivers/video/fbdev/simplefb.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/video/fbdev/simplefb.c
>>> b/drivers/video/fbdev/simplefb.c
>>> index 92cac80..1085c04 100644
>>> --- a/drivers/video/fbdev/simplefb.c
>>> +++ b/drivers/video/fbdev/simplefb.c
>>> @@ -402,7 +402,7 @@ static int __init simplefb_init(void)
>>>       if (ret)
>>>           return ret;
>>>
>>> -    if (IS_ENABLED(CONFIG_OF) && of_chosen) {
>>> +    if (IS_ENABLED(CONFIG_OF_ADDRESS) && of_chosen) {
>>>           for_each_child_of_node(of_chosen, np) {
>>>               if (of_device_is_compatible(np, "simple-framebuffer"))
>>>                   of_platform_device_create(np, NULL, NULL);
>>>
>>
>> Doesn't this depend on the compiler optimizing the
>> of_platform_device_create call away?
> 
> Yes it does.
> 
>> Isn't that rather dangerous assumption?
> 
> The kernel relies on being build with optimization enabled in various
> places,
> this specific construction was suggested during review (by Grant Likely
> IIRC)
> I initially had an #ifdef here. Note that this construction is used in
> various
> places throughout the kernel and it seems to be used more and more often.

Ok. Well, I can't say I'm very happy about that, but if that's the
common accepted way, I'm fine. I'll queue this for fbdev fixes.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-05 12:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-05  8:15 [PATCH] simplefb: Fix build failure on Sparc Hans de Goede
     [not found] ` <1420445716-13468-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-01-05 11:17   ` Tomi Valkeinen
     [not found]     ` <54AA72CB.1020303-l0cyMroinI0@public.gmane.org>
2015-01-05 11:21       ` Hans de Goede
     [not found]         ` <54AA73D1.3-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-01-05 12:13           ` Tomi Valkeinen

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).