Skip to contentSkip to conversation

staging: emxx_udc: Remove unused code

PATCH In review John B. Wyatt IV 3 participants 4 messages Apr 2, 2020 – Apr 3, 2020 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: emxx_udc: Remove unused code

Remove unused code surrounded by an #if 0 block.

Code has not been altered since 2014 as reported by git blame.

Reported by checkpatch.

---
 drivers/staging/emxx_udc/emxx_udc.h | 6 ------
 1 file changed, 6 deletions(-)
drivers/staging/emxx_udc/emxx_udc.h +0 -6
index 9c2671cb32f7..bbfebe331033 100644
@@ -9,12 +9,6 @@
 #define _LINUX_EMXX_H
 
 /*---------------------------------------------------------------------------*/
-/*----------------- Default undef */
-#if 0
-#define DEBUG
-#define UDC_DEBUG_DUMP
-#endif
-
 /*----------------- Default define */
 #define	USE_DMA	1
 #define USE_SUSPEND_WAIT	1
Signature · 1 line
2.25.1
#1 lore raw
Quoted 18 lines · On Wed, 1 Apr 2020 19:17:06 -0700 "John B. Wyatt IV" <[email protected]>…

Remove unused code surrounded by an #if 0 block.

Code has not been altered since 2014 as reported by git blame.

Reported by checkpatch.

---
 drivers/staging/emxx_udc/emxx_udc.h | 6 ------
 1 file changed, 6 deletions(-)
drivers/staging/emxx_udc/emxx_udc.h +0 -0
index 9c2671cb32f7..bbfebe331033 100644
@@ -9,12 +9,6 @@
 #define _LINUX_EMXX_H
 

drivers/staging/emxx_udc/emxx_udc.h line 14

Quoted 10 lines
drivers/staging/emxx_udc/emxx_udc.h +0 -6
 /*---------------------------------------------------------------------------*/
-/*----------------- Default undef */
-#if 0
-#define DEBUG
-#define UDC_DEBUG_DUMP
-#endif
-
 /*----------------- Default define */
 #define	USE_DMA	1
 #define USE_SUSPEND_WAIT	1

Formally, this is fine. But... think about it: this driver might be rather buggy, so the first thing one might want to do with it is to "enable" those two defines.

In general, that stuff has to disappear, and proper debugging facilities have to be used, but with a driver in this state, as long as proper debugging facilities aren't there, you might be doing more harm than good.

Signature · 1 line
Stefano
#2 lore raw
Quoted 38 lines · Stefano Brivio
Quoted 20 lines · On Wed, 1 Apr 2020 19:17:06 -0700 "John B. Wyatt IV" <[email protected]>…

Remove unused code surrounded by an #if 0 block.

Code has not been altered since 2014 as reported by git blame.

Reported by checkpatch.

---
 drivers/staging/emxx_udc/emxx_udc.h | 6 ------
 1 file changed, 6 deletions(-)
drivers/staging/emxx_udc/emxx_udc.h +0 -0
index 9c2671cb32f7..bbfebe331033 100644
@@ -9,12 +9,6 @@
 #define _LINUX_EMXX_H
 
 /*--------------------------------------------------------------

drivers/staging/emxx_udc/emxx_udc.h line 14

Quoted 10 lines
drivers/staging/emxx_udc/emxx_udc.h +0 -7
-------------*/
-/*----------------- Default undef */
-#if 0
-#define DEBUG
-#define UDC_DEBUG_DUMP
-#endif
-
 /*----------------- Default define */
 #define	USE_DMA	1
 #define USE_SUSPEND_WAIT	1

Formally, this is fine. But... think about it: this driver might be rather buggy, so the first thing one might want to do with it is to "enable" those two defines.

Quoted 6 lines

In general, that stuff has to disappear, and proper debugging facilities have to be used, but with a driver in this state, as long as
proper debugging facilities aren't there, you might be doing more harm
than good.

DEBUG is not actually used as far as I can tell (I am still new to kernel debugging systems to please correct me). There is only a pair of .c and .h files for this small driver.

UDC_DEBUG_DUMP is only used twice in the entire kernel-both for if statements.

Should we just set it to:

#define UDC_DEBUG_DUMP 0

And leave the other 3 lines out? Please let me know for a v2.

Quoted 4 lines
Signature · 2 lines
-- 
Stefano
#3 lore raw
Quoted 2 lines · John B. Wyatt IV

DEBUG is not actually used as far as I can tell (I am still new to kernel debugging systems to please correct me).

DEBUG is used by the <foo>_debug and <bar>_dbg macros (pr_debug, dev_dbg)