tech-kern archive

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

Re: Support for multi-position electro-mechanical keylocks




Am 03.08.2009 um 16:58 schrieb Peter Seebach:

In message <7FA34163-C54B-435C-B147-DA2BBE06F848%msys.ch@localhost>, Marc Balmer writes:

Am 03.08.2009 um 16:23 schrieb David Holland:

On Mon, Aug 03, 2009 at 03:45:34AM +0000, David Holland wrote:
On Sun, Aug 02, 2009 at 11:54:09AM +0200, Marc Balmer wrote:
While preparing a hardware workshop and playing with multi- position
keylocks, [...]

+       int                     __map[GPIOLOCK_MAXPINS];

Er. That was supposed to say "why the underscores?"

They are in the original code.  So why not?

As a general rule, you shouldn't prefix things with underscores in C.
(C9x 7.1.3:  "All identifiers that begin with an underscore and
either an uppercase letter or another underscore are always reserved
for any use.")

The variable __map is a "hidden" variable that is not used in the driver itself, it rather provides the memory for the pinmap to the gpio subsystem, i.e. it's for private gpio(4) usage. It is done like this in all GPIO drivers.

- Marc Balmer




Home | Main Index | Thread Index | Old Index