From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luc Van Oostenryck Subject: Re: [PATCH 4/9] add helpers for pseudo's user-list's size Date: Tue, 13 Feb 2018 00:25:33 +0100 Message-ID: <20180212232532.lklvfbht3zaxq5me@ltop.local> References: <20180212220246.17750-1-luc.vanoostenryck@gmail.com> <20180212220246.17750-5-luc.vanoostenryck@gmail.com> <20180212222802.cyr2iwtfjb4pli2o@ltop.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-wm0-f48.google.com ([74.125.82.48]:51174 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932272AbeBLXZg (ORCPT ); Mon, 12 Feb 2018 18:25:36 -0500 Received: by mail-wm0-f48.google.com with SMTP id f71so12587290wmf.0 for ; Mon, 12 Feb 2018 15:25:36 -0800 (PST) Content-Disposition: inline In-Reply-To: <20180212222802.cyr2iwtfjb4pli2o@ltop.local> Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Linus Torvalds Cc: Sparse Mailing-list On Mon, Feb 12, 2018 at 11:28:04PM +0100, Luc Van Oostenryck wrote: > On Mon, Feb 12, 2018 at 02:11:34PM -0800, Linus Torvalds wrote: > > On Mon, Feb 12, 2018 at 2:02 PM, Luc Van Oostenryck > > wrote: > > > Also add has_user(), a wrapper around the above that > > > can directly be used on a pseudo. > > > > You add that wrapper, but then: > > > > > - if (ptr_list_size((struct ptr_list *) *list) == 0) > > > + if (pseudo_user_list_size(*list) == 0) > > > > you don't actually *use* it. That seems pointless. > > Yes, I know it's not ideal. > My intention when I made has_users() was to use it too, > but I also made it to directly take a pseudo as argument > (which is the common case). And then when wanting to use > it I saw that there is pseudo here, only the pseudo_user_list. > So, I had to use the intermediate pseudo_user_list_size() > here instead of has_users(). > > I may change has_users() to take the user list instead > of the pseudo but my mental model was pseudos. I've splitted the patch in two, one with leaving the changes with pseudo_user_list_size() and another one introduncing has_users(). I think that it makes things easier to follow. Thanks for noticing. -- Luc