Staging: fbtft: move externs to header file
Subsystems (2)
PATCH 1/1 Staging: fbtft: move externs to header file
Move extern declartions from fbtft-core.c to fbtft header file. This resovles the warning from checkpatch.pl that "externs should be avoided in .c files".
--- drivers/staging/fbtft/fbtft-core.c | 5 ----- drivers/staging/fbtft/fbtft.h | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-)
drivers/staging/fbtft/fbtft-core.c +0 -5
@@ -42,11 +42,6 @@#include "fbtft.h" -extern void fbtft_sysfs_init (struct fbtft_par *par); -extern void fbtft_sysfs_exit (struct fbtft_par *par); -extern void fbtft_expand_debug_value (unsigned long *debug); -extern int fbtft_gamma_parse_str (struct fbtft_par *par,unsigned long *curves, -const char *str,int size);static unsigned long debug;module_param (debug, ulong,0 );
drivers/staging/fbtft/fbtft.h +7 -0
@@ -277,6 +277,13 @@ extern int fbtft_init_display(struct fbtft_par *par);extern int fbtft_probe_common (struct fbtft_display *display,struct spi_device *sdev,struct platform_device *pdev);extern int fbtft_remove_common (struct device *dev,struct fb_info *info); +extern void fbtft_sysfs_init (struct fbtft_par *par); +extern void fbtft_sysfs_exit (struct fbtft_par *par); +extern void fbtft_expand_debug_value (unsigned long *debug); +extern int fbtft_gamma_parse_str (struct fbtft_par *par,unsigned long *curves, +const char *str,int size); + +/* fbtft-io.c */ extern int fbtft_write_spi (struct fbtft_par *par,void *buf,size_t len);
Signature · 1 line
2.1.4
Quoted 2 lines · Drew Fustini
Move extern declartions from
fbtft-core.cto fbtft header file. This resovles the warning from checkpatch.pl that "externs should be avoided in .c files".
but now it adds 6 additional warning in checkpatch --strict "extern prototypes should be avoided in .h files"
regards
sudip
Quoted 3 lines
Signed-off-by Drew Fustini <[email protected]>---
Quoted 2 lines · Sudip Mukherjee
but now it adds 6 additional warning in checkpatch --strict "extern prototypes should be avoided in .h files"
Thanks, Sudip. I did not realize that was an option for checkpatch. I see now that there are additional warnings as you mentioned:
CHECK: extern prototypes should be avoided in .h files
CHECK: Alignment should match open parenthesis
CHECK: Please don't use multiple blank lines
Drew
Den 03.03.2015 11:19, skrev Drew Fustini:
Quoted 33 lines
Move extern declartions from
fbtft-core.cto fbtft header file. This resovles the warning from checkpatch.pl that "externs should be avoided in .c files".Signed-off-by Drew Fustini <[email protected]>--- drivers/staging/fbtft/fbtft-core.c | 5 ----- drivers/staging/fbtft/fbtft.h | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-)drivers/staging/fbtft/fbtft-core.c +0
-5@@ -42,11 +42,6 @@#include "fbtft.h" -extern void fbtft_sysfs_init (struct fbtft_par *par); -extern void fbtft_sysfs_exit (struct fbtft_par *par); -extern void fbtft_expand_debug_value (unsigned long *debug); -extern int fbtft_gamma_parse_str (struct fbtft_par *par,unsigned long *curves, -const char *str,int size);static unsigned long debug;module_param (debug, ulong,0 );drivers/staging/fbtft/fbtft.h +0
-0@@ -277,6 +277,13 @@ extern int fbtft_init_display(struct fbtft_par *par);extern int fbtft_probe_common (struct fbtft_display *display,struct spi_device *sdev,struct platform_device *pdev);extern int fbtft_remove_common (struct device *dev,struct fb_info *info);
drivers/staging/fbtft/fbtft.h extern int fbtft_init_display(struct fbtft_par *par); · line 289
Quoted 10 lines
drivers/staging/fbtft/fbtft.h +7
-0+extern void fbtft_sysfs_init (struct fbtft_par *par); +extern void fbtft_sysfs_exit (struct fbtft_par *par); +extern void fbtft_expand_debug_value (unsigned long *debug); +extern int fbtft_gamma_parse_str (struct fbtft_par *par,unsigned long *curves, +const char *str,int size); + +/* fbtft-io.c */ extern int fbtft_write_spi (struct fbtft_par *par,void *buf,size_t len);
These functions are defined in fbtft-sysfs.c and internal to the fbtft module. I think it's better to put them in an 'internal.h' file.
The fbtft.h file will eventually live in include/linux/fbtft.h or something like that.
Noralf.
Quoted 5 lines · Noralf Trønnes
These functions are defined in
fbtft-sysfs.cand internal to the fbtft module.
I think it's better to put them in an 'internal.h' file. Thefbtft.hfile will eventually live ininclude/linux/fbtft.hor something like that.
Thanks, Noralf. I have posted a new patch based on your suggestion:
[PATCH] Staging: fbtft: add header for internal functions
Drew