Re: [PATCH -next] cifs: convert list_for_each to entry variant in smb2misc.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you for your advice.

I'm about to send a patch v2 with the changes suggested by you.

Best Regards.


在 2021/6/17 22:17, Dan Carpenter 写道:
On Thu, Jun 17, 2021 at 09:22:50PM +0800, Baokun Li wrote:
@@ -628,9 +624,7 @@ smb2_is_valid_lease_break(char *buffer)
/* look up tcon based on tid & uid */
  	spin_lock(&cifs_tcp_ses_lock);
-	list_for_each(tmp, &cifs_tcp_ses_list) {
-		server = list_entry(tmp, struct TCP_Server_Info, tcp_ses_list);
-
+	list_for_each_entry(server, &cifs_tcp_ses_list, tcp_ses_list) {
  		list_for_each(tmp1, &server->smb_ses_list) {
  			ses = list_entry(tmp1, struct cifs_ses, smb_ses_list);
                         ^^^^^^^^^^^^^^^^

Please convert this one as well.

@@ -687,7 +681,7 @@ bool
  smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
  {
  	struct smb2_oplock_break *rsp = (struct smb2_oplock_break *)buffer;
-	struct list_head *tmp, *tmp1, *tmp2;
+	struct list_head *tmp1, *tmp2;
  	struct cifs_ses *ses;
  	struct cifs_tcon *tcon;
  	struct cifsInodeInfo *cinode;
@@ -710,9 +704,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
/* look up tcon based on tid & uid */
  	spin_lock(&cifs_tcp_ses_lock);
-	list_for_each(tmp, &server->smb_ses_list) {
-		ses = list_entry(tmp, struct cifs_ses, smb_ses_list);
-
+	list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
  		list_for_each(tmp1, &ses->tcon_list) {
  			tcon = list_entry(tmp1, struct cifs_tcon, tcon_list);
                         ^^^^^^^^^^^^^^^^^
And this one.

regards,
dan carpenter

.



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux