linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Staging: fbtft: move externs to header file
@ 2015-03-03 10:19 Drew Fustini
  2015-03-03 11:03 ` Sudip Mukherjee
  2015-03-03 19:04 ` Noralf Trønnes
  0 siblings, 2 replies; 5+ messages in thread
From: Drew Fustini @ 2015-03-03 10:19 UTC (permalink / raw)
  To: Thomas Petazzoni, Noralf Trønnes, Greg Kroah-Hartman
  Cc: devel, linux-kernel

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".

Signed-off-by: Drew Fustini <pdp7pdp7@gmail.com>
---
 drivers/staging/fbtft/fbtft-core.c | 5 -----
 drivers/staging/fbtft/fbtft.h      | 7 +++++++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
index ac4287f..3422faf 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -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);
diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
index 0dbf3f9..9e729e5 100644
--- a/drivers/staging/fbtft/fbtft.h
+++ b/drivers/staging/fbtft/fbtft.h
@@ -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);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Staging: fbtft: move externs to header file
  2015-03-03 10:19 [PATCH] Staging: fbtft: move externs to header file Drew Fustini
@ 2015-03-03 11:03 ` Sudip Mukherjee
  2015-03-03 18:52   ` Drew Fustini
  2015-03-03 19:04 ` Noralf Trønnes
  1 sibling, 1 reply; 5+ messages in thread
From: Sudip Mukherjee @ 2015-03-03 11:03 UTC (permalink / raw)
  To: Drew Fustini
  Cc: Thomas Petazzoni, Noralf Trønnes, Greg Kroah-Hartman, devel,
	linux-kernel

On Tue, Mar 03, 2015 at 04:19:17AM -0600, Drew Fustini wrote:
> 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".

but now it adds 6 additional warning in checkpatch --strict
"extern prototypes should be avoided in .h files"

regards
sudip

> 
> Signed-off-by: Drew Fustini <pdp7pdp7@gmail.com>
> ---

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Staging: fbtft: move externs to header file
  2015-03-03 11:03 ` Sudip Mukherjee
@ 2015-03-03 18:52   ` Drew Fustini
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Fustini @ 2015-03-03 18:52 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Thomas Petazzoni, Noralf Trønnes, Greg Kroah-Hartman, devel,
	linux-kernel

On Tue, Mar 03, 2015 at 04:33:01PM +0530, Sudip Mukherjee wrote:
> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Staging: fbtft: move externs to header file
  2015-03-03 10:19 [PATCH] Staging: fbtft: move externs to header file Drew Fustini
  2015-03-03 11:03 ` Sudip Mukherjee
@ 2015-03-03 19:04 ` Noralf Trønnes
  2015-03-04  8:12   ` Drew Fustini
  1 sibling, 1 reply; 5+ messages in thread
From: Noralf Trønnes @ 2015-03-03 19:04 UTC (permalink / raw)
  To: Drew Fustini, Thomas Petazzoni, Greg Kroah-Hartman; +Cc: devel, linux-kernel


Den 03.03.2015 11:19, skrev Drew Fustini:
> 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".
>
> Signed-off-by: Drew Fustini <pdp7pdp7@gmail.com>
> ---
>   drivers/staging/fbtft/fbtft-core.c | 5 -----
>   drivers/staging/fbtft/fbtft.h      | 7 +++++++
>   2 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
> index ac4287f..3422faf 100644
> --- a/drivers/staging/fbtft/fbtft-core.c
> +++ b/drivers/staging/fbtft/fbtft-core.c
> @@ -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);
> diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
> index 0dbf3f9..9e729e5 100644
> --- a/drivers/staging/fbtft/fbtft.h
> +++ b/drivers/staging/fbtft/fbtft.h
> @@ -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);

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Staging: fbtft: move externs to header file
  2015-03-03 19:04 ` Noralf Trønnes
@ 2015-03-04  8:12   ` Drew Fustini
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Fustini @ 2015-03-04  8:12 UTC (permalink / raw)
  To: Noralf Trønnes
  Cc: Thomas Petazzoni, Greg Kroah-Hartman, devel, linux-kernel

On Tue, Mar 03, 2015 at 08:04:10PM +0100, Noralf Trønnes wrote:
> 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.

Thanks, Noralf.  I have posted a new patch based on your suggestion:
[PATCH] Staging: fbtft: add header for internal functions

Drew

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-04  8:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-03 10:19 [PATCH] Staging: fbtft: move externs to header file Drew Fustini
2015-03-03 11:03 ` Sudip Mukherjee
2015-03-03 18:52   ` Drew Fustini
2015-03-03 19:04 ` Noralf Trønnes
2015-03-04  8:12   ` Drew Fustini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).