diff mbox series

[2/7] kbuild: touch autoksyms.h when it is really missing

Message ID 1521045861-22418-3-git-send-email-yamada.masahiro@socionext.com
State New
Headers show
Series kbuild: various fix, clean-up, improvements of CONFIG_TRIM_UNUSED_KSYMS | expand

Commit Message

Masahiro Yamada March 14, 2018, 4:44 p.m. UTC
From the comment, I expect this code creates autoksyms.h in case it
is missing, but it actually touches it when it does exists.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

---

I do not know when this code is useful...

If autoksyms.h were missing, build should have already failed because
include/{linux,asm-generic}/export.h need it.

Maybe for standalone test?
Or, in order to make this script self-contained?


 scripts/adjust_autoksyms.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.7.4

Comments

Nicolas Pitre March 14, 2018, 5:26 p.m. UTC | #1
On Thu, 15 Mar 2018, Masahiro Yamada wrote:

> From the comment, I expect this code creates autoksyms.h in case it

> is missing, but it actually touches it when it does exists.


Oops, indeed.

> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

> ---

> 

> I do not know when this code is useful...

> 

> If autoksyms.h were missing, build should have already failed because

> include/{linux,asm-generic}/export.h need it.

> 

> Maybe for standalone test?

> Or, in order to make this script self-contained?


I agree it isn't very useful. Proof: it was wrong and wouldn't have 
worked as intended. So the best fix might be to simply remove that line.



> 

> 

>  scripts/adjust_autoksyms.sh | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/scripts/adjust_autoksyms.sh b/scripts/adjust_autoksyms.sh

> index 513da1a..a52210b 100755

> --- a/scripts/adjust_autoksyms.sh

> +++ b/scripts/adjust_autoksyms.sh

> @@ -49,7 +49,7 @@ case "${KCONFIG_CONFIG}" in

>  esac

>  

>  # In case it doesn't exist yet...

> -if [ -e "$cur_ksyms_file" ]; then touch "$cur_ksyms_file"; fi

> +if [ ! -e "$cur_ksyms_file" ]; then touch "$cur_ksyms_file"; fi

>  

>  # Generate a new ksym list file with symbols needed by the current

>  # set of modules.

> -- 

> 2.7.4

> 

>
Masahiro Yamada March 15, 2018, 6:26 a.m. UTC | #2
2018-03-15 2:26 GMT+09:00 Nicolas Pitre <nicolas.pitre@linaro.org>:
> On Thu, 15 Mar 2018, Masahiro Yamada wrote:

>

>> From the comment, I expect this code creates autoksyms.h in case it

>> is missing, but it actually touches it when it does exists.

>

> Oops, indeed.

>

>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

>> ---

>>

>> I do not know when this code is useful...

>>

>> If autoksyms.h were missing, build should have already failed because

>> include/{linux,asm-generic}/export.h need it.

>>

>> Maybe for standalone test?

>> Or, in order to make this script self-contained?

>

> I agree it isn't very useful. Proof: it was wrong and wouldn't have

> worked as intended. So the best fix might be to simply remove that line.

>


OK, I will remove the code.




-- 
Best Regards
Masahiro Yamada
diff mbox series

Patch

diff --git a/scripts/adjust_autoksyms.sh b/scripts/adjust_autoksyms.sh
index 513da1a..a52210b 100755
--- a/scripts/adjust_autoksyms.sh
+++ b/scripts/adjust_autoksyms.sh
@@ -49,7 +49,7 @@  case "${KCONFIG_CONFIG}" in
 esac
 
 # In case it doesn't exist yet...
-if [ -e "$cur_ksyms_file" ]; then touch "$cur_ksyms_file"; fi
+if [ ! -e "$cur_ksyms_file" ]; then touch "$cur_ksyms_file"; fi
 
 # Generate a new ksym list file with symbols needed by the current
 # set of modules.