Re: [PATCH 07/08] staging:dgap: Fix externs should be avoided in .c files as reported by checkpatch
On 03/01/2014 04:57 AM, Mark Hounschell wrote: On 02/28/2014 05:59 PM, Greg KH wrote: On Fri, Feb 28, 2014 at 12:42:14PM -0500, Mark Hounschell wrote: This patch fixes externs should be avoided in .c files in dgap.c as reported by checkpatch Signed-off-by: Mark Hounschell ma...@compro.net --- drivers/staging/dgap/dgap.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index cfa33f9..b3f8c49 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -224,8 +224,8 @@ static void dgap_sysfs_create(struct board_t *brd); static int dgap_firmware_load(struct pci_dev *pdev, int card_type); /* Driver load/unload functions */ -intdgap_init_module(void); -voiddgap_cleanup_module(void); +static int dgap_init_module(void); +static void dgap_cleanup_module(void); module_init(dgap_init_module); module_exit(dgap_cleanup_module); If you just move these module_* lines to the bottom of the file, you shouldn't need the function prototype at all, right? Care to make that change here instead? thanks, I will rework this one. For dgap_init_module that works fine. But since dgap_cleanup_module is actually called from dgap_init_module if things don't go right, I seem to need a function prototype for it. Should I assume this is wrong and dgap_cleanup_module should never actually be called directly? Thanks Mark ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 07/08] staging:dgap: Fix externs should be avoided in .c files as reported by checkpatch
On Mon, Mar 03, 2014 at 08:30:28AM -0500, Mark Hounschell wrote: On 03/01/2014 04:57 AM, Mark Hounschell wrote: On 02/28/2014 05:59 PM, Greg KH wrote: On Fri, Feb 28, 2014 at 12:42:14PM -0500, Mark Hounschell wrote: This patch fixes externs should be avoided in .c files in dgap.c as reported by checkpatch Signed-off-by: Mark Hounschell ma...@compro.net --- drivers/staging/dgap/dgap.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index cfa33f9..b3f8c49 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -224,8 +224,8 @@ static void dgap_sysfs_create(struct board_t *brd); static int dgap_firmware_load(struct pci_dev *pdev, int card_type); /* Driver load/unload functions */ -intdgap_init_module(void); -voiddgap_cleanup_module(void); +static int dgap_init_module(void); +static void dgap_cleanup_module(void); module_init(dgap_init_module); module_exit(dgap_cleanup_module); If you just move these module_* lines to the bottom of the file, you shouldn't need the function prototype at all, right? Care to make that change here instead? thanks, I will rework this one. For dgap_init_module that works fine. But since dgap_cleanup_module is actually called from dgap_init_module if things don't go right, I seem to need a function prototype for it. Should I assume this is wrong and dgap_cleanup_module should never actually be called directly? It needs to be called directly. Just do the one forward declaration for dgap_cleanup_module(). regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 07/08] staging:dgap: Fix externs should be avoided in .c files as reported by checkpatch
On 02/28/2014 05:59 PM, Greg KH wrote: On Fri, Feb 28, 2014 at 12:42:14PM -0500, Mark Hounschell wrote: This patch fixes externs should be avoided in .c files in dgap.c as reported by checkpatch Signed-off-by: Mark Hounschell ma...@compro.net --- drivers/staging/dgap/dgap.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index cfa33f9..b3f8c49 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -224,8 +224,8 @@ static void dgap_sysfs_create(struct board_t *brd); static int dgap_firmware_load(struct pci_dev *pdev, int card_type); /* Driver load/unload functions */ -intdgap_init_module(void); -void dgap_cleanup_module(void); +static int dgap_init_module(void); +static void dgap_cleanup_module(void); module_init(dgap_init_module); module_exit(dgap_cleanup_module); If you just move these module_* lines to the bottom of the file, you shouldn't need the function prototype at all, right? Care to make that change here instead? thanks, I will rework this one. thanks Mark ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/08] staging:dgap: Fix externs should be avoided in .c files as reported by checkpatch
This patch fixes externs should be avoided in .c files in dgap.c as reported by checkpatch Signed-off-by: Mark Hounschell ma...@compro.net --- drivers/staging/dgap/dgap.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index cfa33f9..b3f8c49 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -224,8 +224,8 @@ static void dgap_sysfs_create(struct board_t *brd); static int dgap_firmware_load(struct pci_dev *pdev, int card_type); /* Driver load/unload functions */ -intdgap_init_module(void); -void dgap_cleanup_module(void); +static int dgap_init_module(void); +static void dgap_cleanup_module(void); module_init(dgap_init_module); module_exit(dgap_cleanup_module); @@ -518,7 +518,7 @@ static struct toklist dgap_tlist[] = { * * Module load. This is where it all starts. */ -int dgap_init_module(void) +static int dgap_init_module(void) { int rc = 0; @@ -674,7 +674,7 @@ static void dgap_remove_one(struct pci_dev *dev) * * Module unload. This is where it all ends. */ -void dgap_cleanup_module(void) +static void dgap_cleanup_module(void) { int i; ulong lock_flags; -- 1.8.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 07/08] staging:dgap: Fix externs should be avoided in .c files as reported by checkpatch
On Fri, Feb 28, 2014 at 12:42:14PM -0500, Mark Hounschell wrote: This patch fixes externs should be avoided in .c files in dgap.c as reported by checkpatch Signed-off-by: Mark Hounschell ma...@compro.net --- drivers/staging/dgap/dgap.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index cfa33f9..b3f8c49 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -224,8 +224,8 @@ static void dgap_sysfs_create(struct board_t *brd); static int dgap_firmware_load(struct pci_dev *pdev, int card_type); /* Driver load/unload functions */ -int dgap_init_module(void); -void dgap_cleanup_module(void); +static int dgap_init_module(void); +static void dgap_cleanup_module(void); module_init(dgap_init_module); module_exit(dgap_cleanup_module); If you just move these module_* lines to the bottom of the file, you shouldn't need the function prototype at all, right? Care to make that change here instead? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel