Skip to content

Commit 7f36f1b

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide
Pull IDE updates from David Miller: "Just a few small changes this merge window, marking ops const, printf string type fixes, etc" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide: drivers/ide: make ide-scan-pci.c driver explicitly non-modular ide: constify ide_dma_ops structures ide: silence some underflow warnings
2 parents c38dec7 + e04a2bd commit 7f36f1b

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

drivers/ide/ide-scan-pci.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,4 @@ static int __init ide_scan_pcibus(void)
107107

108108
return 0;
109109
}
110-
111-
module_init(ide_scan_pcibus);
110+
device_initcall(ide_scan_pcibus);

drivers/ide/ide.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,17 @@ MODULE_PARM_DESC(pci_clock, "PCI bus clock frequency (in MHz)");
178178

179179
static int ide_set_dev_param_mask(const char *s, const struct kernel_param *kp)
180180
{
181-
int a, b, i, j = 1;
181+
unsigned int a, b, i, j = 1;
182182
unsigned int *dev_param_mask = (unsigned int *)kp->arg;
183183

184184
/* controller . device (0 or 1) [ : 1 (set) | 0 (clear) ] */
185-
if (sscanf(s, "%d.%d:%d", &a, &b, &j) != 3 &&
186-
sscanf(s, "%d.%d", &a, &b) != 2)
185+
if (sscanf(s, "%u.%u:%u", &a, &b, &j) != 3 &&
186+
sscanf(s, "%u.%u", &a, &b) != 2)
187187
return -EINVAL;
188188

189189
i = a * MAX_DRIVES + b;
190190

191-
if (i >= MAX_HWIFS * MAX_DRIVES || j < 0 || j > 1)
191+
if (i >= MAX_HWIFS * MAX_DRIVES || j > 1)
192192
return -EINVAL;
193193

194194
if (j)
@@ -246,17 +246,17 @@ static struct chs_geom ide_disks_chs[MAX_HWIFS * MAX_DRIVES];
246246

247247
static int ide_set_disk_chs(const char *str, struct kernel_param *kp)
248248
{
249-
int a, b, c = 0, h = 0, s = 0, i, j = 1;
249+
unsigned int a, b, c = 0, h = 0, s = 0, i, j = 1;
250250

251251
/* controller . device (0 or 1) : Cylinders , Heads , Sectors */
252252
/* controller . device (0 or 1) : 1 (use CHS) | 0 (ignore CHS) */
253-
if (sscanf(str, "%d.%d:%d,%d,%d", &a, &b, &c, &h, &s) != 5 &&
254-
sscanf(str, "%d.%d:%d", &a, &b, &j) != 3)
253+
if (sscanf(str, "%u.%u:%u,%u,%u", &a, &b, &c, &h, &s) != 5 &&
254+
sscanf(str, "%u.%u:%u", &a, &b, &j) != 3)
255255
return -EINVAL;
256256

257257
i = a * MAX_DRIVES + b;
258258

259-
if (i >= MAX_HWIFS * MAX_DRIVES || j < 0 || j > 1)
259+
if (i >= MAX_HWIFS * MAX_DRIVES || j > 1)
260260
return -EINVAL;
261261

262262
if (c > INT_MAX || h > 255 || s > 255)

drivers/ide/it821x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ static void it821x_quirkproc(ide_drive_t *drive)
508508

509509
}
510510

511-
static struct ide_dma_ops it821x_pass_through_dma_ops = {
511+
static const struct ide_dma_ops it821x_pass_through_dma_ops = {
512512
.dma_host_set = ide_dma_host_set,
513513
.dma_setup = ide_dma_setup,
514514
.dma_start = it821x_dma_start,

drivers/ide/trm290.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ static const struct ide_tp_ops trm290_tp_ops = {
314314
.output_data = ide_output_data,
315315
};
316316

317-
static struct ide_dma_ops trm290_dma_ops = {
317+
static const struct ide_dma_ops trm290_dma_ops = {
318318
.dma_host_set = trm290_dma_host_set,
319319
.dma_setup = trm290_dma_setup,
320320
.dma_start = trm290_dma_start,

0 commit comments

Comments
 (0)