On Tue, Sep 21, 2010 at 03:19, real mz wrote: > On Tue, Sep 21, 2010 at 2:55 PM, Mike Frysinger <[email protected]> wrote: >> On Thu, Sep 16, 2010 at 23:03, <[email protected]> wrote: >>> +int portmuxgroup_check(unsigned short per) >>> +{ >>> + u16 m, ident, pfunc; >>> + s8 offset; >>> + u16 function = P_FUNCT2MUX(per); >>> + offset = port_mux[P_IDENT(per)]; >>> + ident = P_IDENT(per); >>> + for (m = 0; m < ARRAY_SIZE(port_mux); m++) { >>> + if (m == ident) >>> + continue; >>> + if (port_mux[m] == offset) { >> >> taking another look at this chunk for the BF537 ... why do you need to >> loop over the indices of port_mux when you will only ever look at >> port_mux[m] when m == ident ? isnt the for loop useless when you >> already know the one index you're going to check ? > > port_mux[] can perform index => offset look up, but here I want to get > the offset => index(pins in one mux group has the same offset), so I > need a for loop to find the indexes of one group.
sorry, i'm stupid. i was thinking the code read "if (m != ident)" when clearly that is not the case. -mike _______________________________________________ Linux-kernel-commits mailing list [email protected] https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits
