From: Jeroen Hofstee <jeroen@myspectrum.nl>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] compiler.h: remove duplicated uninitialized_var
Date: Thu, 18 Sep 2014 11:39:44 +0200 [thread overview]
Message-ID: <541AA860.8080101@myspectrum.nl> (raw)
In-Reply-To: <20140918111434.70CC.AA925319@jp.panasonic.com>
Hello Masahiro,
On 18-09-14 04:14, Masahiro Yamada wrote:
>> Since clang has a different definition for uninitialized_var
>> it will complain that it is redefined in include/compiler.h.
>> Since these are already defined in linux/compiler.h just remove
>> this instance.
>>
>> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
>> Cc: Tom Rini <trini@ti.com>
>> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
>
>
> I don't mind this patch but it has made me realize
> another problem.
>
>
> We have both include/compiler.h and include/linux/compiler.h.
> Some sources use tha former and others use the latter.
>
> I don't know how to use the right one in the right place.
no me neither, although it seems arch / drivers tend to use
linux/compiler.h more while tools include compiler.h more.
> Header file policy is one of the biggest problem in U-boot.
>
> Everyone has added ugly work-arounds to solve his own problem
> without correct views or judgement.
>
>
>> diff --git a/include/compiler.h b/include/compiler.h
>> index 9afc11b..1451916 100644
>> --- a/include/compiler.h
>> +++ b/include/compiler.h
>> @@ -129,9 +129,6 @@ typedef unsigned long int uintptr_t;
>>
>> #endif /* USE_HOSTCC */
>>
>> -/* compiler options */
>> -#define uninitialized_var(x) x = x
>> -
>> #define likely(x) __builtin_expect(!!(x), 1)
>> #define unlikely(x) __builtin_expect(!!(x), 0)
>>
>
> I am not sure if likely(x) and unlikely(x) should also
> duplicated here.
>
yup I wondered about that too. likely / unlikely are used a lot
more though then the isolated use of uninitialized_var. And as they
don't cause any problems (the definitions are the same) I let
them alone, but I think they should be removed as well some day.
Regards,
Jeroen
next prev parent reply other threads:[~2014-09-18 9:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-17 18:33 [U-Boot] [PATCH 0/3] Fixes for FreeBSD / clang Jeroen Hofstee
2014-09-17 18:33 ` [U-Boot] [PATCH 1/3] compiler_gcc: do not redefine __gnu_attributes Jeroen Hofstee
2014-09-18 2:13 ` Masahiro Yamada
2014-09-18 9:15 ` Jeroen Hofstee
2014-09-18 9:58 ` Masahiro Yamada
2014-09-17 18:33 ` [U-Boot] [PATCH 2/3] README.clang: update FreeBSD instructions Jeroen Hofstee
2014-09-17 18:33 ` [U-Boot] [PATCH 3/3] compiler.h: remove duplicated uninitialized_var Jeroen Hofstee
2014-09-18 2:14 ` Masahiro Yamada
2014-09-18 9:39 ` Jeroen Hofstee [this message]
2014-09-18 21:59 ` Tom Rini
2014-09-25 14:46 ` [U-Boot] [U-Boot, " Tom Rini
2014-09-18 18:10 ` [U-Boot] [PATCH v2 1/3] compiler_gcc: prevent redefining attributes Jeroen Hofstee
2014-09-19 2:36 ` Masahiro Yamada
2014-09-25 14:46 ` [U-Boot] [U-Boot, v2, " Tom Rini
2014-09-21 8:20 ` [U-Boot] [PATCH v2 2/3] README.clang: update FreeBSD instructions Jeroen Hofstee
2014-09-25 14:46 ` [U-Boot] [U-Boot, v2, " Tom Rini
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=541AA860.8080101@myspectrum.nl \
--to=jeroen@myspectrum.nl \
--cc=u-boot@lists.denx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox