init/main.c: fix sparse warnings: context imbalance
PATCH 1/1 init/main.c: fix sparse warnings: context imbalance
Impact: Attribute function 'init_post' with __releases(...).
Fix this sparse warnings:
init/main.c:805:21: warning: context imbalance in 'init_post' - unexpected unlock init/main.c:899:9: warning: context imbalance in 'kernel_init' - wrong count at exit
--- init/main.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
init/main.c +1 -0
@@ -803,6 +803,7 @@ int initmem_now_dynamic;* makes it inline to init() and it becomes part of init.text section */ static noinline int init_post(void) +__releases (kernel_lock) {/* need to finish all async __init code before freeing the memory */ async_synchronize_full ();
Quoted 3 lines · Hannes Eder
Impact: Attribute function '
init_post' with__releases(...).Fix this sparse warnings:
It is not a fix, it's merely an annotation.
Signature · 3 lines
Stefan Richter -===-=--= --=- =-=- http://arcgraph.de/sr/
Quoted 6 lines · Stefan Richter
Quoted 3 lines · Hannes Eder
Impact: Attribute function '
init_post' with__releases(...).Fix this sparse warnings:
It is not a fix, it's merely an annotation.
This patch 'better word for fix's a warning reported by sparse. What better wording would you suggest?
Thanks, -Hannes
Quoted 6 lines · Hannes Eder
Quoted 1 line · Stefan Richter
It is not a fix, it's merely an annotation.
This patch 'better word for fix's a warning reported by sparse. What better wording would you suggest?
"annotate init_post() as releasing the BKL" or whatever in the title, furthermore "Removes the following sparse warnings: ..." in the changelog.
Signature · 3 lines
Stefan Richter -===-=--= --=- =-=- http://arcgraph.de/sr/
Quoted 9 lines · Stefan Richter
Quoted 5 lines · Hannes Eder
Quoted 1 line · Stefan Richter
It is not a fix, it's merely an annotation.
This patch 'better word for fix's a warning reported by sparse. What better wording would you suggest?
"annotate
init_post()as releasing the BKL" or whatever in the title, furthermore "Removes the following sparse warnings: ..." in the changelog.
PS: In some sense it is indeed a "fix" for the high-level problem that sparse can't guess whether the context imbalance is correct or not. The original warning from sparse was correct in itself. Your annotation enables sparse to warn if problems outside the scope of the single function occur (I guess). So it's more a maintainabiliy improvement than a fix.
Signature · 3 lines
Stefan Richter -===-=--= --=- =-=- http://arcgraph.de/sr/
PATCH v2 1/1 init/main.c: annotate 'init_post' with '__releases(kernel_lock)'
This fixes the following sparse warnings:
init/main.c:805:21: warning: context imbalance in 'init_post' - unexpected unlock init/main.c:899:9: warning: context imbalance in 'kernel_init' - wrong count at exit
--- init/main.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
init/main.c +1 -0
@@ -803,6 +803,7 @@ int initmem_now_dynamic;* makes it inline to init() and it becomes part of init.text section */ static noinline int init_post(void) +__releases (kernel_lock) {/* need to finish all async __init code before freeing the memory */ async_synchronize_full ();