Skip to contentSkip to conversation

staging : comedi : dt2801 : remove old unused code

PATCH Superseded Deepak R Varma 2 participants 7 messages Mar 10, 2020 Staging

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging : comedi : dt2801 : remove old unused code

there are 2 #if 0 blocks that have no recent history of any change. We can remove those code blocks for improved readability of the code.

---
 drivers/staging/comedi/drivers/dt2801.c | 22 ----------------------
 1 file changed, 22 deletions(-)
drivers/staging/comedi/drivers/dt2801.c +0 -22
index a29880981d81..aad02faa2f83 100644
@@ -87,17 +87,6 @@
 #define DT2801_STATUS		1
 #define DT2801_CMD		1
 
-#if 0
-/* ignore 'defined but not used' warning */
-static const struct comedi_lrange range_dt2801_ai_pgh_bipolar = {
-	4, {
-		BIP_RANGE(10),
-		BIP_RANGE(5),
-		BIP_RANGE(2.5),
-		BIP_RANGE(1.25)
-	}
-};
-#endif
 static const struct comedi_lrange range_dt2801_ai_pgl_bipolar = {
 	4, {
 		BIP_RANGE(10),
@@ -107,17 +96,6 @@ static const struct comedi_lrange range_dt2801_ai_pgl_bipolar = {
 	}
 };
 
-#if 0
-/* ignore 'defined but not used' warning */
-static const struct comedi_lrange range_dt2801_ai_pgh_unipolar = {
-	4, {
-		UNI_RANGE(10),
-		UNI_RANGE(5),
-		UNI_RANGE(2.5),
-		UNI_RANGE(1.25)
-	}
-};
-#endif
 static const struct comedi_lrange range_dt2801_ai_pgl_unipolar = {
 	4, {
 		UNI_RANGE(10),
Signature · 1 line
2.17.1
#1 lore raw

Subject lines don't have spaces before the colons.

You can alywas looks at other subject lines on the same file to see what others have done:

git log --oneline filename.c

julia

Quoted 56 lines · Deepak R Varma

there are 2 #if 0 blocks that have no recent history of any change. We can remove those code blocks for improved readability of the code.

---
 drivers/staging/comedi/drivers/dt2801.c | 22 ----------------------
 1 file changed, 22 deletions(-)
drivers/staging/comedi/drivers/dt2801.c +0 -23
index a29880981d81..aad02faa2f83 100644
@@ -87,17 +87,6 @@
 #define DT2801_STATUS		1
 #define DT2801_CMD		1
 
-#if 0
-/* ignore 'defined but not used' warning */
-static const struct comedi_lrange range_dt2801_ai_pgh_bipolar = {
-	4, {
-		BIP_RANGE(10),
-		BIP_RANGE(5),
-		BIP_RANGE(2.5),
-		BIP_RANGE(1.25)
-	}
-};
-#endif
 static const struct comedi_lrange range_dt2801_ai_pgl_bipolar = {
 	4, {
 		BIP_RANGE(10),
@@ -107,17 +96,6 @@ static const struct comedi_lrange range_dt2801_ai_pgl_bipolar = {
 	}
 };
 
-#if 0
-/* ignore 'defined but not used' warning */
-static const struct comedi_lrange range_dt2801_ai_pgh_unipolar = {
-	4, {
-		UNI_RANGE(10),
-		UNI_RANGE(5),
-		UNI_RANGE(2.5),
-		UNI_RANGE(1.25)
-	}
-};
-#endif
 static const struct comedi_lrange range_dt2801_ai_pgl_unipolar = {
 	4, {
 		UNI_RANGE(10),
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20200310155053.GA27759%40deeUbuntu.

#2 lore raw
In reply to Deepak R Varma

Thank you Julia. I will update the subject line and resubmit the patch.

Deepak.

Quoted 55 lines · Deepak Varma

there are 2 #if 0 blocks that have no recent history of any change. We can remove those code blocks for improved readability of the code.

---

 drivers/staging/comedi/drivers/dt2801.c | 22 ---------------------- 
 1 file changed, 22 deletions(-) 
drivers/staging/comedi/drivers/dt2801.c +0 -22
index a29880981d81..aad02faa2f83 100644 
@@ -87,17 +87,6 @@ 
 #define DT2801_STATUS                1 
 #define DT2801_CMD                1 
 
-#if 0 
-/* ignore 'defined but not used' warning */ 
-static const struct comedi_lrange range_dt2801_ai_pgh_bipolar = { 
-        4, { 
-                BIP_RANGE(10), 
-                BIP_RANGE(5), 
-                BIP_RANGE(2.5), 
-                BIP_RANGE(1.25) 
-        } 
-}; 
-#endif 
 static const struct comedi_lrange range_dt2801_ai_pgl_bipolar = { 
         4, { 
                 BIP_RANGE(10), 
@@ -107,17 +96,6 @@ static const struct comedi_lrange 
 range_dt2801_ai_pgl_bipolar = { 
         } 
 }; 
 
-#if 0 
-/* ignore 'defined but not used' warning */ 
-static const struct comedi_lrange range_dt2801_ai_pgh_unipolar = { 
-        4, { 
-                UNI_RANGE(10), 
-                UNI_RANGE(5), 
-                UNI_RANGE(2.5), 
-                UNI_RANGE(1.25) 
-        } 
-}; 
-#endif 
 static const struct comedi_lrange range_dt2801_ai_pgl_unipolar = { 
         4, { 
                 UNI_RANGE(10), 
Signature · 1 line
2.17.1 
#3 lore raw
Quoted 1 line · Deepak Varma

Thank you Julia. I will update the subject line and resubmit the patch.

Please don't top post. You seem to have removed my comment completely (I put it at the top because it was referring to the subject line, which was just above).

julia

#4 lore raw
In reply to Deepak R Varma

Thank you once again Julia. I will review and resend v3.

Deepak.

Quoted 55 lines · Deepak Varma

there are 2 #if 0 blocks that have no recent history of any change. We can remove those code blocks for improved readability of the code.

---

 drivers/staging/comedi/drivers/dt2801.c | 22 ---------------------- 
 1 file changed, 22 deletions(-) 
drivers/staging/comedi/drivers/dt2801.c +0 -22
index a29880981d81..aad02faa2f83 100644 
@@ -87,17 +87,6 @@ 
 #define DT2801_STATUS                1 
 #define DT2801_CMD                1 
 
-#if 0 
-/* ignore 'defined but not used' warning */ 
-static const struct comedi_lrange range_dt2801_ai_pgh_bipolar = { 
-        4, { 
-                BIP_RANGE(10), 
-                BIP_RANGE(5), 
-                BIP_RANGE(2.5), 
-                BIP_RANGE(1.25) 
-        } 
-}; 
-#endif 
 static const struct comedi_lrange range_dt2801_ai_pgl_bipolar = { 
         4, { 
                 BIP_RANGE(10), 
@@ -107,17 +96,6 @@ static const struct comedi_lrange 
 range_dt2801_ai_pgl_bipolar = { 
         } 
 }; 
 
-#if 0 
-/* ignore 'defined but not used' warning */ 
-static const struct comedi_lrange range_dt2801_ai_pgh_unipolar = { 
-        4, { 
-                UNI_RANGE(10), 
-                UNI_RANGE(5), 
-                UNI_RANGE(2.5), 
-                UNI_RANGE(1.25) 
-        } 
-}; 
-#endif 
 static const struct comedi_lrange range_dt2801_ai_pgl_unipolar = { 
         4, { 
                 UNI_RANGE(10), 
Signature · 1 line
2.17.1 
#5 lore raw
In reply to Deepak R Varma

True. I added those manually to be sure. Would you suggest I resubmit v4 or it is okay for now and should be taken care in my next submission???

Thank you.
Deepak.

Quoted 55 lines · Deepak Varma

there are 2 #if 0 blocks that have no recent history of any change. We can remove those code blocks for improved readability of the code.

---

 drivers/staging/comedi/drivers/dt2801.c | 22 ---------------------- 
 1 file changed, 22 deletions(-) 
drivers/staging/comedi/drivers/dt2801.c +0 -22
index a29880981d81..aad02faa2f83 100644 
@@ -87,17 +87,6 @@ 
 #define DT2801_STATUS                1 
 #define DT2801_CMD                1 
 
-#if 0 
-/* ignore 'defined but not used' warning */ 
-static const struct comedi_lrange range_dt2801_ai_pgh_bipolar = { 
-        4, { 
-                BIP_RANGE(10), 
-                BIP_RANGE(5), 
-                BIP_RANGE(2.5), 
-                BIP_RANGE(1.25) 
-        } 
-}; 
-#endif 
 static const struct comedi_lrange range_dt2801_ai_pgl_bipolar = { 
         4, { 
                 BIP_RANGE(10), 
@@ -107,17 +96,6 @@ static const struct comedi_lrange 
 range_dt2801_ai_pgl_bipolar = { 
         } 
 }; 
 
-#if 0 
-/* ignore 'defined but not used' warning */ 
-static const struct comedi_lrange range_dt2801_ai_pgh_unipolar = { 
-        4, { 
-                UNI_RANGE(10), 
-                UNI_RANGE(5), 
-                UNI_RANGE(2.5), 
-                UNI_RANGE(1.25) 
-        } 
-}; 
-#endif 
 static const struct comedi_lrange range_dt2801_ai_pgl_unipolar = { 
         4, { 
                 UNI_RANGE(10), 
Signature · 1 line
2.17.1 
#6 lore raw
Quoted 2 lines · Deepak Varma

True. I added those manually to be sure. Would you suggest I resubmit v4 or it is okay for now and should be taken care in my next submission???

Please stop top posting and please stop removing the comments that you are replying to. Your message should be self contained. The person looking at only the message should understand the whole context of what you are saying.

I think you are asking about the extra ---. Don't worry about it.

julia

Quoted 74 lines

Thank you.
Deepak.

On Tuesday, 10 March 2020 21:21:05 UTC+5:30, Deepak Varma wrote:

      there are 2 #if 0 blocks that have no recent history of any
      change. We
      can remove those code blocks for improved readability of the
      code.

      Signed-off-by: Deepak R Varma <[email protected]>
      ---
       drivers/staging/comedi/drivers/dt2801.c | 22
      ----------------------
       1 file changed, 22 deletions(-)

      diff --git a/drivers/staging/comedi/drivers/dt2801.c
      b/drivers/staging/comedi/drivers/dt2801.c
      index a29880981d81..aad02faa2f83 100644
      --- a/drivers/staging/comedi/drivers/dt2801.c
      +++ b/drivers/staging/comedi/drivers/dt2801.c
      @@ -87,17 +87,6 @@
       #define DT2801_STATUS                1
       #define DT2801_CMD                1
       
      -#if 0
      -/* ignore 'defined but not used' warning */
      -static const struct comedi_lrange range_dt2801_ai_pgh_bipolar =
      {
      -        4, {
      -                BIP_RANGE(10),
      -                BIP_RANGE(5),
      -                BIP_RANGE(2.5),
      -                BIP_RANGE(1.25)
      -        }
      -};
      -#endif
       static const struct comedi_lrange range_dt2801_ai_pgl_bipolar =
      {
               4, {
                       BIP_RANGE(10),
      @@ -107,17 +96,6 @@ static const struct comedi_lrange
      range_dt2801_ai_pgl_bipolar = {
               }
       };
       
      -#if 0
      -/* ignore 'defined but not used' warning */
      -static const struct comedi_lrange range_dt2801_ai_pgh_unipolar
      = {
      -        4, {
      -                UNI_RANGE(10),
      -                UNI_RANGE(5),
      -                UNI_RANGE(2.5),
      -                UNI_RANGE(1.25)
      -        }
      -};
      -#endif
       static const struct comedi_lrange range_dt2801_ai_pgl_unipolar
      = {
               4, {
                       UNI_RANGE(10),
      --
      2.17.1

--
You received this message because you are subscribed to the Google Groups
"outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/b14f8972-f6c7-4ca6-8fe6- 55fc3517a186%40googlegroups.com.