Coding style questions
1. When you have a function prototype with a comment following it (which obviously it's a bad thing), like this one
u32 eprom_read(struct net_device *dev,u32 addr); //reads a 16 bits word
and want to fix it, how would one do it:
/* Read a 16 bits word. */
u32 eprom_read(struct net_device *dev, u32 addr);
or the comment should go into the implementation file ?
2. What's the kernel code style about header guards ? As far as I've seen, it's usual to do:
#ifndef HEADER_H
#define HEADER_H
and not:
#infdef _HEADER_H
#define _HEADER_H
or other variations. Does it even matter?
Thanks,
Radu.
Quoted 10 lines · Radu Voicilas
1. When you have a function prototype with a comment following it (which obviously it's a bad thing), like this one
u32
eprom_read(struct net_device *dev,u32 addr); //reads a 16 bits wordand want to fix it, how would one do it:
/* Read a 16 bits word. */
u32eprom_read(struct net_device *dev, u32 addr);or the comment should go into the implementation file ?
It should go in the implementation file, but common sense is always best. Be sure to read Documentation/CodingStyle.
Davidlohr