diff mbox

[U-Boot] common: env_common: make env_get_char_spec __weak

Message ID 1405027670-28516-1-git-send-email-jeroen@myspectrum.nl
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Jeroen Hofstee July 10, 2014, 9:27 p.m. UTC
---
yup another clang warning:

common/env_common.c:30:14: warning: unused function '__env_get_char_spec' [-Wunused-function]
static uchar __env_get_char_spec(int index)
             ^
---
 common/env_common.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Jeroen Hofstee July 10, 2014, 9:51 p.m. UTC | #1
Hi Jeroen,

On 10-07-14 23:27, Jeroen Hofstee wrote:
> ---
> yup another clang warning:
>
> common/env_common.c:30:14: warning: unused function '__env_get_char_spec' [-Wunused-function]
> static uchar __env_get_char_spec(int index)
>               ^
> ---
>   common/env_common.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/common/env_common.c b/common/env_common.c
> index cd7b4cd..3b979bc 100644
> --- a/common/env_common.c
> +++ b/common/env_common.c
> @@ -27,12 +27,10 @@ struct hsearch_data env_htab = {
>   	.change_ok = env_flags_validate,
>   };
>   
> -static uchar __env_get_char_spec(int index)
> +__weak uchar env_get_char_spec(int index)
>   {
>   	return *((uchar *)(gd->env_addr + index));
>   }
> -uchar env_get_char_spec(int)
> -	__attribute__((weak, alias("__env_get_char_spec")));
>   
>   static uchar env_get_char_init(int index)
>   {

signed-off is missing?

Regards,
Jeroen
Wolfgang Denk July 11, 2014, 4:26 a.m. UTC | #2
Dear Jeroen,

In message <1405027670-28516-1-git-send-email-jeroen@myspectrum.nl> you wrote:
>  
> -static uchar __env_get_char_spec(int index)
> +__weak uchar env_get_char_spec(int index)

__weak static ... ?

Best regards,

Wolfgang Denk
Jeroen Hofstee July 11, 2014, 5:16 p.m. UTC | #3
Hello Wolfgang,

On 11-07-14 06:26, Wolfgang Denk wrote:
> Dear Jeroen,
>
> In message <1405027670-28516-1-git-send-email-jeroen@myspectrum.nl> you wrote:
>>   
>> -static uchar __env_get_char_spec(int index)
>> +__weak uchar env_get_char_spec(int index)
> __weak static ... ?

tempting huh, but it is the patch format with tricks
you in thinking that. The weak is actually added to
the function without the leading underscores, a
couple of lines below (which wasn't static and
shouldn't become so).

Regards,
Jeroen
Wolfgang Denk July 11, 2014, 7:14 p.m. UTC | #4
Dear Jeroen Hofstee,

In message <53C01BD7.8030608@myspectrum.nl> you wrote:
> 
> >> -static uchar __env_get_char_spec(int index)
> >> +__weak uchar env_get_char_spec(int index)
> > __weak static ... ?
> 
> tempting huh, but it is the patch format with tricks
> you in thinking that. The weak is actually added to
> the function without the leading underscores, a
> couple of lines below (which wasn't static and
> shouldn't become so).

Argh.  You are right.

Best regards,

Wolfgang Denk
diff mbox

Patch

diff --git a/common/env_common.c b/common/env_common.c
index cd7b4cd..3b979bc 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -27,12 +27,10 @@  struct hsearch_data env_htab = {
 	.change_ok = env_flags_validate,
 };
 
-static uchar __env_get_char_spec(int index)
+__weak uchar env_get_char_spec(int index)
 {
 	return *((uchar *)(gd->env_addr + index));
 }
-uchar env_get_char_spec(int)
-	__attribute__((weak, alias("__env_get_char_spec")));
 
 static uchar env_get_char_init(int index)
 {