Skip to contentSkip to conversation

Drivers: Misc: fix warnings, unsigned long will never < 0

PATCH Superseded Chen Gang 3 participants 9 messages Apr 7, 2013 – May 8, 2013 Char and misc drivers

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 Drivers: Misc: fix warnings, unsigned long will never < 0

val is unsigned long which never < 0

---
 drivers/misc/tsl2550.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/misc/tsl2550.c +1 -1
index 1e7bc0e..558dd20 100644
@@ -204,7 +204,7 @@ static ssize_t tsl2550_store_power_state(struct device *dev,
 	unsigned long val = simple_strtoul(buf, NULL, 10);
 	int ret;
 
-	if (val < 0 || val > 1)
+	if (val > 1)
 		return -EINVAL;
 
 	mutex_lock(&data->update_lock);
Signature · 1 line
1.7.7.6
author
#1 lore raw

also has another 'unsigned long val' warnings, I will send patch v2 to
merge them together.

Quoted 22 lines · Chen Gang

val is unsigned long which never < 0

---
 drivers/misc/tsl2550.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/misc/tsl2550.c +1 -1
index 1e7bc0e..558dd20 100644
@@ -204,7 +204,7 @@ static ssize_t tsl2550_store_power_state(struct device *dev,
 	unsigned long val = simple_strtoul(buf, NULL, 10);
 	int ret;
 
-	if (val < 0 || val > 1)
+	if (val > 1)
 		return -EINVAL;
 
 	mutex_lock(&data->update_lock);
Signature · 3 lines
Chen Gang

Asianux Corporation
author
#2 lore raw

PATCH v2 1/1 Drivers: Misc: fix warnings, unsigned long will never < 0

In reply to Chen Gang

val is unsigned long which never < 0

---
 drivers/misc/tsl2550.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/misc/tsl2550.c +2 -2
index 1e7bc0e..5bf9448 100644
@@ -204,7 +204,7 @@ static ssize_t tsl2550_store_power_state(struct device *dev,
 	unsigned long val = simple_strtoul(buf, NULL, 10);
 	int ret;
 
-	if (val < 0 || val > 1)
+	if (val > 1)
 		return -EINVAL;
 
 	mutex_lock(&data->update_lock);
@@ -236,7 +236,7 @@ static ssize_t tsl2550_store_operating_mode(struct device *dev,
 	unsigned long val = simple_strtoul(buf, NULL, 10);
 	int ret;
 
-	if (val < 0 || val > 1)
+	if (val > 1)
 		return -EINVAL;
 
 	if (data->power_state == 0)
Signature · 1 line
1.7.7.6
author
#3 lore raw

Hello Maintainers:

Please help check, when you have time.

Thanks.

Quoted 31 lines · Chen Gang

val is unsigned long which never < 0

---
 drivers/misc/tsl2550.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/misc/tsl2550.c +2 -2
index 1e7bc0e..5bf9448 100644
@@ -204,7 +204,7 @@ static ssize_t tsl2550_store_power_state(struct device *dev,
 	unsigned long val = simple_strtoul(buf, NULL, 10);
 	int ret;
 
-	if (val < 0 || val > 1)
+	if (val > 1)
 		return -EINVAL;
 
 	mutex_lock(&data->update_lock);
@@ -236,7 +236,7 @@ static ssize_t tsl2550_store_operating_mode(struct device *dev,
 	unsigned long val = simple_strtoul(buf, NULL, 10);
 	int ret;
 
-	if (val < 0 || val > 1)
+	if (val > 1)
 		return -EINVAL;
 
 	if (data->power_state == 0)
Signature · 3 lines
Chen Gang

Asianux Corporation
maintainer
#4 lore raw
Quoted 7 lines · Chen Gang

Hello Maintainers:

Please help check, when you have time.

Thanks.

On 2013年04月07日 11:28, Chen Gang wrote:

<snip>

You sent a cleanup patch in the middle of the merge window, when we can't take any patches at the moment due to other work, and expect a review in less than 24 hours?

Please be realistic, I'll get to this eventually (i.e. next week at the earliest.)

Patience is a virtue.

greg "someone owes me some virtue" k-h

#5 lore raw
Quoted 7 lines · Greg KH
Quoted 6 lines · Chen Gang

Hello Maintainers:

Please help check, when you have time.

Thanks.

Quoted 8 lines
Quoted 1 line · Chen Gang

<snip>

You sent a cleanup patch in the middle of the merge window, when we can't take any patches at the moment due to other work, and expect a review in less than 24 hours?

No, he sent the patch one month ago, so to be honest he's quite patient, though he picked a wrong time to ping you. ;)

Quoted 5 lines

Please be realistic, I'll get to this eventually (i.e. next week at the earliest.)

Patience is a virtue.

author
#6 lore raw
Quoted 10 lines · Li Zefan
Quoted 9 lines · Greg KH
Quoted 9 lines · Chen Gang
Quoted 7 lines
Quoted 7 lines

Hello Maintainers:

Please help check, when you have time.

Thanks.

On 2013年04月07日 11:28, Chen Gang wrote:

Quoted 9 lines
Quoted 6 lines
Quoted 6 lines

<snip>

You sent a cleanup patch in the middle of the merge window, when we can't take any patches at the moment due to other work, and expect a review in less than 24 hours?

No, he sent the patch one month ago, so to be honest he's quite patient, though he picked a wrong time to ping you. ;)

That seems I need get 'rid' of all Chinese characters in mail, which can lead another members misreading. ;)

Thanks.

Signature · 3 lines
Chen Gang

Asianux Corporation
maintainer
#7 lore raw
In reply to Li Zefan
Quoted 12 lines · Li Zefan
Quoted 11 lines · Greg KH
Quoted 7 lines · Chen Gang

Hello Maintainers:

Please help check, when you have time.

Thanks.

On 2013年04月07日 11:28, Chen Gang wrote:

<snip>

Quoted 7 lines
Quoted 4 lines

You sent a cleanup patch in the middle of the merge window, when we can't take any patches at the moment due to other work, and expect a review in less than 24 hours?

No, he sent the patch one month ago, so to be honest he's quite patient, though he picked a wrong time to ping you. ;)

Obviously, I don't even know what month this is :)

Chen, very sorry about that. I'll look into it next week, it's probably lost somewhere in my todo queue.

greg k-h

author
#8 lore raw
Quoted 18 lines · Greg KH
Quoted 17 lines · Li Zefan
Quoted 15 lines · Greg KH
Quoted 7 lines · Chen Gang

Hello Maintainers:

Please help check, when you have time.

Thanks.

On 2013年04月07日 11:28, Chen Gang wrote:

<snip>

You sent a cleanup patch in the middle of the merge window, when we can't take any patches at the moment due to other work, and expect a review in less than 24 hours?

Quoted 5 lines
Quoted 2 lines

No, he sent the patch one month ago, so to be honest he's quite patient, though he picked a wrong time to ping you. ;)

Obviously, I don't even know what month this is :)

Next, I really need get rid of any Chinese characters in mail. :)

Quoted 3 lines

Chen, very sorry about that. I'll look into it next week, it's probably lost somewhere in my todo queue.

Not mind, it is really only a cleanup patch, and also you are really busy, so please look into it just when you have time.

And I should focus on continuing to find and make another patches and should try to answer, analyse, and learn some a little deeper questions (e.g. a question about get_tree() in kernel/audit_tree.c).

Thanks.

Signature · 3 lines
Chen Gang

Asianux Corporation