Skip to content

Commit 289ebd9

Browse files
namjaejeonsmfrench
authored andcommitted
ksmbd: fix warning: comparison of distinct pointer types lacks a cast
smb2pdu.c: In function ‘smb2_open’: ./include/linux/minmax.h:20:28: warning: comparison of distinct pointer types lacks a cast 20 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) | ^~ ./include/linux/minmax.h:26:4: note: in expansion of macro ‘__typecheck’ 26 | (__typecheck(x, y) && __no_side_effects(x, y)) | ^~~~~~~~~~~ ./include/linux/minmax.h:36:24: note: in expansion of macro ‘__safe_cmp’ 36 | __builtin_choose_expr(__safe_cmp(x, y), \ | ^~~~~~~~~~ ./include/linux/minmax.h:45:19: note: in expansion of macro ‘__careful_cmp’ 45 | #define min(x, y) __careful_cmp(x, y, <) | ^~~~~~~~~~~~~ /home/linkinjeon/git/smbd_work/ksmbd/smb2pdu.c:3713:27: note: in expansion of macro ‘min’ 3713 | fp->durable_timeout = min(dh_info.timeout, Fixes: c8efcc7 ("ksmbd: add support for durable handles v1/v2") Signed-off-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 4e0373f commit 289ebd9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

fs/smb/server/smb2pdu.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3531,8 +3531,9 @@ int smb2_open(struct ksmbd_work *work)
35313531
memcpy(fp->create_guid, dh_info.CreateGuid,
35323532
SMB2_CREATE_GUID_SIZE);
35333533
if (dh_info.timeout)
3534-
fp->durable_timeout = min(dh_info.timeout,
3535-
DURABLE_HANDLE_MAX_TIMEOUT);
3534+
fp->durable_timeout =
3535+
min_t(unsigned int, dh_info.timeout,
3536+
DURABLE_HANDLE_MAX_TIMEOUT);
35363537
else
35373538
fp->durable_timeout = 60;
35383539
}

fs/smb/server/vfs_cache.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ struct ksmbd_file {
100100
struct list_head blocked_works;
101101
struct list_head lock_list;
102102

103-
int durable_timeout;
104-
int durable_scavenger_timeout;
103+
unsigned int durable_timeout;
104+
unsigned int durable_scavenger_timeout;
105105

106106
/* if ls is happening on directory, below is valid*/
107107
struct ksmbd_readdir_data readdir_data;

0 commit comments

Comments
 (0)