include/linux/rv.h: remove redundant include file
Subsystems (2)
PATCH 1/1 include/linux/rv.h: remove redundant include file
Remove redundant include <linux/types.h> to clean up the code. Fix this redundancy introduced by commit [1].
--- include/linux/rv.h | 1 - 1 file changed, 1 deletion(-)
include/linux/rv.h +0 -1
@@ -15,7 +15,6 @@#ifdef CONFIG_RV #include <linux/bitops.h> -#include <linux/types.h> #include <linux/array_size.h> /*
Signature · 1 line
2.34.1
Gabriele Monaco
maintainer2025-08-09T06:36:58Z Akhilesh Patil <[email protected]>:
Quoted 8 lines
Remove redundant include <
linux/types.h> to clean up the code. Fix this redundancy introduced by commit [1].Fixes 24cbfe18d55a ("rv: Merge struct rv_monitor_def into struct rv_monitor") [1]Reported-by kernel test robot <[email protected]>Signed-off-by Akhilesh Patil <[email protected]>---
Thanks for the patch!
I'm really being picky here, but, since you're touching this, isn't it cleaner to keep all includes inside ifdef CONFIG_RV ? When CONFIG_RV is not enabled, the header only defines constants so it doesn't need other includes.
This would mean you could remove the other #include <linux/types.h>, instead, and move the #include <linux/list.h> down.
I think you can keep the Fixes: tag and make clear the reason for cleanup in the commit message.
Thanks,
Gabriele
Quoted 17 lines
include/linux/rv.h| 1 -1 file changed, 1 deletion(-)include/linux/rv.h +0
-2@@ -15,7 +15,6 @@#ifdef CONFIG_RV #include <linux/bitops.h> -#include <linux/types.h> #include <linux/array_size.h> /* -- 2.34.1
Quoted 5 lines · Gabriele Monaco
2025-08-09T06:36:58Z Akhilesh Patil <[email protected]>:Quoted 3 lines
Remove redundant include <
linux/types.h> to clean up the code. Fix this redundancy introduced by commit [1].
Quoted 8 lines
Quoted 5 lines
Fixes 24cbfe18d55a ("rv: Merge struct rv_monitor_def into struct rv_monitor") [1]Reported-by kernel test robot <[email protected]>Signed-off-by Akhilesh Patil <[email protected]>---
Thanks for the patch!
I'm really being picky here, but, since you're touching this, isn't it cleaner to keep all includes inside ifdefCONFIG_RV?
Agree.
Quoted 9 lines
When
CONFIG_RVis not enabled, the header only defines constants so it doesn't need other includes.This would mean you could remove the other #include <
linux/types.h>, instead, and move the #include <linux/list.h> down.I think you can keep the Fixes: tag and make clear the reason for cleanup in the commit message.
Thanks,
Gabriele
Thanks for the review.
I have shared v2 addressing these comments and additional cleanup.
Regards,
Akhilesh
Quoted 18 lines
Quoted 17 lines
include/linux/rv.h| 1 -1 file changed, 1 deletion(-)include/linux/rv.h +0
-2@@ -15,7 +15,6 @@#ifdef CONFIG_RV #include <linux/bitops.h> -#include <linux/types.h> #include <linux/array_size.h> /* -- 2.34.1
PATCH v2 1/1 include/linux/rv.h: remove redundant include file
Remove redundant include <linux/types.h> to clean up the code. Move all unique include files inside CONFIG_RV as they are only needed when CONFIG_RV is enabled. Arrange include files alphabetically.
--- include/linux/rv.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
include/linux/rv.h +2 -4
@@ -7,16 +7,14 @@#ifndef _LINUX_RV_H#define _LINUX_RV_H -#include <linux/types.h> -#include <linux/list.h> -#define MAX_DA_NAME_LEN 32#define MAX_DA_RETRY_RACING_EVENTS 3#ifdef CONFIG_RV +#include <linux/array_size.h> #include <linux/bitops.h> +#include <linux/list.h> #include <linux/types.h> -#include <linux/array_size.h> /* * Deterministic automaton per-object variables.
Signature · 1 line
2.34.1
Quoted 6 lines · Akhilesh Patil
Remove redundant include <
linux/types.h> to clean up the code. Move all unique include files insideCONFIG_RVas they are only needed whenCONFIG_RVis enabled.Arrange include files alphabetically.
That is usually not necessary. Also, it shouldn't happen, but sometimes the order of inclusion matters. Anyway this isn't the case here (builds fine locally) and when it is, the test robot should notice.
Looks good to me overall, thanks!
Quoted 34 lines
Fixes 24cbfe18d55a ("rv: Merge struct rv_monitor_def into struct
rv_monitor") [1]Reported-by kernel test robot <[email protected]>Closes:
https://lore.kernel.org/r/[email protected]/Signed-off-by Akhilesh Patil <[email protected]>---
include/linux/rv.h | 6 ++----1 file changed, 2 insertions(+), 4 deletions(-)include/linux/rv.h +0
-0@@ -7,16 +7,14 @@ #ifndef _LINUX_RV_H #define _LINUX_RV_Hinclude/linux/rv.h +0
-3-#include <linux/types.h> -#include <linux/list.h> -#define
MAX_DA_NAME_LEN32
#defineMAX_DA_RETRY_RACING_EVENTS3
#ifdefCONFIG_RV
+#include <linux/array_size.h>
#include <linux/bitops.h>
+#include <linux/list.h>
#include <linux/types.h>
-#include <linux/array_size.h>
/*
* Deterministic automaton per-object variables.