Skip to contentSkip to conversation

rtl8150: Check if RSR is already defined

PATCH In review Nick Krause 2 participants 2 messages Aug 7, 2014

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

PATCH 1/1 rtl8150: Check if RSR is already defined

I am getting the following warn

drivers/net/usb/rtl8150.c:30:0: warning: "RSR" redefined arch/xtensa/include/asm/processor.h:189:0: note: this is the location of the previous definition

I wanted to remove RSR as it is not being used but it is not clear if being used for documenting purpose. undefining should be enough.

---
 drivers/net/usb/rtl8150.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/usb/rtl8150.c +4 -0
index 6e87e57..7d9a6ba 100644
@@ -21,6 +21,10 @@
 #define DRIVER_AUTHOR "Petko Manolov <[email protected]>"
 #define DRIVER_DESC "rtl8150 based usb-ethernet driver"
 
+#ifdef RSR
+#undef RSR
+#endif
+
 #define	IDR			0x0120
 #define	MAR			0x0126
 #define	CR			0x012e
Signature · 1 line
2.0.1
maintainer
#1 lore raw

From: Nick Krause <[email protected]>
Date: Thu, 7 Aug 2014 07:24:54 +0200

Quoted 9 lines

I am getting the following warn

drivers/net/usb/rtl8150.c:30:0: warning: "RSR" redefined arch/xtensa/include/asm/processor.h:189:0: note: this is the location of the previous definition

I wanted to remove RSR as it is not being used but it is not clear if being used for documenting purpose. undefining should be enough.

This isn't the right way to fix this.

Rather, the thing to do is to give the macros in this driver an appropriate prefix such as "RTL8150_" so that they don't collide with things in the global namespace.