Skip to content

Commit fdd7d1f

Browse files
author
Steve French
committed
cifs: address unused variable warning
Fix trivial unused variable warning (when SMB1 support disabled) "ioctl.c:324:17: warning: variable 'caps' set but not used [-Wunused-but-set-variable]" Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202305250056.oZhsJmdD-lkp@intel.com/ Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 396ac4c commit fdd7d1f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/smb/client/ioctl.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,11 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
321321
struct tcon_link *tlink;
322322
struct cifs_sb_info *cifs_sb;
323323
__u64 ExtAttrBits = 0;
324+
#ifdef CONFIG_CIFS_POSIX
325+
#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
324326
__u64 caps;
327+
#endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */
328+
#endif /* CONFIG_CIFS_POSIX */
325329

326330
xid = get_xid();
327331

@@ -331,9 +335,9 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
331335
if (pSMBFile == NULL)
332336
break;
333337
tcon = tlink_tcon(pSMBFile->tlink);
334-
caps = le64_to_cpu(tcon->fsUnixInfo.Capability);
335338
#ifdef CONFIG_CIFS_POSIX
336339
#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
340+
caps = le64_to_cpu(tcon->fsUnixInfo.Capability);
337341
if (CIFS_UNIX_EXTATTR_CAP & caps) {
338342
__u64 ExtAttrMask = 0;
339343
rc = CIFSGetExtAttr(xid, tcon,

0 commit comments

Comments
 (0)