[PATCH] staging: unisys: visorbus: add static declarations
Add static declarations to statisfy sparse warnings in: drivers/staging/unisys/visorbus/visorbus_main.c warning: symbol 'visorbus_debug' was not declared warning: symbol 'visorbus_forcematch' was not declared warning: symbol 'visorbus_forcenomatch' was not declared warning: symbol 'visorbus_devicetest' was not declared warning: symbol 'visorbus_debugref' was not declared warning: symbol 'visorbus_bus_groups' was not declared warning: symbol 'devmajorminor_create_file' was not declared warning: symbol 'devmajorminor_remove_file' was not declared warning: symbol 'devmajorminor_remove_all_files' was not declared warning: symbol 'unregister_devmajorminor_attributes' was not declared Signed-off-by: Drew Fustini --- drivers/staging/unisys/visorbus/visorbus_main.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index a898896..00f9a14 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -28,12 +28,12 @@ #define MYDRVNAME "visorbus" /* module parameters */ -int visorbus_debug; -int visorbus_forcematch; -int visorbus_forcenomatch; +static int visorbus_debug; +static int visorbus_forcematch; +static int visorbus_forcenomatch; #define MAXDEVICETEST 4 -int visorbus_devicetest; -int visorbus_debugref; +static int visorbus_devicetest; +static int visorbus_debugref; #define SERIALLOOPBACKCHANADDR (100 * 1024 * 1024) /** This is the private data that we store for each bus device instance. @@ -79,7 +79,7 @@ static const struct attribute_group visorbus_bus_group = { .attrs = visorbus_bus_attrs, }; -const struct attribute_group *visorbus_bus_groups[] = { +static const struct attribute_group *visorbus_bus_groups[] = { &visorbus_bus_group, NULL, }; @@ -282,7 +282,7 @@ devmajorminor_attr_store(struct kobject *kobj, static int register_devmajorminor_attributes(struct visor_device *dev); -int +static int devmajorminor_create_file(struct visor_device *dev, const char *name, int major, int minor) { @@ -327,7 +327,7 @@ away: return rc; } -void +static void devmajorminor_remove_file(struct visor_device *dev, int slot) { int maxdevnodes = ARRAY_SIZE(dev->devnodes) / sizeof(dev->devnodes[0]); @@ -344,7 +344,7 @@ devmajorminor_remove_file(struct visor_device *dev, int slot) kfree(myattr); } -void +static void devmajorminor_remove_all_files(struct visor_device *dev) { int i = 0; @@ -384,7 +384,7 @@ away: return rc; } -void +static void unregister_devmajorminor_attributes(struct visor_device *dev) { if (!dev->kobjdevmajorminor.parent) @@ -1797,26 +1797,21 @@ visorbus_exit(void) module_param_named(debug, visorbus_debug, int, S_IRUGO); MODULE_PARM_DESC(visorbus_debug, "1 to debug"); -int visorbus_debug = 0; module_param_named(forcematch, visorbus_forcematch, int, S_IRUGO); MODULE_PARM_DESC(visorbus_forcematch, "1 to force a successful dev <--> drv match"); -int visorbus_forcematch = 0; module_param_named(forcenomatch, visorbus_forcenomatch, int, S_IRUGO); MODULE_PARM_DESC(visorbus_forcenomatch, "1 to force an UNsuccessful dev <--> drv match"); -int visorbus_forcenomatch = 0; module_param_named(devicetest, visorbus_devicetest, int, S_IRUGO); MODULE_PARM_DESC(visorbus_devicetest, "non-0 to just test device creation and destruction"); -int visorbus_devicetest = 0; module_param_named(debugref, visorbus_debugref, int, S_IRUGO); MODULE_PARM_DESC(visorbus_debugref, "1 to debug reference counting"); -int visorbus_debugref = 0; MODULE_AUTHOR("Unisys"); MODULE_LICENSE("GPL"); -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: unisys: visorbus: add static declarations
On Mon, Jun 01, 2015 at 02:34:16PM -0400, Ben Romer wrote: > Would you mind if I sent a second version of this patch with it > rebased against my last set of patches, so it will apply? Please go ahead. thanks, drew ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] 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". Signed-off-by: Drew Fustini --- 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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: fbtft: move externs to header file
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: fbtft: add header for internal functions
Remove extern keyword from function prototypes to suppress warning from checkpatch.pl with --strict option: https://lkml.org/lkml/2013/7/23/422 fbtft maintainer Noralf Tronnes advised these functions are internal to this module & suggested moving these prototypes to new internal.h file. He also advised fbtft.h file will eventually live in include/linux/fbtft.h Suggested-by: Noralf Trønnes Signed-off-by: Drew Fustini --- drivers/staging/fbtft/fbtft-core.c | 7 +-- drivers/staging/fbtft/internal.h | 25 + 2 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 drivers/staging/fbtft/internal.h diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index e8d8d07..dfaeadd 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -41,12 +41,7 @@ #include #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); +#include "internal.h" static unsigned long debug; module_param(debug, ulong, 0); diff --git a/drivers/staging/fbtft/internal.h b/drivers/staging/fbtft/internal.h new file mode 100644 index 000..f69db82 --- /dev/null +++ b/drivers/staging/fbtft/internal.h @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2013 Noralf Tronnes + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef __LINUX_FBTFT__INTERNAL_H +#define __LINUX_FBTFT_INTERNAL_H + +void fbtft_sysfs_init(struct fbtft_par *par); +void fbtft_sysfs_exit(struct fbtft_par *par); +void fbtft_expand_debug_value(unsigned long *debug); +int fbtft_gamma_parse_str(struct fbtft_par *par, unsigned long *curves, + const char *str, int size); + +#endif /* __LINUX_FBTFT_INTERNAL_H */ -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: fbtft: move externs to header file
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel