Re: [PATCH 3/4] Fix remaining big endian issue of hfcmulti

From: Benjamin Herrenschmidt
Date: Tue Aug 05 2008 - 17:46:47 EST



> static void
> my_out32(struct card *c, u_int offset, u-int data)
> {
> if (c->mode == MMIO) {
> ...
> } else {
> ...
> }
> }
>
> or use 2 function, one for the MMIO and one for the PIO model and then use
> indirect calls (like c->my_out32(...)) ?

The former is more ugly but slightly faster on some archs.

Indirect function calls tend to be slightly slower than an if / else
statement that can be more easily predicted by the processor.

But in the case of IOs, it's not going to be a big deal, -especially- if
you use the _rep forms for data transfers (and thus don't do an indirect
call for each read/write). So it's totally up to you.

Cheers,
Ben.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/