Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753098Ab3FFTc5 (ORCPT ); Thu, 6 Jun 2013 15:32:57 -0400 Received: from mail-ob0-f177.google.com ([209.85.214.177]:42000 "EHLO mail-ob0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752721Ab3FFTcz (ORCPT ); Thu, 6 Jun 2013 15:32:55 -0400 MIME-Version: 1.0 In-Reply-To: <1370280485-10047-2-git-send-email-joern@logfs.org> References: <1370280485-10047-1-git-send-email-joern@logfs.org> <1370280485-10047-2-git-send-email-joern@logfs.org> Date: Thu, 6 Jun 2013 22:32:55 +0300 Message-ID: Subject: Re: [PATCH 1/2] list: add list_for_each_entry_del From: Andy Shevchenko To: Joern Engel Cc: "linux-kernel@vger.kernel.org" , Chris Mason , linux-btrfs@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 680 Lines: 20 On Mon, Jun 3, 2013 at 8:28 PM, Joern Engel wrote: > I have seen a lot of boilerplate code that either follows the pattern of > while (!list_empty(head)) { > pos = list_entry(head->next, struct foo, list); > list_del(pos->list); > ... > } > or some variant thereof. What the problem to use list_for_each_safe()? -- With Best Regards, Andy Shevchenko -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/