Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3564953pxb; Mon, 30 Aug 2021 05:34:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZQg2DQVDnVg/XDAUj8rNDSiuVej6e56LY6ywPs0wE5R4mJOwPzVRCYdGvdoBfbLGC+ymc X-Received: by 2002:a05:6e02:1288:: with SMTP id y8mr15950543ilq.206.1630326858465; Mon, 30 Aug 2021 05:34:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630326858; cv=none; d=google.com; s=arc-20160816; b=JUi4E/r19Z/PMQ0aaTVdsOQ0jGm5y4zclcCSNhvgqkt/koTeISAMXjZPci2ha+g8y9 9GTxM1dbXIGw2jCq7h6LLyGiAJM2ZKcseOxt5NFS6E3OoFGM12txGr4ZdAuJzCsFGQHi 6dP0ygDCxbzoDh16sX9KVefJygId/1KUDNeet6fGs14wyteKeG814NdCYNoX+tVmHexL TDWgNBdthXesN+cn+jgjEy7n9eJ5GntYGGDrbMYXaJfnpGjjY0hZU+Y/J2gGGLQR8Gmi ORJS+s3EuvWUr3OY4Z8Ke3hNHPxYjtF2h5S7tC8jYhmFp2KS2xhy7dt+5/COQJQhM5KB bX5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aoom/61TeGIcHyH3Ng5RuKd1xExXDX/jXfoirYYjiHU=; b=jI0+o4VL6UDzPYdmyOwLOL15G6D07BEqBBY5ymX7DJHv/h/H4GzfiUZRP7+cJOn36E FcfFa++ufUZYnhtL3S68oew7EBBQfcy1aIdTEk9KG9GEhlsBbDeoSVymqRQaaInHe9c3 snGISYwsgxv0Pj+LGHjVXlisQk75J/jj+SOL0yZNWFgBoKTslLl1CzfmE/lNUOy7n/wJ S8IjC05sRoe+iPrHGJ0re/PAiCjUf1+Q1U77o2u9E7p3keRY8DVrlvkheSGveG7x3KDt THt/BaAPiCsMf+Kh6KCsw7QuQF8mfZsQwpW87V3E3hxS/1/hRHRF5GwM/Df98EqGnr8r fuIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HlcaD79Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j4si13735597ilc.2.2021.08.30.05.34.07; Mon, 30 Aug 2021 05:34:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HlcaD79Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233621AbhH3MeH (ORCPT + 99 others); Mon, 30 Aug 2021 08:34:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:50842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232267AbhH3MeH (ORCPT ); Mon, 30 Aug 2021 08:34:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9AD3D60C40; Mon, 30 Aug 2021 12:33:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630326793; bh=vV+7QnNcsLi7ddrn19KrBeLW/vMy+0JLtPVhL5tRbOk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HlcaD79YuVD6E4snc6M8dEemUht+nc/NxwaoDzP60kuXKC6zG6Ydi3emsqcj02bH8 8k007CSBzgrFoUkX3fmlUSqBqcUz5s0wASf1qdOUp1m68IAgCyKB2vbWwlMgT8DZJD fIh5imSlsfUEO0g9371knT/i95Q+PITkizeR1zWtbDk1oOmMcnT2UefIadUEubfwiq G9BZmfRtJ/WEcH1Vpzz5P5J4cAWyu+Wil9htTcOhDiakLkJoX237X2oeV4O1N7u87O 9DbwP6fHGbV0nq/Ptuqs5iPf+dXip7GB3G92uKWrz7Irka9CeBf2yOAPeUwWmavu4f OaBGc5wwttE3A== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1mKgTJ-00061h-KY; Mon, 30 Aug 2021 14:33:05 +0200 Date: Mon, 30 Aug 2021 14:33:05 +0200 From: Johan Hovold To: Matthew Wilcox Cc: "Fabio M. De Francesco" , Alex Elder , Greg Kroah-Hartman , greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] staging: greybus: Convert uart.c from IDR to XArray Message-ID: References: <20210829092250.25379-1-fmdefrancesco@gmail.com> <2879439.WEJLM9RBEh@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 30, 2021 at 01:16:07PM +0100, Matthew Wilcox wrote: > On Mon, Aug 30, 2021 at 01:52:48PM +0200, Johan Hovold wrote: > > Whether the API is better is debatable. As I said, almost no drivers use > > the new XArray interface, and perhaps partly because the new interface > > isn't as intuitive as has been claimed (e.g. xa_load() instead of > > ida_find()). And IDR/IDA isn't marked/documented as deprecated as far as > > I know. > > I can't just slap a 'deprecated' attribute on it. That'll cause a > storm of warnings. What would you suggest I do to warn people that > this interface is deprecated and I would like to remove it? I'd at least expect a suggestion in the IDR documentation to consider using XArray instead. > Why do you think that idr_find() is more intuitive than xa_load()? > The 'find' verb means that you search for something. But it doesn't > search for anything; it just returns the pointer at that index. > 'find' should return the next non-NULL pointer at-or-above a given > index. We're looking up a minor number which may or may not exist. "Find" (or "lookup" or "search") seems to describe this much better than "load" (even if that may better reflect the implementation of XArray). And no, I would not expect a find implementation to return the next entry if the requested entry does not exist (and neither does idr_find() or radix_tree_lookup()). Johan