Skip to contentSkip to conversation

include/linux/rv.h: remove redundant include file

PATCH Superseded Akhilesh Patil 2 participants 5 messages Aug 9, 2025 – Aug 11, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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].

Fixes 24cbfe18d55a ("rv: Merge struct rv_monitor_def into struct rv_monitor") [1]
---
 include/linux/rv.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/rv.h +0 -1
index 14410a42faef..8b968b8ed77b 100644
@@ -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
maintainer
#1 lore raw
2025-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]

---

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
index 14410a42faef..8b968b8ed77b 100644
@@ -15,7 +15,6 @@
 
 #ifdef CONFIG_RV
 #include <linux/bitops.h>
-#include <linux/types.h>
 #include <linux/array_size.h>
 
 /*
--

2.34.1

#2 lore raw
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]

---

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 ?

Agree.

Quoted 9 lines

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

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
index 14410a42faef..8b968b8ed77b 100644
@@ -15,7 +15,6 @@
 
 #ifdef CONFIG_RV
 #include <linux/bitops.h>
-#include <linux/types.h>
 #include <linux/array_size.h>
 
 /*
--

2.34.1

#3 lore raw

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.

Fixes 24cbfe18d55a ("rv: Merge struct rv_monitor_def into struct rv_monitor") [1]
---
 include/linux/rv.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
include/linux/rv.h +2 -4
index 14410a42faef..9520aab34bcb 100644
@@ -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
maintainer Reviewed-by on v2 1/1
#4 lore raw
Quoted 6 lines · Akhilesh Patil

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.

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]

Closes:
https://lore.kernel.org/r/[email protected]/

---
 include/linux/rv.h | 6 ++----

 1 file changed, 2 insertions(+), 4 deletions(-)
include/linux/rv.h +0 -0
index 14410a42faef..9520aab34bcb 100644
@@ -7,16 +7,14 @@
  #ifndef _LINUX_RV_H
  #define _LINUX_RV_H

include/linux/rv.h +0 -3
-#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.