Skip to contentSkip to conversation

Staging: lustre: lproc_osc: Remove irrelevant check

PATCH In review Shivani Bhardwaj 1 participant 2 messages Oct 16, 2015 – Oct 17, 2015 1 message not in the archive Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: lustre: lproc_osc: Remove irrelevant check

The variable val has been declared as unsigned long and thus the check for negative values should be removed from it.

---
 drivers/staging/lustre/lustre/osc/lproc_osc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/osc/lproc_osc.c +1 -1
index 053d508..c4d44e7 100644
@@ -63,7 +63,7 @@ static ssize_t active_store(struct kobject *kobj, struct attribute *attr,
 	rc = kstrtoul(buffer, 10, &val);
 	if (rc)
 		return rc;
-	if (val < 0 || val > 1)
+	if (val > 1)
 		return -ERANGE;
 
 	/* opposite senses */
Signature · 1 line
2.1.0

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 24 lines · Greg KH
Quoted 13 lines · Shivani Bhardwaj

The variable val has been declared as unsigned long and thus the check for negative values should be removed from it.

---
 drivers/staging/lustre/lustre/osc/lproc_osc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/osc/lproc_osc.c +0 -0
index 053d508..c4d44e7 100644

drivers/staging/lustre/lustre/osc/lproc_osc.c static ssize_t active_store(struct kobject *kobj, struct attribute *attr, · line 67

Quoted 6 lines
drivers/staging/lustre/lustre/osc/lproc_osc.c +1 -1
@@ -63,7 +63,7 @@ static ssize_t active_store(struct kobject *kobj, struct attribute *attr,
      rc = kstrtoul(buffer, 10, &val);
      if (rc)
              return rc;
-     if (val < 0 || val > 1)
+     if (val > 1)
              return -ERANGE;

Doesn't apply as I added your other patch, can you provide a fix-up on top of that for this instead?

Quoted 3 lines

thanks,

greg k-h

Yes, I'll do that.
Thank you