mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cifs: hide unused functions
@ 2017-06-27 15:06 Arnd Bergmann
  2017-06-28  5:00 ` Steve French
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2017-06-27 15:06 UTC (permalink / raw)
  To: Steve French
  Cc: Shirish Pargaonkar, Pavel Shilovsky, Arnd Bergmann,
	Sachin Prabhu, Aurelien Aptel, linux-cifs, samba-technical,
	linux-kernel

Some functions are only referenced under an #ifdef, causing a harmless
warning:

fs/cifs/smb2ops.c:1374:1: error: 'get_smb2_acl' defined but not used [-Werror=unused-function]

We could mark them __maybe_unused or add another #ifdef, I picked
the second approach here.

Fixes: b3fdda4d1e1b ("cifs: Use smb 2 - 3 and cifsacl mount options getacl functions")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/cifs/smb2ops.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 06494e11c570..941c40b7a870 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -1288,6 +1288,7 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon,
 	return rc;
 }
 
+#ifdef CONFIG_CIFS_ACL
 static struct cifs_ntsd *
 get_smb2_acl_by_fid(struct cifs_sb_info *cifs_sb,
 		const struct cifs_fid *cifsfid, u32 *pacllen)
@@ -1387,7 +1388,7 @@ get_smb2_acl(struct cifs_sb_info *cifs_sb,
 	cifsFileInfo_put(open_file);
 	return pntsd;
 }
-
+#endif
 
 static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,
 			    loff_t offset, loff_t len, bool keep_size)
-- 
2.9.0

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH] cifs: hide unused functions
@ 2017-09-05  9:24 Arnd Bergmann
  2017-09-10 10:28 ` Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2017-09-05  9:24 UTC (permalink / raw)
  To: Steve French
  Cc: Arnd Bergmann, Pavel Shilovsky, Sachin Prabhu, Aurelien Aptel,
	Ronnie Sahlberg, linux-cifs, samba-technical, linux-kernel

The newly added SMB2+ attribute support causes unused function
warnings when CONFIG_CIFS_XATTR is disabled:

fs/cifs/smb2ops.c:563:1: error: 'smb2_set_ea' defined but not used [-Werror=unused-function]
 smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
fs/cifs/smb2ops.c:513:1: error: 'smb2_query_eas' defined but not used [-Werror=unused-function]
 smb2_query_eas(const unsigned int xid, struct cifs_tcon *tcon,

This adds another #ifdef around the affected functions.

Fixes: 5517554e4313 ("cifs: Add support for writing attributes on SMB2+")
Fixes: 95907fea4fd8 ("cifs: Add support for reading attributes on SMB2+")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/cifs/smb2ops.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index fb2934b9b97c..6cd91670ba2d 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -426,6 +426,7 @@ smb2_query_file_info(const unsigned int xid, struct cifs_tcon *tcon,
 	return rc;
 }
 
+#ifdef CONFIG_CIFS_XATTR
 static ssize_t
 move_smb2_ea_to_cifs(char *dst, size_t dst_size,
 		     struct smb2_file_full_ea_info *src, size_t src_size,
@@ -613,6 +614,7 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
 
 	return rc;
 }
+#endif
 
 static bool
 smb2_can_echo(struct TCP_Server_Info *server)
-- 
2.9.0

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

end of thread, other threads:[~2017-09-17 22:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-27 15:06 [PATCH] cifs: hide unused functions Arnd Bergmann
2017-06-28  5:00 ` Steve French
2017-09-05  9:24 Arnd Bergmann
2017-09-10 10:28 ` Geert Uytterhoeven
2017-09-17 22:03   ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®