tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: GPIO revisited
In article <AB3ED0B6-9744-4768-9776-0CEC53012ABD%msys.ch@localhost>,
Marc Balmer <marc%msys.ch@localhost> wrote:
>One more comment...
>
>> +int gpio_pinbyname(struct gpio_softc *, char *gp_name);
>> +
>> +/* Old API version */
>> +int gpio_ioctl_oapi(struct gpio_softc *, u_long cmd, void *data,
>> int flag,
>> + int pinset);
>>
>> KNF: no variables names in the declaration.
>> Also, any reason why these are not static?
>
>While it certainly can make sense to declare functions static in some
>userland programs for the sole reason to include a command in a
>crunched binary, it does not make sense in kernel code; much to the
>contrary, it makes debugging harder.
Depends on how you are debugging. Id does not help with ddb, and
it can produce bogus stack traces. But it is easy enough to compile
with -Dstatic or change the code, and it is nice to have one
consistent rule for both kernel and userlend. The thuth is that we
have not been enforcing static in the kernel, and there are lots
of non-static functions that could be static. Another advantage of
static functions is that the compiler can inline them.
christos
Home |
Main Index |
Thread Index |
Old Index