init/Kconfig: fix unmet direct dependencies
PATCH 1/1 init/Kconfig: fix unmet direct dependencies
Commit 3c07bfce92a5 ("proc: make config PROC_CHILDREN depend on PROC_FS") make config PROC_CHILDREN depend on PROC_FS.
When CONFIG_PROC_FS is not set and CONFIG_CHECKPOINT_RESTORE=y, make menuconfig screams like this:
WARNING: unmet direct dependencies detected for PROC_CHILDREN
Depends on [n]: PROC_FS [=n]
Selected by [y]:
- CHECKPOINT_RESTORE [=y]
So add PROC_FS to dependencies to fix this.
--- init/Kconfig | 1 + 1 file changed, 1 insertion(+)
init/Kconfig +1 -0
@@ -1273,6 +1273,7 @@ endif # NAMESPACES config CHECKPOINT_RESTORE bool "Checkpoint/restore support" + select PROC_FS select PROC_CHILDREN select KCMP default n
Signature · 1 line
2.17.1
init/Kconfig endif # NAMESPACES · line 1276
Quoted 7 lines · Ren Zhijie
init/Kconfig +1
-0@@ -1273,6 +1273,7 @@ endif # NAMESPACES config CHECKPOINT_RESTORE bool "Checkpoint/restore support" + select PROC_FS
Couldn't this become a depends?
init/Kconfig endif # NAMESPACES · line 1279
Quoted 3 lines
init/Kconfig +0
-0select PROC_CHILDREN select KCMP default n
Sebastian
Quoted 6 lines · Sebastian Andrzej Siewior
Quoted 4 lines · Ren Zhijie
init/Kconfig +0
-0@@ -1273,6 +1273,7 @@ endif # NAMESPACES
Quoted 6 lines
init/Kconfig endif # NAMESPACES · line 1276
Quoted 3 lines
init/Kconfig +1
-0config CHECKPOINT_RESTORE bool "Checkpoint/restore support" + select PROC_FSCouldn't this become a depends?
It could also be a depends (to resolve the warning).
It is just the question whether:
When PROC_FS is not set, should the CHECKPOINT_RESTORE still be visible as a config option to add (and then automatically add PROC_FS)? Then select is right here.
or:
When PROC_FS is not set, should the CHECKPOINT_RESTORE not be visible as a config option to add? Instead the user first needs to add PROC_FS, then CHECKPOINT_RESTORE becomes visible as an option to add, and then the user can add it. Then depends would be right.
For me, both seem reasonable. So, I assume Ren considered select the better choice.
But maybe Ren can confirm.
A kernel build configuration without PROC_FS is quite special anyway... and then being interested in CHECKPOINT_ RESTORE for such a system is really really special. I wonder if that user then really knows what he or she is configuring at that point.
Lukas
Quoted 27 lines · Lukas Bulwahn
Quoted 10 lines · Sebastian Andrzej Siewior
init/Kconfig endif # NAMESPACES · line 1276
Quoted 7 lines · Ren Zhijie
init/Kconfig +1
-0@@ -1273,6 +1273,7 @@ endif # NAMESPACES config CHECKPOINT_RESTORE bool "Checkpoint/restore support" + select PROC_FSCouldn't this become a depends?
It could also be a depends (to resolve the warning).
It is just the question whether:
When
PROC_FSis not set, should theCHECKPOINT_RESTOREstill be visible as a config option to add (and then automatically addPROC_FS)? Then select is right here.or:
When
PROC_FSis not set, should theCHECKPOINT_RESTOREnot be visible as a config option to add? Instead the user first needs to addPROC_FS, thenCHECKPOINT_RESTOREbecomes visible as an option to add, and then the user can add it. Then depends would be right.
Quoted 4 lines
For me, both seem reasonable. So, I assume Ren considered select the better choice.
But maybe Ren can confirm.
My consider is that if CHECKPOINT_RESTORE depends on PROC_FS , when PROC_FS is not set the user have no chance to set it on.
Thanks,
Ren
Quoted 9 lines
A kernel build configuration without
PROC_FSis quite special anyway... and then being interested inCHECKPOINT_RESTORE for such a system is really really special. I wonder if that user then really knows what he or she is configuring at that point.Lukas
.
.
Quoted 2 lines · Lukas Bulwahn
Quoted 1 line
Couldn't this become a depends?
It could also be a depends (to resolve the warning).
…
Quoted 5 lines
It is just the question whether:
When
PROC_FSis not set, should theCHECKPOINT_RESTOREstill be visible as a config option to add (and then automatically addPROC_FS)? Then select is right here.
then CHECKPOINT_RESTORE is the only option selecting PROC_FS while everyone else depends on it _or_ avoids using it in the absence of PROC_FS.
Sebastian
Quoted 6 lines · Sebastian Andrzej Siewior
Quoted 2 lines · Lukas Bulwahn
Quoted 1 line
Couldn't this become a depends?
It could also be a depends (to resolve the warning).
…
Quoted 2 lines
It is just the question whether:
Quoted 7 lines
Quoted 3 lines
When
PROC_FSis not set, should theCHECKPOINT_RESTOREstill be visible as a config option to add (and then automatically addPROC_FS)? Then select is right here.then
CHECKPOINT_RESTOREis the only option selectingPROC_FSwhile everyone else depends on it _or_ avoids using it in the absence ofPROC_FS.
Right, we should not mix 'select' and 'depends on' for the same symbol, as that leads to circular dependencies and general confusion.
If there is no way to use CHECKPOINT_RESTORE without procfs, then the symbol should just not be visible (it will still show up with the dependency when one searches in menuconfig). Force-enabling a major subsystem like procfs from another symbol is not a good solution.
Arnd
Quoted 20 lines · Arnd Bergmann
Quoted 6 lines · Sebastian Andrzej Siewior
Quoted 2 lines · Lukas Bulwahn
Quoted 1 line
Couldn't this become a depends?
It could also be a depends (to resolve the warning).
…
Quoted 2 lines
It is just the question whether:
Quoted 7 lines
Quoted 3 lines
When
PROC_FSis not set, should theCHECKPOINT_RESTOREstill be visible as a config option to add (and then automatically addPROC_FS)? Then select is right here.then
CHECKPOINT_RESTOREis the only option selectingPROC_FSwhile everyone else depends on it _or_ avoids using it in the absence ofPROC_FS.Right, we should not mix 'select' and 'depends on' for the same symbol, as that leads to circular dependencies and general confusion.
Quoted 6 lines
If there is no way to use
CHECKPOINT_RESTOREwithout procfs, then the symbol should just not be visible (it will still show up with the dependency when one searches in menuconfig). Force-enabling a major subsystem like procfs from another symbol is not a good solution.
Agree. I retract my Reviewed-by.
The arguments are clear to make this depend on PROC_FS.
Lukas
Quoted 17 lines · Arnd Bergmann
Quoted 4 lines · Sebastian Andrzej Siewior
Quoted 2 lines · Lukas Bulwahn
Quoted 1 line
Couldn't this become a depends?
It could also be a depends (to resolve the warning).
…
Quoted 8 lines
Quoted 5 lines
It is just the question whether:
When
PROC_FSis not set, should theCHECKPOINT_RESTOREstill be visible as a config option to add (and then automatically addPROC_FS)? Then select is right here.then
CHECKPOINT_RESTOREis the only option selectingPROC_FSwhile everyone else depends on it _or_ avoids using it in the absence ofPROC_FS.Right, we should not mix 'select' and 'depends on' for the same symbol, as that leads to circular dependencies and general confusion.
Quoted 5 lines
If there is no way to use
CHECKPOINT_RESTOREwithout procfs, then the symbol should just not be visible (it will still show up with the dependency when one searches in menuconfig). Force-enabling a major subsystem like procfs from another symbol is not a good solution.
Agree that, i will fix it in patch v2.
Thanks,
Ren
Quoted 2 lines
Arnd
.
Quoted 7 lines · Ren Zhijie
Commit
3c07bfce92a5("proc: make configPROC_CHILDRENdepend onPROC_FS") make configPROC_CHILDRENdepend onPROC_FS.When
CONFIG_PROC_FSis not set andCONFIG_CHECKPOINT_RESTORE=y, make menuconfig screams like this:
Quoted 8 lines
WARNING: unmet direct dependencies detected for
PROC_CHILDREN
Depends on [n]:PROC_FS[=n]
Selected by [y]:
-CHECKPOINT_RESTORE[=y]So add
PROC_FSto dependencies to fix this.Fixes 3c07bfce92a5 ("proc: make config PROC_CHILDREN depend on PROC_FS")Signed-off-by Ren Zhijie <[email protected]>
This patch here makes sense.
Just some minor addition:
The commit 3c07bfce92a5 ("proc: make config PROC_CHILDREN depend on PROC_FS") is not really broken, but just made the implicit dependencies much more explicit and hence now this warning from menuconfig indicates that.
Before the commit 3c07bfce92a5 ("proc: make config PROC_CHILDREN depend on PROC_FS"):
When CONFIG_PROC_FS is not set and CONFIG_CHECKPOINT_RESTORE=y, then the feature of CONFIG_CHECKPOINT_RESTORE would just not worked (as this would not be any proc fs, and no "proc children" functionality.)
After the commit 3c07bfce92a5 ("proc: make config PROC_CHILDREN depend on PROC_FS"):
When CONFIG_PROC_FS is not set and CONFIG_CHECKPOINT_RESTORE=y, it warns to add PROC_FS to assist in configuring something that makes the feature of CONFIG_CHECKPOINT_RESTORE work.
So this patch is yet another improvement to what the commit 3c07bfce92a5 ("proc: make config PROC_CHILDREN depend on PROC_FS") already partially improved. However, feel free to keep the Fixes-tag in this patch, as this patch certainly improves handling of what the commit 3c07bfce92a5 started improving.
The recipient list is a bit "random" (coincidental). You could have probably just sent this patch to Andrew Morton, me and linux-kernel mailing list.
Lukas
Quoted 19 lines
--- init/Kconfig | 1 + 1 file changed, 1 insertion(+)init/Kconfig +1
-1@@ -1273,6 +1273,7 @@ endif # NAMESPACES config CHECKPOINT_RESTORE bool "Checkpoint/restore support" + select PROC_FS select PROC_CHILDREN select KCMP default n --2.17.1