
On 09/05/2011 05:48 PM, Fabio Estevam wrote:
On Mon, Sep 5, 2011 at 12:40 PM, Marek Vasut marek.vasut@gmail.com wrote: ...
Hi Fabio,
./scripts/checkpatch.pl -F u-boot/board/karo/tx25/tx25.c .... WARNING: externs should be avoided in .c files #144: FILE: home/fabio/denx/u-boot/board/karo/tx25/tx25.c:144:
extern void mx25_uart1_init_pins(void);
But you're using extern in _header_ (.h) file ... so ... why ?
My patch removes the extern from the C file and put it on a header file with other extern's.
The checkpatch warning I showed happens with the original file, and not after my patch is applied.
I think checkpatch warnings because the original file has already some extern. In the most of u-boot code we do not mark the prototypes with extern. I made this simple test - I create a new file (from sys_proto.h) and I run checkpatch on it:
+#ifndef _SYS_PROTO_H_ +#define _SYS_PROTO_H_ + +u32 get_cpu_rev(void); +#define is_soc_rev(rev) ((get_cpu_rev() & 0xFF) - rev) +void sdelay(unsigned long); +void set_chipselect_size(int const); +#endif