Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20011
b: refs/heads/master
c: 7e3d7db
h: refs/heads/master
i:
  20009: ec28b99
  20007: 1212494
v: v3
  • Loading branch information
Tobias Klauser authored and Greg Kroah-Hartman committed Feb 6, 2006
1 parent 2a56a83 commit bf967c0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8104a9a9c9ad8c849d931c46ef6841b23d1fc729
refs/heads/master: 7e3d7db52469f6bcfbfd2d3d00dd17da573facd9
9 changes: 3 additions & 6 deletions trunk/drivers/i2c/busses/i2c-parport-light.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,11 @@ static struct i2c_adapter parport_adapter = {

static int __init i2c_parport_init(void)
{
int type_count;

type_count = sizeof(adapter_parm)/sizeof(struct adapter_parm);
if (type < 0 || type >= type_count) {
if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) {
printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type);
type = 0;
}

if (base == 0) {
printk(KERN_INFO "i2c-parport: using default base 0x%x\n", DEFAULT_BASE);
base = DEFAULT_BASE;
Expand All @@ -152,7 +149,7 @@ static int __init i2c_parport_init(void)
release_region(base, 3);
return -ENODEV;
}

return 0;
}

Expand Down
7 changes: 2 additions & 5 deletions trunk/drivers/i2c/busses/i2c-parport.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,11 @@ static struct parport_driver i2c_parport_driver = {

static int __init i2c_parport_init(void)
{
int type_count;

type_count = sizeof(adapter_parm)/sizeof(struct adapter_parm);
if (type < 0 || type >= type_count) {
if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) {
printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type);
type = 0;
}

return parport_register_driver(&i2c_parport_driver);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/i2c/busses/i2c-pxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ static irqreturn_t i2c_pxa_handler(int this_irq, void *dev_id, struct pt_regs *r
decode_ISR(isr);
}

if (i2c->irqlogidx < sizeof(i2c->isrlog)/sizeof(u32))
if (i2c->irqlogidx < ARRAY_SIZE(i2c->isrlog))
i2c->isrlog[i2c->irqlogidx++] = isr;

show_state(i2c);
Expand Down

0 comments on commit bf967c0

Please sign in to comment.