lib/tst_kconfig.c: Add any kconfig to match the expected value function
PATCH v4 1/4 lib/tst_kconfig.c: Add any kconfig to match the expected value function
Example: CONFIG_X86_INTEL_UMIP=y for umip kconfig before and v5.4
mainline kernel.
CONFIG_X86_UMIP=y for umip kconfig after v5.5 mainline kernel.
Format: CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y
--- lib/tst_kconfig.c | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-)
lib/tst_kconfig.c +23 -13
@@ -167,7 +167,8 @@ void tst_kconfig_read(const char *const *kconfigs,struct match matches[cnt];FILE *fp;unsigned int i, j; -char buf[1024 ]; +char buf[1024 ], kconfig_multi[100 ]; +char *kconfig_token =NULL , *p_left =NULL ;for (i =0 ; i < cnt; i++) {const char *val =strchr (kconfigs[i],'=' );
@@ -176,12 +177,9 @@ void tst_kconfig_read(const char *const *kconfigs,tst_brk (TBROK ,"Invalid config string '%s'" , kconfigs[i]); matches[i].match =0 ; - matches[i].len =strlen (kconfigs[i]); -if (val) { +if (val) matches[i].val = val +1 ; - matches[i].len -=strlen (val); - } results[i].match =0 ; results[i].value =NULL ;
@@ -193,17 +191,29 @@ void tst_kconfig_read(const char *const *kconfigs,while (fgets (buf,sizeof (buf), fp)) {for (i =0 ; i < cnt; i++) { -if (match (&matches[i], kconfigs[i], &results[i], buf)) { -for (j =0 ; j < cnt; j++) { -if (matches[j].match) -break ; +memset (kconfig_multi,0 ,sizeof (kconfig_multi)); +/* strtok_r will split kconfigs[i] to multi string, so copy it */ +memcpy (kconfig_multi, kconfigs[i],strlen (kconfigs[i])); + kconfig_token =strtok_r (kconfig_multi,"|=" , &p_left); + +while (kconfig_token !=NULL ) { +if (strncmp ("CONFIG_" , kconfig_token,7 )) +tst_brk (TBROK ,"Invalid config string '%s'" , kconfig_token); + matches[i].len =strlen (kconfig_token); +if (match (&matches[i], kconfig_token, &results[i], buf)) { +for (j =0 ; j < cnt; j++) { +if (matches[j].match) +break ; + } } - -if (j == cnt) - goto exit; + kconfig_token =strtok_r (NULL ,"|=" , &p_left); +/* avoid to use after "=" string */ +if (strlen (p_left) ==0 ) +break ; } +if (j == cnt) + goto exit; } - } exit:
Signature · 1 line
2.14.1
PATCH v4 2/4 umip_basic_test.c: improve kconfig check to avoid umip wrong abort case
From v5.5 main line, umip kconfig changed from "CONFIG_X86_INTEL_UMIP=y" to "CONFIG_X86_UMIP=y".
We could use "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" to check kconfig CONFIG_X86_INTEL_UMIP=y(old kernel) or CONFIG_X86_UMIP=y(new kernel) for umip.
--- testcases/kernel/security/umip/umip_basic_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/security/umip/umip_basic_test.c +1 -1
@@ -171,7 +171,7 @@ static struct tst_test test = { .forks_child = 1, .test = verify_umip_instruction, .needs_kconfigs = (const char *[]){ -"CONFIG_X86_INTEL_UMIP=y" , +"CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" ,NULL }, .needs_root = 1,
Signature · 1 line
2.14.1
PATCH v4 3/4 lib: add any kconfig to match the expected value function into kconfig test
In reply to Pengfei Xuconfig01/02/03/04 should be passed for UMIP kconfig All cases in config05 should be failed.
--- lib/newlib_tests/config01 | 1 + lib/newlib_tests/config02 | 1 + lib/newlib_tests/config03 | 1 + lib/newlib_tests/config04 | 1 + lib/newlib_tests/config05 | 2 ++ lib/newlib_tests/test_kconfig.c | 1 + 6 files changed, 7 insertions(+)
lib/newlib_tests/config01 +1 -0
@@ -2,3 +2,4 @@ CONFIG_MMU=y CONFIG_EXT4_FS=m CONFIG_PGTABLE_LEVELS=4 +CONFIG_X86_UMIP=y
lib/newlib_tests/config02 +1 -0
@@ -2,3 +2,4 @@ # CONFIG_MMU is not set CONFIG_EXT4_FS=m CONFIG_PGTABLE_LEVELS=4 +CONFIG_X86_INTEL_UMIP=y
lib/newlib_tests/config03 +1 -0
@@ -2,3 +2,4 @@ CONFIG_MMU=y CONFIG_EXT4_FS=m CONFIG_PGTABLE_LEVELS=44 +CONFIG_X86_UMIP=y
lib/newlib_tests/config04 +1 -0
@@ -1,4 +1,5 @@ # Unexpected CONFIG_EXT4_FS compiled in CONFIG_MMU=y CONFIG_EXT4_FS=y +CONFIG_X86_INTEL_UMIP=y CONFIG_PGTABLE_LEVELS=4
lib/newlib_tests/config05 +2 -0
@@ -1,3 +1,5 @@ # Everything is wrong CONFIG_EXT4_FS=y CONFIG_PGTABLE_LEVELS=44 +CONFIG_X86_UMI=y +CONFIG_X86_INT_UMIP=y
lib/newlib_tests/test_kconfig.c +1 -0
@@ -14,6 +14,7 @@ static const char *kconfigs[] = {"CONFIG_MMU" ,"CONFIG_EXT4_FS=m" ,"CONFIG_PGTABLE_LEVELS=4" , +"CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" , NULL };
Signature · 1 line
2.14.1
PATCH v4 4/4 lib: add any kconfig to match the expected value function document
In reply to Pengfei Xu--- doc/test-writing-guidelines.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
doc/test-writing-guidelines.txt +3 -1
@@ -1590,7 +1590,9 @@ aborted with 'TCONF' if any of the required options were not set. #include "tst_test.h" static const char *kconfigs[] = { - "CONFIG_X86_INTEL_UMIP", + "CONFIG_EXT4_FS=y", + "CONFIG_MMU", + "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y", NULL };
Signature · 1 line
2.14.1
PATCH v4 4/4 lib: add any kconfig to match the expected value function document
Hi Pengfei
doc/test-writing-guidelines.txt aborted with 'TCONF' if any of the required options were not set.
Quoted 10 lines · Pengfei Xu
Signed-off-by Pengfei Xu <[email protected]>--- doc/test-writing-guidelines.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)doc/test-writing-guidelines.txt +0
-0@@ -1590,7 +1590,9 @@ aborted with 'TCONF' if any of the required options were not set.
Before your patch, I know we can use the following two formats kconfigs CONFIG_ACONFIG_A=y/m/v
after your patch set, we can use the following three formats kconfigs CONFIG_ACONFIG_A=y/m/v
CONFIG_A|CONFIGB=y/m/v
As the usual extend logic, we think CONFIGA|CONFIGB is also ok. But in fact, we use "|" or "=" to delim string. So we can't parse CONFIGA|CONFIGB correctly. So, if we can tell user or developer about this in here, it will be better.
ps: we can add configA| config B test in your third patch.
Kind Regards
Yang Xu
Quoted 11 lines
doc/test-writing-guidelines.txt +3
-1#include "tst_test.h" static const char *kconfigs[] = { - "CONFIG_X86_INTEL_UMIP", + "CONFIG_EXT4_FS=y", + "CONFIG_MMU", + "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y", NULL };
PATCH v4 4/4 lib: add any kconfig to match the expected value function document
Hi Xu,
Quoted 26 lines · Yang Xu
Hi Pengfei
doc/test-writing-guidelines.txt aborted with 'TCONF' if any of the required options were not set.
Quoted 10 lines · Pengfei Xu
Signed-off-by Pengfei Xu <[email protected]>--- doc/test-writing-guidelines.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)doc/test-writing-guidelines.txt +0
-0@@ -1590,7 +1590,9 @@ aborted with 'TCONF' if any of the required options were not set.Before your patch, I know we can use the following two formats kconfigs
CONFIG_ACONFIG_A=y/m/v
after your patch set, we can use the following three formats kconfigsCONFIG_ACONFIG_A=y/m/v
CONFIG_A|CONFIGB=y/m/v
As the usual extend logic, we think CONFIGA|CONFIGB is also ok. But in fact, we use "|" or "=" to delim string. So we can't parse CONFIGA|CONFIGB correctly. So, if we can tell user or developer about this in here, it will be better.
Quoted 2 lines
ps: we can add configA| config B test in your third patch.
Actually present patch could support CONFIG_A|CONFIG_B style, and it works
well, you could change "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" to "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" in test_kconfig.c and have a try. : )
Thanks!
Quoted 13 lines
Kind Regards
Yang XuQuoted 9 lines
doc/test-writing-guidelines.txt +3
-1#include "tst_test.h" static const char *kconfigs[] = { - "CONFIG_X86_INTEL_UMIP", + "CONFIG_EXT4_FS=y", + "CONFIG_MMU", + "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y", NULL };
PATCH v4 4/4 lib: add any kconfig to match the expected value function document
Hi Pengfei
Quoted 30 lines
Hi Xu,
Quoted 26 lines · Yang Xu
Hi Pengfei
doc/test-writing-guidelines.txt aborted with 'TCONF' if any of the required options were not set.
Quoted 10 lines · Pengfei Xu
Signed-off-by Pengfei Xu <[email protected]>--- doc/test-writing-guidelines.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)doc/test-writing-guidelines.txt +0
-0@@ -1590,7 +1590,9 @@ aborted with 'TCONF' if any of the required options were not set.Before your patch, I know we can use the following two formats kconfigs
CONFIG_ACONFIG_A=y/m/v
after your patch set, we can use the following three formats kconfigsCONFIG_ACONFIG_A=y/m/v
CONFIG_A|CONFIGB=y/m/v
As the usual extend logic, we think CONFIGA|CONFIGB is also ok. But in fact, we use "|" or "=" to delim string. So we can't parse CONFIGA|CONFIGB correctly. So, if we can tell user or developer about this in here, it will be better.
Quoted 5 lines
Quoted 2 lines
ps: we can add configA| config B test in your third patch.
Actually present patch could support CONFIG_A|CONFIG_B style, and it works
well, you could change "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" to "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" intest_kconfig.cand have a try. : )
"CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" is useful because CONFIG_X86_INTEL_UMIP is in our kernel configs . If you use "CONFIG_X86_UMIP|CONFIG_X86_INTEL_UMIP", it will report error.
Kind Regards
Yang Xu
Quoted 17 lines
Thanks!
Quoted 13 lines
Kind Regards
Yang XuQuoted 9 lines
doc/test-writing-guidelines.txt +3
-1#include "tst_test.h" static const char *kconfigs[] = { - "CONFIG_X86_INTEL_UMIP", + "CONFIG_EXT4_FS=y", + "CONFIG_MMU", + "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y", NULL };
PATCH v4 4/4 lib: add any kconfig to match the expected value function document
Hi Xu,
Thanks for your comment.
I will try to fix it and send the patch.
Thanks!
BR.
Quoted 61 lines · Yang Xu
Hi Pengfei
Quoted 30 lines
Hi Xu,
Quoted 26 lines · Yang Xu
Hi Pengfei
doc/test-writing-guidelines.txt aborted with 'TCONF' if any of the required options were not set.
Quoted 10 lines · Pengfei Xu
Signed-off-by Pengfei Xu <[email protected]>--- doc/test-writing-guidelines.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)doc/test-writing-guidelines.txt +0
-0@@ -1590,7 +1590,9 @@ aborted with 'TCONF' if any of the required options were not set.Before your patch, I know we can use the following two formats kconfigs
CONFIG_ACONFIG_A=y/m/v
after your patch set, we can use the following three formats kconfigsCONFIG_ACONFIG_A=y/m/v
CONFIG_A|CONFIGB=y/m/v
As the usual extend logic, we think CONFIGA|CONFIGB is also ok. But in fact, we use "|" or "=" to delim string. So we can't parse CONFIGA|CONFIGB correctly. So, if we can tell user or developer about this in here, it will be better.Quoted 5 lines
Quoted 2 lines
ps: we can add configA| config B test in your third patch.
Actually present patch could support CONFIG_A|CONFIG_B style, and it works
well, you could change "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" to "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" intest_kconfig.cand have a try. : )"CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" is useful because
CONFIG_X86_INTEL_UMIPis in our kernel configs . If you use "CONFIG_X86_UMIP|CONFIG_X86_INTEL_UMIP", it will report error.Kind Regards
Yang XuQuoted 17 lines
Thanks!
Quoted 13 lines
Kind Regards
Yang XuQuoted 9 lines
doc/test-writing-guidelines.txt +3
-1#include "tst_test.h" static const char *kconfigs[] = { - "CONFIG_X86_INTEL_UMIP", + "CONFIG_EXT4_FS=y", + "CONFIG_MMU", + "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y", NULL };
PATCH v4 4/4 lib: add any kconfig to match the expected value function document
In reply to Yang XuHi Xu,
Due to memory copy, there is some bit and display issue in last string.
So for your question, for CONFIG_A|CONFIG_B without expect value, maybe y or m.
We could add it with below style:
"CONFIG_A|CONFIG_B|NA", and add it into guidelines, NA will not be solved, actually you could fill with any string after last '|'.
Is it ok?
Thanks!
Quoted 46 lines · Yang Xu
Hi Pengfei
Quoted 15 lines
Hi Xu,
Quoted 12 lines
Before your patch, I know we can use the following two formats kconfigs
CONFIG_ACONFIG_A=y/m/v
after your patch set, we can use the following three formats kconfigsCONFIG_ACONFIG_A=y/m/v
CONFIG_A|CONFIGB=y/m/v
As the usual extend logic, we think CONFIGA|CONFIGB is also ok. But in fact, we use "|" or "=" to delim string. So we can't parse CONFIGA|CONFIGB correctly. So, if we can tell user or developer about this in here, it will be better.Quoted 5 lines
Quoted 2 lines
ps: we can add configA| config B test in your third patch.
Actually present patch could support CONFIG_A|CONFIG_B style, and it works
well, you could change "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" to "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" intest_kconfig.cand have a try. : )"CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" is useful because
CONFIG_X86_INTEL_UMIPis in our kernel configs . If you use "CONFIG_X86_UMIP|CONFIG_X86_INTEL_UMIP", it will report error.Kind Regards
Yang XuQuoted 17 lines
Thanks!
Quoted 13 lines
Kind Regards
Yang XuQuoted 9 lines
#include "tst_test.h" static const char *kconfigs[] = {doc/test-writing-guidelines.txt +3
-1- "CONFIG_X86_INTEL_UMIP", + "CONFIG_EXT4_FS=y", + "CONFIG_MMU", + "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y", NULL };
PATCH v4 4/4 lib: add any kconfig to match the expected value function document
Hi Pengfei
Quoted 9 lines
Hi Xu,
Due to memory copy, there is some bit and display issue in last string.So for your question, for CONFIG_A|CONFIG_B without expect value, maybe y or m.
We could add it with below style:
"CONFIG_A|CONFIG_B|NA", and add it into guidelines, NA will not be solved, actually you could fill with any string after last '|'.
Is it ok?
It sounds reasonable. I think it is ok.
Kind Regards
Yang Xu
Quoted 52 lines
Thanks!
Quoted 46 lines · Yang Xu
Hi Pengfei
Quoted 15 lines
Hi Xu,
Quoted 12 lines
Before your patch, I know we can use the following two formats kconfigs
CONFIG_ACONFIG_A=y/m/v
after your patch set, we can use the following three formats kconfigsCONFIG_ACONFIG_A=y/m/v
CONFIG_A|CONFIGB=y/m/v
As the usual extend logic, we think CONFIGA|CONFIGB is also ok. But in fact, we use "|" or "=" to delim string. So we can't parse CONFIGA|CONFIGB correctly. So, if we can tell user or developer about this in here, it will be better.Quoted 5 lines
Quoted 2 lines
ps: we can add configA| config B test in your third patch.
Actually present patch could support CONFIG_A|CONFIG_B style, and it works
well, you could change "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" to "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" intest_kconfig.cand have a try. : )"CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" is useful because
CONFIG_X86_INTEL_UMIPis in our kernel configs . If you use "CONFIG_X86_UMIP|CONFIG_X86_INTEL_UMIP", it will report error.Kind Regards
Yang XuQuoted 17 lines
Thanks!
Quoted 13 lines
Kind Regards
Yang XuQuoted 9 lines
#include "tst_test.h" static const char *kconfigs[] = {doc/test-writing-guidelines.txt +3
-1- "CONFIG_X86_INTEL_UMIP", + "CONFIG_EXT4_FS=y", + "CONFIG_MMU", + "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y", NULL };
Xu
PATCH v4 4/4 lib: add any kconfig to match the expected value function document
Thanks Xu! :)
BR.
Quoted 65 lines
? 2019?12?20??15:20?Yang Xu <[email protected]> ???
?Hi Pengfei
Quoted 8 lines
Hi Xu,
Due to memory copy, there is some bit and display issue in last string. So for your question, for CONFIG_A|CONFIG_B without expect value, maybe y or m.
We could add it with below style:
"CONFIG_A|CONFIG_B|NA", and add it into guidelines, NA will not be solved, actually you could fill with any string after last '|'.
Is it ok?It sounds reasonable. I think it is ok.
Kind Regards
Yang XuQuoted 48 lines
Thanks!
Quoted 47 lines · Yang Xu
Hi Pengfei
Quoted 15 lines
Hi Xu,
Quoted 12 lines
Before your patch, I know we can use the following two formats kconfigs
CONFIG_ACONFIG_A=y/m/v
after your patch set, we can use the following three formats kconfigsCONFIG_ACONFIG_A=y/m/v
CONFIG_A|CONFIGB=y/m/v
As the usual extend logic, we think CONFIGA|CONFIGB is also ok. But in fact, we use "|" or "=" to delim string. So we can't parse CONFIGA|CONFIGB correctly. So, if we can tell user or developer about this in here, it will be better.Quoted 5 lines
Quoted 2 lines
ps: we can add configA| config B test in your third patch.
Actually present patch could support CONFIG_A|CONFIG_B style, and it works
well, you could change "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" to "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" intest_kconfig.cand have a try. : )"CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" is useful because
CONFIG_X86_INTEL_UMIPis in our kernel configs . If you use "CONFIG_X86_UMIP|CONFIG_X86_INTEL_UMIP", it will report error.Kind Regards
Yang XuQuoted 17 lines
Thanks!
Quoted 13 lines
Kind Regards
Yang XuQuoted 9 lines
#include "tst_test.h" static const char *kconfigs[] = {doc/test-writing-guidelines.txt +3
-1- "CONFIG_X86_INTEL_UMIP", + "CONFIG_EXT4_FS=y", + "CONFIG_MMU", + "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y", NULL };
PATCH v4 1/4 lib/tst_kconfig.c: Add any kconfig to match the expected value function
In reply to Pengfei XuHi Pengfei
This patch set looks good to me, only a samll comment.
Quoted 53 lines · Pengfei Xu
Example:
CONFIG_X86_INTEL_UMIP=yfor umip kconfig before and v5.4
mainline kernel.
CONFIG_X86_UMIP=yfor umip kconfig after v5.5 mainline kernel.
Format: CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=ySigned-off-by Pengfei Xu <[email protected]>--- lib/tst_kconfig.c | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-)lib/tst_kconfig.c +10
-9@@ -167,7 +167,8 @@ void tst_kconfig_read(const char *const *kconfigs,struct match matches[cnt];FILE *fp;unsigned int i, j; -char buf[1024 ]; +char buf[1024 ], kconfig_multi[100 ]; +char *kconfig_token =NULL , *p_left =NULL ;for (i =0 ; i < cnt; i++) {const char *val =strchr (kconfigs[i],'=' );@@ -176,12 +177,9 @@ void tst_kconfig_read(const char *const *kconfigs,tst_brk (TBROK ,"Invalid config string '%s'" , kconfigs[i]); matches[i].match =0 ; - matches[i].len =strlen (kconfigs[i]); -if (val) { +if (val) matches[i].val = val +1 ; - matches[i].len -=strlen (val); - } results[i].match =0 ; results[i].value =NULL ;@@ -193,17 +191,29 @@ void tst_kconfig_read(const char *const *kconfigs,while (fgets (buf,sizeof (buf), fp)) {for (i =0 ; i < cnt; i++) { -if (match (&matches[i], kconfigs[i], &results[i], buf)) { -for (j =0 ; j < cnt; j++) { -if (matches[j].match) -break ; +memset (kconfig_multi,0 ,sizeof (kconfig_multi)); +/* strtok_r will split kconfigs[i] to multi string, so copy it */ +memcpy (kconfig_multi, kconfigs[i],strlen (kconfigs[i])); + kconfig_token =strtok_r (kconfig_multi,"|=" , &p_left); + +while (kconfig_token !=NULL ) { +if (strncmp ("CONFIG_" , kconfig_token,7 ))
lib/tst_kconfig.c void tst_kconfig_read(const char *const *kconfigs, · line 202
Quoted 10 lines
lib/tst_kconfig.c +7
-2+tst_brk (TBROK ,"Invalid config string '%s'" , kconfig_token); + matches[i].len =strlen (kconfig_token); +if (match (&matches[i], kconfig_token, &results[i], buf)) { +for (j =0 ; j < cnt; j++) { +if (matches[j].match) +break ; + } } - -if (j == cnt)
It will report ?j? may be used uninitialized in this function when compile. But I think it can be modified by maintainer when it is merged.
Quoted 14 lines
lib/tst_kconfig.c +6
-2- goto exit; + kconfig_token =strtok_r (NULL ,"|=" , &p_left); +/* avoid to use after "=" string */ +if (strlen (p_left) ==0 ) +break ; } +if (j == cnt) + goto exit; } - } exit:
PATCH v4 1/4 lib/tst_kconfig.c: Add any kconfig to match the expected value function
Hi Xu,
Thanks for your advice!
I will send the new patch to solve the warning.
Thanks!
BR.
Quoted 44 lines · Yang Xu
Hi Pengfei
This patch set looks good to me, only a samll comment.
Reviewed-by Yang Xu <[email protected]>Quoted 15 lines · Pengfei Xu
Example:
CONFIG_X86_INTEL_UMIP=yfor umip kconfig before and v5.4
mainline kernel.
CONFIG_X86_UMIP=yfor umip kconfig after v5.5 mainline kernel.
Format: CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=ySigned-off-by Pengfei Xu <[email protected]>--- lib/tst_kconfig.c | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-)lib/tst_kconfig.c +0
-0lib/tst_kconfig.c void tst_kconfig_read(const char *const *kconfigs, · line 170
Quoted 6 lines
lib/tst_kconfig.c +2
-2@@ -167,7 +167,8 @@ void tst_kconfig_read(const char *const *kconfigs,struct match matches[cnt]; +break ; + } } - -if (j == cnt)It will report ?j? may be used uninitialized in this function when compile. But I think it can be modified by maintainer when it is merged.
Quoted 13 lines
lib/tst_kconfig.c +6
-2- goto exit; + kconfig_token =strtok_r (NULL ,"|=" , &p_left); +/* avoid to use after "=" string */ +if (strlen (p_left) ==0 ) +break ; } +if (j == cnt) + goto exit; } - } exit: