From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 6E3EB1F66F for ; Tue, 10 Nov 2020 19:52:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730618AbgKJTwU (ORCPT ); Tue, 10 Nov 2020 14:52:20 -0500 Received: from cloud.peff.net ([104.130.231.41]:53248 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726467AbgKJTwU (ORCPT ); Tue, 10 Nov 2020 14:52:20 -0500 Received: (qmail 8966 invoked by uid 109); 10 Nov 2020 19:52:20 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 10 Nov 2020 19:52:20 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 4482 invoked by uid 111); 10 Nov 2020 19:52:19 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Tue, 10 Nov 2020 14:52:19 -0500 Authentication-Results: peff.net; auth=none Date: Tue, 10 Nov 2020 14:52:19 -0500 From: Jeff King To: Christian Couder Cc: Anders Waldenborg , git , Jonathan Tan Subject: Re: [PATCH 05/21] trailer: rename 'free_all' to 'free_all_trailer_items' Message-ID: <20201110195219.GB1987088@coredump.intra.peff.net> References: <20201025212652.3003036-1-anders@0x63.nu> <20201025212652.3003036-6-anders@0x63.nu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Mon, Oct 26, 2020 at 01:42:25PM +0100, Christian Couder wrote: > > No functional change intended. > > This doesn't explain much why renaming 'free_all' to > 'free_all_trailer_items' is a good idea. Is the function specific to > trailer items or is it generic enough to be useful on other 'struct > list_head *head'? It can't be generic, because list_head needs to use the expected containing type to find the containing pointer. So free_all() is quite a bad name, even within trailer.c, because the compiler won't even tell you if you pass a different list to it. I do agree this should be spelled out in the commit message, though. :) -Peff