Unreliable Guide To Hacking The Linux Kernel | ||
---|---|---|
<<< Previous | Routines and Conventions | Next >>> |
The preferred method of initializing structures is to use designated initialisers, as defined by ISO C99, eg:
static struct block_device_operations opt_fops = { .open = opt_open, .release = opt_release, .ioctl = opt_ioctl, .check_media_change = opt_media_change, }; |
This makes it easy to grep for, and makes it clear which structure fields are set. You should do this because it looks cool.
<<< Previous | Home | Next >>> |
Breaking Compilation | Up | GNU Extensions |