Skip to content

Commit a347ecb

Browse files
Suresh JayaramanSteve French
authored andcommitted
cifs: use type __u32 instead of int for the oplock parameter
... and avoid implicit casting from a signed type. Also, pass oplock by value instead by reference as we don't intend to change the value in cifs_open_inode_helper(). Thanks to Jeff Layton for spotting this. Reviewed-by: Jeff Layton <jlayton@samba.org> Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> Signed-off-by: Steve French <sfrench@us.ibm.com>
1 parent 899611e commit a347ecb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fs/cifs/file.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ cifs_posix_open_inode_helper(struct inode *inode, struct file *file,
165165

166166
/* all arguments to this function must be checked for validity in caller */
167167
static inline int cifs_open_inode_helper(struct inode *inode,
168-
struct cifsTconInfo *pTcon, int *oplock, FILE_ALL_INFO *buf,
168+
struct cifsTconInfo *pTcon, __u32 oplock, FILE_ALL_INFO *buf,
169169
char *full_path, int xid)
170170
{
171171
struct cifsInodeInfo *pCifsInode = CIFS_I(inode);
@@ -207,11 +207,11 @@ static inline int cifs_open_inode_helper(struct inode *inode,
207207
rc = cifs_get_inode_info(&inode, full_path, buf, inode->i_sb,
208208
xid, NULL);
209209

210-
if ((*oplock & 0xF) == OPLOCK_EXCLUSIVE) {
210+
if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
211211
pCifsInode->clientCanCacheAll = true;
212212
pCifsInode->clientCanCacheRead = true;
213213
cFYI(1, "Exclusive Oplock granted on inode %p", inode);
214-
} else if ((*oplock & 0xF) == OPLOCK_READ)
214+
} else if ((oplock & 0xF) == OPLOCK_READ)
215215
pCifsInode->clientCanCacheRead = true;
216216

217217
return rc;
@@ -365,7 +365,7 @@ int cifs_open(struct inode *inode, struct file *file)
365365
goto out;
366366
}
367367

368-
rc = cifs_open_inode_helper(inode, tcon, &oplock, buf, full_path, xid);
368+
rc = cifs_open_inode_helper(inode, tcon, oplock, buf, full_path, xid);
369369
if (rc != 0)
370370
goto out;
371371

0 commit comments

Comments
 (0)