Commit e7e60e8b authored by ChenXiaoSong's avatar ChenXiaoSong Committed by Steve French
Browse files

smb: fix some warnings reported by scripts/checkpatch.pl



Fix the following warnings:

  WARNING: __always_unused or __maybe_unused is preferred over \
                                    __attribute__((__unused__))
  WARNING: Prefer __packed over __attribute__((packed))

Signed-off-by: default avatarChenXiaoSong <chenxiaosong@kylinos.cn>
Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 95e8c1bf
Loading
Loading
Loading
Loading
+125 −125

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -2312,8 +2312,8 @@ cifs_set_cifscreds(struct smb3_fs_context *ctx, struct cifs_ses *ses)
}
#else /* ! CONFIG_KEYS */
static inline int
cifs_set_cifscreds(struct smb3_fs_context *ctx __attribute__((unused)),
		   struct cifs_ses *ses __attribute__((unused)))
cifs_set_cifscreds(struct smb3_fs_context *ctx __maybe_unused,
		   struct cifs_ses *ses __maybe_unused)
{
	return -ENOSYS;
}
+4 −4
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ typedef struct _SECURITY_BUFFER {
	__le16 Length;
	__le16 MaximumLength;
	__le32 BufferOffset;	/* offset to buffer */
} __attribute__((packed)) SECURITY_BUFFER;
} __packed SECURITY_BUFFER;

typedef struct _NEGOTIATE_MESSAGE {
	__u8 Signature[sizeof(NTLMSSP_SIGNATURE)];
@@ -85,7 +85,7 @@ typedef struct _NEGOTIATE_MESSAGE {
	   do not set the version is present flag */
	char DomainString[];
	/* followed by WorkstationString */
} __attribute__((packed)) NEGOTIATE_MESSAGE, *PNEGOTIATE_MESSAGE;
} __packed NEGOTIATE_MESSAGE, *PNEGOTIATE_MESSAGE;

#define NTLMSSP_REVISION_W2K3 0x0F

@@ -121,7 +121,7 @@ typedef struct _CHALLENGE_MESSAGE {
	SECURITY_BUFFER TargetInfoArray;
	/* SECURITY_BUFFER for version info not present since we
	   do not set the version is present flag */
} __attribute__((packed)) CHALLENGE_MESSAGE, *PCHALLENGE_MESSAGE;
} __packed CHALLENGE_MESSAGE, *PCHALLENGE_MESSAGE;

typedef struct _AUTHENTICATE_MESSAGE {
	__u8 Signature[sizeof(NTLMSSP_SIGNATURE)];
@@ -136,7 +136,7 @@ typedef struct _AUTHENTICATE_MESSAGE {
	struct	ntlmssp_version Version;
	/* SECURITY_BUFFER */
	char UserString[];
} __attribute__((packed)) AUTHENTICATE_MESSAGE, *PAUTHENTICATE_MESSAGE;
} __packed AUTHENTICATE_MESSAGE, *PAUTHENTICATE_MESSAGE;

/*
 * Size of the session key (crypto key encrypted with the password
+4 −4
Original line number Diff line number Diff line
@@ -33,17 +33,17 @@ struct rfc1002_session_packet {
			__u8 calling_len;
			__u8 calling_name[32];
			__u8 scope2; /* null */
		} __attribute__((packed)) session_req;
		} __packed session_req;
		struct {
			__be32 retarget_ip_addr;
			__be16 port;
		} __attribute__((packed)) retarget_resp;
		} __packed retarget_resp;
		__u8 neg_ses_resp_error_code;
		/* POSITIVE_SESSION_RESPONSE packet does not include trailer.
		SESSION_KEEP_ALIVE packet also does not include a trailer.
		Trailer for the SESSION_MESSAGE packet is SMB/CIFS header */
	} __attribute__((packed)) trailer;
} __attribute__((packed));
	} __packed trailer;
} __packed;

/* Negative Session Response error codes */
#define RFC1002_NOT_LISTENING_CALLED  0x80 /* not listening on called name */
+4 −4
Original line number Diff line number Diff line
@@ -92,14 +92,14 @@ struct smb_ntsd {
	__le32 gsidoffset;
	__le32 sacloffset;
	__le32 dacloffset;
} __attribute__((packed));
} __packed;

struct smb_sid {
	__u8 revision; /* revision level */
	__u8 num_subauth;
	__u8 authority[NUM_AUTHS];
	__le32 sub_auth[SID_MAX_SUB_AUTHORITIES]; /* sub_auth[num_subauth] */
} __attribute__((packed));
} __packed;

/* size of a struct smb_sid, sans sub_auth array */
#define CIFS_SID_BASE_SIZE (1 + 1 + NUM_AUTHS)
@@ -109,7 +109,7 @@ struct smb_acl {
	__le16 size;
	__le16 num_aces;
	__le16 reserved;
} __attribute__((packed));
} __packed;

struct smb_ace {
	__u8 type; /* see above and MS-DTYP 2.4.4.1 */
@@ -117,6 +117,6 @@ struct smb_ace {
	__le16 size;
	__le32 access_req;
	struct smb_sid sid; /* ie UUID of user or group who gets these perms */
} __attribute__((packed));
} __packed;

#endif /* _COMMON_SMBACL_H */