Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36352354rwd; Mon, 10 Jul 2023 23:05:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlGGxp82jOpt/w+MtScPxR7LWkcBHUHlMqOBqv0rQS2Gy6qL/kA2IKSbIV4C5SUl+VS0a2O/ X-Received: by 2002:a17:906:2d6:b0:993:f127:2391 with SMTP id 22-20020a17090602d600b00993f1272391mr12526313ejk.32.1689055548318; Mon, 10 Jul 2023 23:05:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689055548; cv=none; d=google.com; s=arc-20160816; b=1FSk0g2+pi6m/RaRQOk3fZ3go+ZQg2vOlcLZRnepG1R93IxhfLueeVekzGzUEpooLc zLmtF46CGkcTesGwoV7uXT6W06MQPs5re47jD9CdtC03W47ZwqiIsXJIQCcAa9gHpNtD SqbFEQwyHhY69Qw+Z7bGkFq2moeBzVx6sNGRjdZEKUIoDsXOtzr+tYa/utFKKiVMJCh1 s/gnYk10+OZa3XEqPSIfBLmItqontiimnpZGWbo/XIPQU1QQYKwVEFPY1fkBY3AYyBhA wjQ+JNn+1WRyHhZCbfa6L/iVlR4NsNOWo+ZgziXBVeqtU7UDkrxeQJdx1UasbehtguZ/ XC1Q== 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=RXW4A+b1WPgXV4CxG4WnnSMOUoZ912ow27yCjm8WoHo=; fh=vBoRymsCILpV1K9plGBlbX0WyhFrqSf/CjE6YJ0w0WU=; b=def7lBidGJwhEnlPPgKXK6OGod/Q0ylhVZVcCHC7OE8jk2sj6h4fk1KwBgQfCCVGGi CUqbq4zVDUUxe1hagb5yJQ9T+STsAf2yzuAc1Pal9nxjtY7CWt33Ce/YIy//XSDMYbCC MMqEEaMQAiA8r5rPcHSNO83lfpKi53dv4uKv7wmCYQwq3jc4ZR1CtoHB+T5yZOTZkbLb Un3YXczjRtG23mcoQXOlUzc4mRR5ue2cotbFfZYT1jFybMJ4zJ8pm4581YxRtvDrCsHp GdnTHjSqv6AZhZ9dQmiWq7ZoLQyhcpO9ksr1UjBXy42M8TEHOC58xmUG2kKeuw60V7Bu MUuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=JOC8ov9m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i20-20020a170906115400b00992acfbcee1si1118469eja.851.2023.07.10.23.05.24; Mon, 10 Jul 2023 23:05:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=JOC8ov9m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229937AbjGKF2l (ORCPT + 99 others); Tue, 11 Jul 2023 01:28:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjGKF2j (ORCPT ); Tue, 11 Jul 2023 01:28:39 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1E4F134; Mon, 10 Jul 2023 22:28:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=RXW4A+b1WPgXV4CxG4WnnSMOUoZ912ow27yCjm8WoHo=; b=JOC8ov9mbUl73be9JZXdbfYXRU OI0q4RBxAUA3iJha+PLQrb2wBF8I+UoEQDzUroNieUAoDDS5L3MHJ5E8x4PH59RPUWIlKoGUFUTEk W8Z4B99ZlsK70bo/a4VMrp+nfkC2kmX6mry7HXoKUDvFRIZf50S+GhBFLsIRtp0qmPSSDru6Ww34N G4VWCsY9ZjEOJrXsfPn0m6BnRJE5Nj3zKrmR/fTQOJ2FwH/n986jdd5g4/OjLPB8Fkei5hQPUwy/F IeuSSVsxBV9RqV2htneiMyY4xbsg5G/qFQ548iDEOAoxYtoATaDSXjXjqKUdgb5RDOWnLGrYU0pVE EA8u0gOg==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qJ5vR-00Dkpe-1g; Tue, 11 Jul 2023 05:28:37 +0000 Date: Mon, 10 Jul 2023 22:28:37 -0700 From: Christoph Hellwig To: "Matthew Wilcox (Oracle)" Cc: Andrew Morton , linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 01/38] minmax: Add in_range() macro Message-ID: References: <20230710204339.3554919-1-willy@infradead.org> <20230710204339.3554919-2-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230710204339.3554919-2-willy@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 10, 2023 at 09:43:02PM +0100, Matthew Wilcox (Oracle) wrote: > Determine if a value lies within a range more efficiently (subtraction + > comparison vs two comparisons and an AND). It also has useful (under > some circumstances) behaviour if the range exceeds the maximum value of > the type. Should this also drop existing versions of in_range()? E.g. btrfs already has its own.