diff options
author | Mark Brown <broonie@kernel.org> | 2016-02-09 18:20:39 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-02-09 18:20:39 +0000 |
commit | fcdcc79628a1919bde9acf239e364f65bab6327c (patch) | |
tree | 5499be387cf3028c90ac083b1cf866ebed7bf7e0 /drivers/ide/ide.c | |
parent | 7a8d44bc89e5cddcd5c0704a11a90484d36ba6ba (diff) | |
parent | a0a90718f18264dc904d34a580f332006f5561e9 (diff) |
Merge branch 'topic/acpi' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-pxa2xx
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r-- | drivers/ide/ide.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index f086ef3874759..d127ace6aa575 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -178,17 +178,17 @@ MODULE_PARM_DESC(pci_clock, "PCI bus clock frequency (in MHz)"); static int ide_set_dev_param_mask(const char *s, const struct kernel_param *kp) { - int a, b, i, j = 1; + unsigned int a, b, i, j = 1; unsigned int *dev_param_mask = (unsigned int *)kp->arg; /* controller . device (0 or 1) [ : 1 (set) | 0 (clear) ] */ - if (sscanf(s, "%d.%d:%d", &a, &b, &j) != 3 && - sscanf(s, "%d.%d", &a, &b) != 2) + if (sscanf(s, "%u.%u:%u", &a, &b, &j) != 3 && + sscanf(s, "%u.%u", &a, &b) != 2) return -EINVAL; i = a * MAX_DRIVES + b; - if (i >= MAX_HWIFS * MAX_DRIVES || j < 0 || j > 1) + if (i >= MAX_HWIFS * MAX_DRIVES || j > 1) return -EINVAL; if (j) @@ -246,17 +246,17 @@ static struct chs_geom ide_disks_chs[MAX_HWIFS * MAX_DRIVES]; static int ide_set_disk_chs(const char *str, struct kernel_param *kp) { - int a, b, c = 0, h = 0, s = 0, i, j = 1; + unsigned int a, b, c = 0, h = 0, s = 0, i, j = 1; /* controller . device (0 or 1) : Cylinders , Heads , Sectors */ /* controller . device (0 or 1) : 1 (use CHS) | 0 (ignore CHS) */ - if (sscanf(str, "%d.%d:%d,%d,%d", &a, &b, &c, &h, &s) != 5 && - sscanf(str, "%d.%d:%d", &a, &b, &j) != 3) + if (sscanf(str, "%u.%u:%u,%u,%u", &a, &b, &c, &h, &s) != 5 && + sscanf(str, "%u.%u:%u", &a, &b, &j) != 3) return -EINVAL; i = a * MAX_DRIVES + b; - if (i >= MAX_HWIFS * MAX_DRIVES || j < 0 || j > 1) + if (i >= MAX_HWIFS * MAX_DRIVES || j > 1) return -EINVAL; if (c > INT_MAX || h > 255 || s > 255) |