Skip to contentSkip to conversation

staging: sm750fb: add necessary #include in sm750_accel.h, sm750_cursor.h

PATCH In review Nam Cao 2 participants 2 messages Mar 18, 2022 – Mar 29, 2022

Subsystems (2)
lore
Share & tools
lore

Nam Cao

author
#0 lore raw

PATCH 1/1 staging: sm750fb: add necessary #include in sm750_accel.h, sm750_cursor.h

In sm750_cursor.h, struct lynx_cursor is used without including the header file where this struct is defined. Similar thing is seen in sm750_accel.h.

The module can still be compiled because there is "#include "sm750.h"" before every "#include "sm750_accel.h"" and "#include "sm750_cursor.h"". However, the order of #include should not affect the ability to compile.

Add "#include "sm750.h"" to sm750_accel.h and sm750_cursor.h.

---
 drivers/staging/sm750fb/sm750_accel.h  | 2 ++
 drivers/staging/sm750fb/sm750_cursor.h | 2 ++
 2 files changed, 4 insertions(+)
drivers/staging/sm750fb/sm750_accel.h +2 -0
index 2c79cb730a0a..fe6ff196272c 100644
@@ -2,6 +2,8 @@
 #ifndef ACCEL_H__
 #define ACCEL_H__
 
+#include "sm750.h"
+
 #define HW_ROP2_COPY 0xc
 #define HW_ROP2_XOR 0x6
 
drivers/staging/sm750fb/sm750_cursor.h +2 -0
index b59643dd61ed..f023b691ac0b 100644
@@ -2,6 +2,8 @@
 #ifndef LYNX_CURSOR_H__
 #define LYNX_CURSOR_H__
 
+#include "sm750.h"
+
 /* hw_cursor_xxx works for voyager,718 and 750 */
 void sm750_hw_cursor_enable(struct lynx_cursor *cursor);
 void sm750_hw_cursor_disable(struct lynx_cursor *cursor);
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 46 lines · Nam Cao

In sm750_cursor.h, struct lynx_cursor is used without including the header file where this struct is defined. Similar thing is seen in sm750_accel.h.

The module can still be compiled because there is "#include "sm750.h"" before every "#include "sm750_accel.h"" and "#include "sm750_cursor.h"". However, the order of #include should not affect the ability to compile.

Add "#include "sm750.h"" to sm750_accel.h and sm750_cursor.h.

---
 drivers/staging/sm750fb/sm750_accel.h  | 2 ++
 drivers/staging/sm750fb/sm750_cursor.h | 2 ++
 2 files changed, 4 insertions(+)
drivers/staging/sm750fb/sm750_accel.h +2 -0
index 2c79cb730a0a..fe6ff196272c 100644
@@ -2,6 +2,8 @@
 #ifndef ACCEL_H__
 #define ACCEL_H__
 
+#include "sm750.h"
+
 #define HW_ROP2_COPY 0xc
 #define HW_ROP2_XOR 0x6
 
drivers/staging/sm750fb/sm750_cursor.h +2 -0
index b59643dd61ed..f023b691ac0b 100644
@@ -2,6 +2,8 @@
 #ifndef LYNX_CURSOR_H__
 #define LYNX_CURSOR_H__
 
+#include "sm750.h"
+
 /* hw_cursor_xxx works for voyager,718 and 750 */
 void sm750_hw_cursor_enable(struct lynx_cursor *cursor);
 void sm750_hw_cursor_disable(struct lynx_cursor *cursor);
Signature · 1 line
2.25.1

I think the current code is fine, given that this is not actually "fixing" anything. If you wish to unwind all of the #include mess in this driver, that would be fine, but I doubt it really is worth it. You really should not need more than 1 .h file for a single module, this one is split up way too much.

thanks,

greg k-h