* [PATCH] staging: emxx_udc: Remove unused code
@ 2020-04-02 2:17 John B. Wyatt IV
2020-04-02 23:50 ` [Outreachy kernel] " Stefano Brivio
0 siblings, 1 reply; 6+ messages in thread
From: John B. Wyatt IV @ 2020-04-02 2:17 UTC (permalink / raw)
To: outreachy-kernel, Greg Kroah-Hartman, Saiyam Doshi, devel,
linux-kernel
Cc: John B. Wyatt IV
Remove unused code surrounded by an #if 0 block.
Code has not been altered since 2014 as reported by git blame.
Reported by checkpatch.
Signed-off-by: John B. Wyatt IV <jbwyatt4@gmail.com>
---
drivers/staging/emxx_udc/emxx_udc.h | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/staging/emxx_udc/emxx_udc.h b/drivers/staging/emxx_udc/emxx_udc.h
index 9c2671cb32f7..bbfebe331033 100644
--- a/drivers/staging/emxx_udc/emxx_udc.h
+++ b/drivers/staging/emxx_udc/emxx_udc.h
@@ -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
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: emxx_udc: Remove unused code
2020-04-02 2:17 [PATCH] staging: emxx_udc: Remove unused code John B. Wyatt IV
@ 2020-04-02 23:50 ` Stefano Brivio
2020-04-03 1:42 ` John B. Wyatt IV
0 siblings, 1 reply; 6+ messages in thread
From: Stefano Brivio @ 2020-04-02 23:50 UTC (permalink / raw)
To: John B. Wyatt IV
Cc: outreachy-kernel, Greg Kroah-Hartman, Saiyam Doshi, devel,
linux-kernel
On Wed, 1 Apr 2020 19:17:06 -0700
"John B. Wyatt IV" <jbwyatt4@gmail.com> wrote:
> Remove unused code surrounded by an #if 0 block.
>
> Code has not been altered since 2014 as reported by git blame.
>
> Reported by checkpatch.
>
> Signed-off-by: John B. Wyatt IV <jbwyatt4@gmail.com>
> ---
> drivers/staging/emxx_udc/emxx_udc.h | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/staging/emxx_udc/emxx_udc.h b/drivers/staging/emxx_udc/emxx_udc.h
> index 9c2671cb32f7..bbfebe331033 100644
> --- a/drivers/staging/emxx_udc/emxx_udc.h
> +++ b/drivers/staging/emxx_udc/emxx_udc.h
> @@ -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
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.
--
Stefano
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: emxx_udc: Remove unused code
2020-04-02 23:50 ` [Outreachy kernel] " Stefano Brivio
@ 2020-04-03 1:42 ` John B. Wyatt IV
2020-04-03 4:33 ` Joe Perches
0 siblings, 1 reply; 6+ messages in thread
From: John B. Wyatt IV @ 2020-04-03 1:42 UTC (permalink / raw)
To: Stefano Brivio
Cc: outreachy-kernel, Greg Kroah-Hartman, Saiyam Doshi, devel,
linux-kernel
On Fri, 2020-04-03 at 01:50 +0200, Stefano Brivio wrote:
> On Wed, 1 Apr 2020 19:17:06 -0700
> "John B. Wyatt IV" <jbwyatt4@gmail.com> wrote:
>
> > Remove unused code surrounded by an #if 0 block.
> >
> > Code has not been altered since 2014 as reported by git blame.
> >
> > Reported by checkpatch.
> >
> > Signed-off-by: John B. Wyatt IV <jbwyatt4@gmail.com>
> > ---
> > drivers/staging/emxx_udc/emxx_udc.h | 6 ------
> > 1 file changed, 6 deletions(-)
> >
> > diff --git a/drivers/staging/emxx_udc/emxx_udc.h
> > b/drivers/staging/emxx_udc/emxx_udc.h
> > index 9c2671cb32f7..bbfebe331033 100644
> > --- a/drivers/staging/emxx_udc/emxx_udc.h
> > +++ b/drivers/staging/emxx_udc/emxx_udc.h
> > @@ -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
>
> 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.
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.
>
> --
> Stefano
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] staging: emxx_udc: remove unused code
@ 2018-10-08 7:33 Loic Tourlonias
2018-10-08 7:57 ` Gustavo A. R. Silva
0 siblings, 1 reply; 6+ messages in thread
From: Loic Tourlonias @ 2018-10-08 7:33 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: devel, linux-kernel, Loic Tourlonias
Remove useless code inside if_0 endif
Signed-off-by: Loic Tourlonias <loic.tourlonias.lkml@gmail.com>
---
drivers/staging/emxx_udc/emxx_udc.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/staging/emxx_udc/emxx_udc.h b/drivers/staging/emxx_udc/emxx_udc.h
index 8337e38c238a..78fa60192a14 100644
--- a/drivers/staging/emxx_udc/emxx_udc.h
+++ b/drivers/staging/emxx_udc/emxx_udc.h
@@ -10,10 +10,6 @@
/*---------------------------------------------------------------------------*/
/*----------------- Default undef */
-#if 0
-#define DEBUG
-#define UDC_DEBUG_DUMP
-#endif
/*----------------- Default define */
#define USE_DMA 1
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: emxx_udc: remove unused code
2018-10-08 7:33 [PATCH] staging: emxx_udc: remove " Loic Tourlonias
@ 2018-10-08 7:57 ` Gustavo A. R. Silva
0 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2018-10-08 7:57 UTC (permalink / raw)
To: Loic Tourlonias, Greg Kroah-Hartman; +Cc: devel, linux-kernel
Hi,
On 10/8/18 9:33 AM, Loic Tourlonias wrote:
> Remove useless code inside if_0 endif
>
> Signed-off-by: Loic Tourlonias <loic.tourlonias.lkml@gmail.com>
> ---
> drivers/staging/emxx_udc/emxx_udc.h | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/staging/emxx_udc/emxx_udc.h b/drivers/staging/emxx_udc/emxx_udc.h
> index 8337e38c238a..78fa60192a14 100644
> --- a/drivers/staging/emxx_udc/emxx_udc.h
> +++ b/drivers/staging/emxx_udc/emxx_udc.h
> @@ -10,10 +10,6 @@
>
> /*---------------------------------------------------------------------------*/
> /*----------------- Default undef */
> -#if 0
> -#define DEBUG
> -#define UDC_DEBUG_DUMP
> -#endif
>
Don't remove that code. This is a common practice for debugging.
Whenever the developer needs to debug something in the whole driver, he/she
just has to change that #if 0 to #if 1 and then all the code under DEBUG
and UDC_DEBUG_DUMP will be enabled.
Notice that UDC_DEBUG_DUMP is being used in drivers/staging/emxx_udc/emxx_udc.c
Thanks
--
Gustavo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-04-03 4:35 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-02 2:17 [PATCH] staging: emxx_udc: Remove unused code John B. Wyatt IV
2020-04-02 23:50 ` [Outreachy kernel] " Stefano Brivio
2020-04-03 1:42 ` John B. Wyatt IV
2020-04-03 4:33 ` Joe Perches
-- strict thread matches above, loose matches on Subject: below --
2018-10-08 7:33 [PATCH] staging: emxx_udc: remove " Loic Tourlonias
2018-10-08 7:57 ` Gustavo A. R. Silva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox