Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e3d7db5 authored by Tobias Klauser's avatar Tobias Klauser Committed by Greg Kroah-Hartman
Browse files

[PATCH] i2c: Use ARRAY_SIZE macro



Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]). Some trailing
whitespaces are also removed.

Signed-off-by: default avatarTobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8104a9a9
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -121,10 +121,7 @@ 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;
	}
+2 −5
Original line number Diff line number Diff line
@@ -241,10 +241,7 @@ 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;
	}
+1 −1
Original line number Diff line number Diff line
@@ -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);