Skip to contentSkip to conversation

remove untouched code in kfifo_in

PATCH Jiri Kosina 2 participants 5 messages Oct 17, 2012 – Oct 18, 2012 3 messages not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 12 lines · Wei Yang

In kfifo_in marco, one piece of code is arounded by if(0).

This patch just remove this code.

---
 include/linux/kfifo.h |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
include/linux/kfifo.h +0 -0
index 10308c6..e7015bb 100644

include/linux/kfifo.h __kfifo_uint_must_check_helper( \ · line 517

Quoted 10 lines
include/linux/kfifo.h +0 -4
@@ -512,10 +512,6 @@ __kfifo_uint_must_check_helper( \
 	unsigned long __n = (n); \
 	const size_t __recsize = sizeof(*__tmp->rectype); \
 	struct __kfifo *__kfifo = &__tmp->kfifo; \
-	if (0) { \
-		typeof(__tmp->ptr_const) __dummy __attribute__ ((unused)); \
-		__dummy = (typeof(__buf))NULL; \
-	} \
 	(__recsize) ?\
 	__kfifo_in_r(__kfifo, __buf, __n, __recsize) : \
 	__kfifo_in(__kfifo, __buf, __n); \

Frankly, I'd first like to understand what was the rationale for adding it at the first place. Adding Stefani and lkml to CC.

Signature · 2 lines
Jiri Kosina
SUSE Labs
#3 lore raw
In reply to a message not in the archive
Quoted 24 lines · Richard Yang
Quoted 15 lines
Quoted 15 lines

This patch just remove this code.

---
 include/linux/kfifo.h |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
include/linux/kfifo.h +0 -2
index 10308c6..e7015bb 100644
@@ -512,10 +512,6 @@ __kfifo_uint_must_check_helper( \
 	unsigned long __n = (n); \
 	const size_t __recsize = sizeof(*__tmp->rectype); \
 	struct __kfifo *__kfifo = &__tmp->kfifo; \
-	if (0) { \
-		typeof(__tmp->ptr_const) __dummy __attribute__ ((unused)); \
Quoted 8 lines

include/linux/kfifo.h __kfifo_uint_must_check_helper( \ · line 517

Quoted 5 lines
include/linux/kfifo.h +0 -2
-		__dummy = (typeof(__buf))NULL; \
-	} \
 	(__recsize) ?\
 	__kfifo_in_r(__kfifo, __buf, __n, __recsize) : \
 	__kfifo_in(__kfifo, __buf, __n); \

Frankly, I'd first like to understand what was the rationale for adding it at the first place. Adding Stefani and lkml to CC.

Quoted 8 lines

Agree.

BTW, by git blame, I just see commit 2e956fb3 which is checked in by Stefani. While looking in the diff, the kfifo_in() is already there. Looks like this commit move the definition from one file to another file.

So I am not sure the if(0) code is added by Stefani. Any other method to trace the ealier history?

git blame -- include/linux/kfifo-new.h 2e956fb3~1

Signature · 2 lines
Jiri Kosina
SUSE Labs
#4 lore raw

This was introduce by me to suppress a compiler warning, so don't remove it.

Am Mittwoch, den 17.10.2012, 16:05 +0200 schrieb Jiri Kosina:

Quoted 37 lines · Richard Yang
Quoted 25 lines
Quoted 16 lines
Quoted 16 lines

This patch just remove this code.

---
 include/linux/kfifo.h |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
include/linux/kfifo.h +0 -2
index 10308c6..e7015bb 100644
@@ -512,10 +512,6 @@ __kfifo_uint_must_check_helper( \
 	unsigned long __n = (n); \
 	const size_t __recsize = sizeof(*__tmp->rectype); \
 	struct __kfifo *__kfifo = &__tmp->kfifo; \
-	if (0) { \
-		typeof(__tmp->ptr_const) __dummy __attribute__ ((unused)); \
Quoted 8 lines

include/linux/kfifo.h __kfifo_uint_must_check_helper( \ · line 517

Quoted 5 lines
include/linux/kfifo.h +0 -2
-		__dummy = (typeof(__buf))NULL; \
-	} \
 	(__recsize) ?\
 	__kfifo_in_r(__kfifo, __buf, __n, __recsize) : \
 	__kfifo_in(__kfifo, __buf, __n); \

Frankly, I'd first like to understand what was the rationale for adding it at the first place. Adding Stefani and lkml to CC.

Quoted 8 lines

Agree.

BTW, by git blame, I just see commit 2e956fb3 which is checked in by Stefani. While looking in the diff, the kfifo_in() is already there. Looks like this commit move the definition from one file to another file.

So I am not sure the if(0) code is added by Stefani. Any other method to trace the ealier history?

git blame -- include/linux/kfifo-new.h 2e956fb3~1

#6 lore raw
In reply to a message not in the archive

Am Donnerstag, den 18.10.2012, 09:59 +0800 schrieb Richard Yang:

Quoted 6 lines · Stefani Seibold
Quoted 2 lines

This was introduce by me to suppress a compiler warning, so don't remove it.

Which warning? I compile by removing this, but not find warning. I compile it on x86_64 platform.

Quoted 1 line

Sorry, i can't remember, it is three years and two gcc major releases ago.

Quoted 40 lines
Quoted 39 lines

Am Mittwoch, den 17.10.2012, 16:05 +0200 schrieb Jiri Kosina:

Quoted 37 lines · Richard Yang
Quoted 25 lines
Quoted 16 lines
Quoted 16 lines

This patch just remove this code.

---
 include/linux/kfifo.h |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
include/linux/kfifo.h +0 -2
index 10308c6..e7015bb 100644
@@ -512,10 +512,6 @@ __kfifo_uint_must_check_helper( \
 	unsigned long __n = (n); \
 	const size_t __recsize = sizeof(*__tmp->rectype); \
 	struct __kfifo *__kfifo = &__tmp->kfifo; \
-	if (0) { \
-		typeof(__tmp->ptr_const) __dummy __attribute__ ((unused)); \
Quoted 8 lines

include/linux/kfifo.h __kfifo_uint_must_check_helper( \ · line 517

Quoted 5 lines
include/linux/kfifo.h +0 -2
-		__dummy = (typeof(__buf))NULL; \
-	} \
 	(__recsize) ?\
 	__kfifo_in_r(__kfifo, __buf, __n, __recsize) : \
 	__kfifo_in(__kfifo, __buf, __n); \

Frankly, I'd first like to understand what was the rationale for adding it at the first place. Adding Stefani and lkml to CC.

Quoted 8 lines

Agree.

BTW, by git blame, I just see commit 2e956fb3 which is checked in by Stefani. While looking in the diff, the kfifo_in() is already there. Looks like this commit move the definition from one file to another file.

So I am not sure the if(0) code is added by Stefani. Any other method to trace the ealier history?

git blame -- include/linux/kfifo-new.h 2e956fb3~1

#7 lore raw
Quoted 8 lines · Stefani Seibold
Quoted 5 lines
Quoted 2 lines

This was introduce by me to suppress a compiler warning, so don't remove it.

Which warning? I compile by removing this, but not find warning. I compile it on x86_64 platform.

Quoted 1 line

Sorry, i can't remember, it is three years and two gcc major releases ago.

Well, exactly. gcc that needs this workaround seems to be pretty broken, and I am not seeing any warnings either myself.

As it's quite a obscure and confusing construction, I'd not hesitate removing that.

Signature · 2 lines
Jiri Kosina
SUSE Labs