summaryrefslogtreecommitdiffstats
path: root/lib/test_kmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/test_kmod.c')
-rw-r--r--lib/test_kmod.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/test_kmod.c b/lib/test_kmod.c
index 6c1d678bcf8b..ff9148969b92 100644
--- a/lib/test_kmod.c
+++ b/lib/test_kmod.c
@@ -485,7 +485,7 @@ static ssize_t config_show(struct device *dev,
485 config->test_driver); 485 config->test_driver);
486 else 486 else
487 len += snprintf(buf+len, PAGE_SIZE - len, 487 len += snprintf(buf+len, PAGE_SIZE - len,
488 "driver:\tEMTPY\n"); 488 "driver:\tEMPTY\n");
489 489
490 if (config->test_fs) 490 if (config->test_fs)
491 len += snprintf(buf+len, PAGE_SIZE - len, 491 len += snprintf(buf+len, PAGE_SIZE - len,
@@ -493,7 +493,7 @@ static ssize_t config_show(struct device *dev,
493 config->test_fs); 493 config->test_fs);
494 else 494 else
495 len += snprintf(buf+len, PAGE_SIZE - len, 495 len += snprintf(buf+len, PAGE_SIZE - len,
496 "fs:\tEMTPY\n"); 496 "fs:\tEMPTY\n");
497 497
498 mutex_unlock(&test_dev->config_mutex); 498 mutex_unlock(&test_dev->config_mutex);
499 499
@@ -746,11 +746,11 @@ static int trigger_config_run_type(struct kmod_test_device *test_dev,
746 strlen(test_str)); 746 strlen(test_str));
747 break; 747 break;
748 case TEST_KMOD_FS_TYPE: 748 case TEST_KMOD_FS_TYPE:
749 break;
750 kfree_const(config->test_fs); 749 kfree_const(config->test_fs);
751 config->test_driver = NULL; 750 config->test_driver = NULL;
752 copied = config_copy_test_fs(config, test_str, 751 copied = config_copy_test_fs(config, test_str,
753 strlen(test_str)); 752 strlen(test_str));
753 break;
754 default: 754 default:
755 mutex_unlock(&test_dev->config_mutex); 755 mutex_unlock(&test_dev->config_mutex);
756 return -EINVAL; 756 return -EINVAL;
@@ -880,10 +880,10 @@ static int test_dev_config_update_uint_sync(struct kmod_test_device *test_dev,
880 int (*test_sync)(struct kmod_test_device *test_dev)) 880 int (*test_sync)(struct kmod_test_device *test_dev))
881{ 881{
882 int ret; 882 int ret;
883 long new; 883 unsigned long new;
884 unsigned int old_val; 884 unsigned int old_val;
885 885
886 ret = kstrtol(buf, 10, &new); 886 ret = kstrtoul(buf, 10, &new);
887 if (ret) 887 if (ret)
888 return ret; 888 return ret;
889 889
@@ -918,9 +918,9 @@ static int test_dev_config_update_uint_range(struct kmod_test_device *test_dev,
918 unsigned int max) 918 unsigned int max)
919{ 919{
920 int ret; 920 int ret;
921 long new; 921 unsigned long new;
922 922
923 ret = kstrtol(buf, 10, &new); 923 ret = kstrtoul(buf, 10, &new);
924 if (ret) 924 if (ret)
925 return ret; 925 return ret;
926 926
@@ -1146,7 +1146,7 @@ static struct kmod_test_device *register_test_dev_kmod(void)
1146 struct kmod_test_device *test_dev = NULL; 1146 struct kmod_test_device *test_dev = NULL;
1147 int ret; 1147 int ret;
1148 1148
1149 mutex_unlock(&reg_dev_mutex); 1149 mutex_lock(&reg_dev_mutex);
1150 1150
1151 /* int should suffice for number of devices, test for wrap */ 1151 /* int should suffice for number of devices, test for wrap */
1152 if (unlikely(num_test_devs + 1) < 0) { 1152 if (unlikely(num_test_devs + 1) < 0) {