diff mbox series

[-next] cifsd: convert list_for_each to entry variant in vfs_cache.c

Message ID 20210617064422.3191764-1-libaokun1@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] cifsd: convert list_for_each to entry variant in vfs_cache.c | expand

Commit Message

Baokun Li June 17, 2021, 6:44 a.m. UTC
convert list_for_each() to list_for_each_entry() where
applicable in vfs_cache.c.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
 fs/cifsd/vfs_cache.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/fs/cifsd/vfs_cache.c b/fs/cifsd/vfs_cache.c
index 6ea09fe82814..57044b189531 100644
--- a/fs/cifsd/vfs_cache.c
+++ b/fs/cifsd/vfs_cache.c
@@ -472,15 +472,13 @@  struct ksmbd_file *ksmbd_lookup_fd_inode(struct inode *inode)
 {
 	struct ksmbd_file	*lfp;
 	struct ksmbd_inode	*ci;
-	struct list_head	*cur;
 
 	ci = ksmbd_inode_lookup_by_vfsinode(inode);
 	if (!ci)
 		return NULL;
 
 	read_lock(&ci->m_lock);
-	list_for_each(cur, &ci->m_fp_list) {
-		lfp = list_entry(cur, struct ksmbd_file, node);
+	list_for_each_entry(lfp, &ci->m_fp_list, node) {
 		if (inode == FP_INODE(lfp)) {
 			atomic_dec(&ci->m_count);
 			read_unlock(&ci->m_lock);