From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752386AbdJDOkc (ORCPT ); Wed, 4 Oct 2017 10:40:32 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:17815 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752210AbdJDOkb (ORCPT ); Wed, 4 Oct 2017 10:40:31 -0400 Date: Wed, 4 Oct 2017 17:40:12 +0300 From: Dan Carpenter To: Julia Lawall Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org, Srishti Sharma , linux-kernel@vger.kernel.org, outreachy-kernel@googlegroups.com Subject: Re: [Outreachy kernel] Re: [PATCH] Staging: rtl8188eu: core: Use list_for_each_entry_safe Message-ID: <20171004144012.jciztelhwjdyzpwg@mwanda> References: <1507062512-9145-1-git-send-email-srishtishar@gmail.com> <20171004112103.cvu5ipkudfpz2adc@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 04, 2017 at 03:39:30PM +0200, Julia Lawall wrote: > > > On Wed, 4 Oct 2017, Dan Carpenter wrote: > > > On Wed, Oct 04, 2017 at 01:58:32AM +0530, Srishti Sharma wrote: > > > Use list_for_each_entry_safe when the list elements may get deleted > > > during traversal. > > > > This patch is fine as a cleanup but none of these are actually buggy. > > I'm not sure what you are getting at with the comment. The commit doesn't > say that they were buggy. Perhaps the commit message could have been more > verbose, like "Use list operators on list_head values. > List_for_each_entry_safe is needed because the list elements get deleted ^^^^^^^^^ It is not *needed*, the original code works fine. The problem with the original code, is that it's ugly as sin. > during the traversal"? The changelog needs to say *why* we're applying the patch. At first I thought it was going to fix a use after free. What I would prefer in the changelog is something like: "This patch is a cleanup and doesn't change runtime behavior. It changes an open coded list traversal to use list_for_each_entry_safe." regards, dan carpenter