Re: [patch 13/20] chardev: GPIO for PC8736x: finally!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/13/06, Jesper Juhl <jesper.juhl@xxxxxxxxx> wrote:
> +static void pc8736x_gpio_set_high(unsigned index)
> +{
> +       pc8736x_gpio_set(index, 1);
> +}
> +
> +static void pc8736x_gpio_set_low(unsigned index)
> +{
> +       pc8736x_gpio_set(index, 0);
> +}
> +
> +static int pc8736x_gpio_current(unsigned index)
> +{
> +       printk(KERN_WARNING NAME ": pc8736x_gpio_current unimplemented\n");
> +       return 0;
> +}
> +
> +static void pc8736x_gpio_change(unsigned index)
> +{
> +       pc8736x_gpio_set(index, !pc8736x_gpio_get(index));
> +}
> +

Perhaps make these inline?
Dunno if it'll make sense, but they just look like obvious inline candidates :)

I've seen recent threads about inline functions being used excessively
in the kernel and at least a couple of the core developers would like
to see them all removed.

See http://lwn.net/Articles/166182/ for one example thread.

Apparently new versions of GCC will inline automatically if you put
the static function definitions above their first usage.  (I'm sure
someone will correct me if I have that wrong.)  I did not find a msg
about that, but I'm pretty sure I've seen Cristoph Hellwig make that
point before in his reviews.

OTOH, the above do seem like perfect candidates for inlining.

Also, why the return 0 in the below (cut and pasted from above.)
Seems like it should be a void return.
> +static int pc8736x_gpio_current(unsigned index)
> +{
> +       printk(KERN_WARNING NAME ": pc8736x_gpio_current unimplemented\n");
> +       return 0;
> +}

Greg
--
Greg Freemyer
The Norcross Group
Forensics for the 21st Century

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux