Skip to contentSkip to conversation

CIFS: Remove __exit mark from cifs_exit_dns_resolver()

PATCH New Michael Neuling 2 participants 4 messages Aug 3, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CIFS: Remove __exit mark from cifs_exit_dns_resolver()

From: David Howells <[email protected]>

commit 51c20fcced5badee0e2021c6c89f44aa3cbd72aa

CIFS: Remove __exit mark from cifs_exit_dns_resolver()

Remove the __exit mark from cifs_exit_dns_resolver() as it's called by the module init routine in case of error, and so may have been discarded during linkage.

---
This fixes a compile error on ppc64 allmodconfig with 2.6.32.17

fs/cifs/dns_resolve.h:28: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'cifs_exit_dns_resolver

fs/cifs/dns_resolve.c +1 -1
Index: linux-2.6-ozlabs/fs/cifs/dns_resolve.c
===================================================================
@@ -226,7 +226,7 @@ failed_put_cred:
 	return ret;
 }
 
-void __exit cifs_exit_dns_resolver(void)
+void cifs_exit_dns_resolver(void)
 {
 	key_revoke(dns_resolver_cache->thread_keyring);
 	unregister_key_type(&key_type_dns_resolver);
fs/cifs/dns_resolve.h +1 -1
Index: linux-2.6-ozlabs/fs/cifs/dns_resolve.h
===================================================================
@@ -25,7 +25,7 @@
 
 #ifdef __KERNEL__
 extern int __init cifs_init_dns_resolver(void);
-extern void __exit cifs_exit_dns_resolver(void);
+extern void cifs_exit_dns_resolver(void);
 extern int dns_resolve_server_name_to_ip(const char *unc, char **ip_addr);
 #endif /* KERNEL */
 
#1 lore raw

PATCH 1/1 CIFS: Remove __exit mark from cifs_init_dns_resolver() header

An allmodconfig compile on ppc64 with 2.6.32.17 currently gives this error

fs/cifs/dns_resolve.h:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'cifs_init_dns_resolver'

This removes the __init from cifs_init_dns_resolver()

fs/cifs/dns_resolve.h +1 -1
Index: linux-2.6-ozlabs/fs/cifs/dns_resolve.h
===================================================================
@@ -24,7 +24,7 @@
 #define _DNS_RESOLVE_H
 
 #ifdef __KERNEL__
-extern int __init cifs_init_dns_resolver(void);
+extern int cifs_init_dns_resolver(void);
 extern void cifs_exit_dns_resolver(void);
 extern int dns_resolve_server_name_to_ip(const char *unc, char **ip_addr);
 #endif /* KERNEL */
#2 lore raw

Re: [PATCH 2.6.32/stable] CIFS: Remove __exit mark from cifs_init_dns_resolver() header

Quoted 5 lines · Michael Neuling

An allmodconfig compile on ppc64 with 2.6.32.17 currently gives this error

fs/cifs/dns_resolve.h:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'cifs_init_dns_resolver'

This removes the __init from cifs_init_dns_resolver()

That's not really a good idea as the assembler may choose different pieces of assembly to do variable references and jumps, depending on the section information.

A better fix is to add:

	#include <linux/module.h>

to the header file.

David

#3 lore raw

PATCH 1/1 CIFS: Fix compile error with __init in cifs_init_dns_resolver() definition

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 3 lines · Michael Neuling

An allmodconfig compile on ppc64 with 2.6.32.17 currently gives this error

fs/cifs/dns_resolve.h:27: error: expected '=', ',', ';', 'asm' or '__attrib

ute__' before 'cifs_init_dns_resolver'

Quoted 7 lines
Quoted 2 lines

This removes the __init from cifs_init_dns_resolver()

That's not really a good idea as the assembler may choose different pieces of assembly to do variable references and jumps, depending on the section information.

Quoted 5 lines

A better fix is to add:

	#include <linux/module.h>

to the header file.

Ok, new patch below.

CIFS: Fix compile error with __init in cifs_init_dns_resolver() definition

An allmodconfig compile on ppc64 with 2.6.32.17 currently gives this error

fs/cifs/dns_resolve.h:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'cifs_init_dns_resolver'

This adds the correct header file to fix this.

fs/cifs/dns_resolve.h +2 -0
Index: linux-2.6-ozlabs/fs/cifs/dns_resolve.h
===================================================================
@@ -24,6 +24,8 @@
 #define _DNS_RESOLVE_H
 
 #ifdef __KERNEL__
+#include <linux/module.h>
+
 extern int __init cifs_init_dns_resolver(void);
 extern void cifs_exit_dns_resolver(void);
 extern int dns_resolve_server_name_to_ip(const char *unc, char **ip_addr);