Skip to contentSkip to conversation

cifsd: convert list_for_each to entry variant in smb_common.c

PATCH New Baokun Li 1 participant 1 message Jun 17, 2021

Subsystems (3)
lore
Share & tools
lore

Baokun Li

author
#0 lore raw

PATCH 1/1 cifsd: convert list_for_each to entry variant in smb_common.c

convert list_for_each() to list_for_each_entry() where applicable.

---
 fs/cifsd/smb_common.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/cifsd/smb_common.c +1 -3
index 039030968b50..d74b2ce08187 100644
@@ -481,15 +481,13 @@ int ksmbd_smb_check_shared_mode(struct file *filp, struct ksmbd_file *curr_fp)
 {
 	int rc = 0;
 	struct ksmbd_file *prev_fp;
-	struct list_head *cur;
 
 	/*
 	 * Lookup fp in master fp list, and check desired access and
 	 * shared mode between previous open and current open.
 	 */
 	read_lock(&curr_fp->f_ci->m_lock);
-	list_for_each(cur, &curr_fp->f_ci->m_fp_list) {
-		prev_fp = list_entry(cur, struct ksmbd_file, node);
+	list_for_each_entry(prev_fp, &curr_fp->f_ci->m_fp_list, node) {
 		if (file_inode(filp) != FP_INODE(prev_fp))
 			continue;