ath9k: drop negativity checks for unsigned values coming from kstrtoul()
authorAndrey Utkin <andrey.krieger.utkin@gmail.com>
Thu, 17 Jul 2014 13:56:37 +0000 (16:56 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 18 Jul 2014 17:45:25 +0000 (13:45 -0400)
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80471
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80481
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/debug.c
drivers/net/wireless/ath/ath9k/spectral.c

index ce073e995dfe3c50bfe128e5f3eadb1d5c9f5663..d2279365be6fcc6a85b2252a9c68a2502f94c211 100644 (file)
@@ -202,7 +202,7 @@ static ssize_t write_file_ani(struct file *file,
        if (kstrtoul(buf, 0, &ani))
                return -EINVAL;
 
-       if (ani < 0 || ani > 1)
+       if (ani > 1)
                return -EINVAL;
 
        common->disable_ani = !ani;
index 99f4de95c264b0638108d58820efcb9b8390e8fc..5fe29b9f8fa26e31b05eaab237ac4830aaf21471 100644 (file)
@@ -313,7 +313,7 @@ static ssize_t write_file_spectral_short_repeat(struct file *file,
        if (kstrtoul(buf, 0, &val))
                return -EINVAL;
 
-       if (val < 0 || val > 1)
+       if (val > 1)
                return -EINVAL;
 
        sc->spec_config.short_repeat = val;
@@ -361,7 +361,7 @@ static ssize_t write_file_spectral_count(struct file *file,
        if (kstrtoul(buf, 0, &val))
                return -EINVAL;
 
-       if (val < 0 || val > 255)
+       if (val > 255)
                return -EINVAL;
 
        sc->spec_config.count = val;
@@ -409,7 +409,7 @@ static ssize_t write_file_spectral_period(struct file *file,
        if (kstrtoul(buf, 0, &val))
                return -EINVAL;
 
-       if (val < 0 || val > 255)
+       if (val > 255)
                return -EINVAL;
 
        sc->spec_config.period = val;
@@ -457,7 +457,7 @@ static ssize_t write_file_spectral_fft_period(struct file *file,
        if (kstrtoul(buf, 0, &val))
                return -EINVAL;
 
-       if (val < 0 || val > 15)
+       if (val > 15)
                return -EINVAL;
 
        sc->spec_config.fft_period = val;