Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3191065pxb; Thu, 10 Feb 2022 14:44:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwYnMPV5A+xFYQoag1GYCS0foNt3JkgijjuHCx48VMtkMAzjdUw6SePffiC1G0BoVc1byXn X-Received: by 2002:a17:902:dad0:: with SMTP id q16mr9280603plx.41.1644533066902; Thu, 10 Feb 2022 14:44:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644533066; cv=none; d=google.com; s=arc-20160816; b=IKdSvq6HQHqP5xedC9epbCr2GITinhbvmpJFR1GB4v94DeVt4Fl+n5Z5gmp9PDMxai dszVcRlV2/q5zRlgR9KmViGrreYXtPBDXuS6SYsKRo6Z6OpZjfTpGNco7wq0+62YU9nF HVydrP+BSO6wxP/I+IYK79qKCRwbX4txpjmpi2YqUm6RuVzBQrKDZEerBfqx8V3jtrmQ UnskbaFcSIJUX3smqvfPsmQ2JOz7z3TAZM/oNSPELf1P2iFhW8joqJtlVlWOay+5V8WB BDnorJr8V8qZKNppVOFDvTjub7W5qyrMXqV91nyA8D5iXi1j2kg1eqa2KXpFM0lLNDmM qWog== 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=uZb8A9AI0nYcmR3emfHhRyCRQnOFPI9ygBt/5g8ieDo=; b=AoskP/aq9fGs+sSwCVz7itjTD+L17inkwI7o7xqqw37stuipaEPqYly4ykIOK2XvDG ndx59xUsiKyOFwDI8HSJXJrFKI9jHSBzuQjcfPMPxClI9DBlnILNVfYmr95W94MuacDV Uo8JjZ875a4S3RNCe85Xm3+Cx2UsGFv6j59dyFPkqPi8hZeBAxi3ukRQ2jF+fO7hrgxN 9bEPyc2/6TgHVr3D8jfLXJSkdbx4oW5qTd01oobhVFyrobKrstiQwNxs82/PvVQ9LOl/ PVkaL/yue42RBxGA/13UfpPaj+T1TTPCnwTd4MiDVTiDPPsVu7lFo8yIp6U40S7e3v09 sr3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MmAyLBkp; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a64si19643198pge.330.2022.02.10.14.44.15; Thu, 10 Feb 2022 14:44:26 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=MmAyLBkp; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344904AbiBJWXp (ORCPT + 99 others); Thu, 10 Feb 2022 17:23:45 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344803AbiBJWXo (ORCPT ); Thu, 10 Feb 2022 17:23:44 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 869322188 for ; Thu, 10 Feb 2022 14:23:45 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id c5-20020a17090a1d0500b001b904a7046dso8518352pjd.1 for ; Thu, 10 Feb 2022 14:23:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=uZb8A9AI0nYcmR3emfHhRyCRQnOFPI9ygBt/5g8ieDo=; b=MmAyLBkp3VKD5xxEzAoAN1dd9nlGJ18JOzm2gEnGMX/bUZ0F8v2eIaPFmfExASxD6M k6oJtlunX60kdBxveZFzaotG8eHfz2K1FMu+x/2yZR0rOzRLV9BxCExkVtFd8Wu7ETD7 suN9HuxJEMrSQfwXJxy8WdyxtOahLKLGAespCCkHtd9oYOds5t47hZkuMcI4ttL/ikyi ImQfvi+IfZrTw7878r0mVJto6oF+BwHrhRKVePDXEnVJal62ciq+RNy0rbE0sZHivEoB wNwkQEtHL4sZVuilhyvKjlCRDugG+E2MYEFbcvM6vHobOARRfMcA0yAqDl1uI45+zYc0 drxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=uZb8A9AI0nYcmR3emfHhRyCRQnOFPI9ygBt/5g8ieDo=; b=iPs1NlmuoJlA526leavT+1T5+q0pfuxJV0ikEsCqlqrWxZJrtGYKBVLXJ+3OWE2Nob 2/E6SxLp79Ov5nbLC4tDMDyNGncpwQ9VQreWeAQZ/mSULgTuXJ36Xeb53cSQpahEsJHJ x2xNlg+1s481T1G6Ll5DcbH9wv8Zcnfz/foZcPElTbjwCDTzRmv6iSUjstH3YRBLfxP7 y8Nx9EkM8UHf9noADPGcyyzFl6N0M85T4rHsqRc9H3YIThXORWOrhdAzwCS4HaSaDnsG FwuONBN+oOBVap8mAIrXG3nG0+XS8E7jaPRI3QkIk24PETkgTJos5lcnMRUlVY4LflAp wEFg== X-Gm-Message-State: AOAM532wDzMxXSI1/xEed4lsHQspm5RTBmHEsyfe4FS3DzBADP0d3dTR v4SMEZhfl/ubAkB1UDtDJQdl9Cbc0wGs72ju X-Received: by 2002:a17:902:6b8c:: with SMTP id p12mr9684224plk.51.1644531825020; Thu, 10 Feb 2022 14:23:45 -0800 (PST) Received: from localhost ([2409:10:24a0:4700:e8ad:216a:2a9d:6d0c]) by smtp.gmail.com with ESMTPSA id g5sm24321021pfv.22.2022.02.10.14.23.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 14:23:44 -0800 (PST) Date: Fri, 11 Feb 2022 07:23:42 +0900 From: Stafford Horne To: David Laight Cc: 'Arnd Bergmann' , Michal Simek , Christoph Hellwig , Arnd Bergmann , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] microblaze: remove CONFIG_SET_FS Message-ID: References: <20220209144910.1484686-1-arnd@kernel.org> <80c6df0717014472aa81093ae3894d39@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Thu, Feb 10, 2022 at 02:21:07PM +0000, David Laight wrote: > From: Arnd Bergmann > > static inline int __range_ok(unsigned long addr, unsigned long size) > > { > > return size <= TASK_SIZE && addr <= (TASK_SIZE - size); > > } > > > > since 'size' is usually constant, so this turns into a single comparison > > against a compile-time constant. > > Hmmm... maybe there should be a comment that it is the same as > the more obvious: > (addr <= TASK_SIZE && addr <= TASK_SIZE - size) > but is better for constant size. > (Provided TASK_SIZE is a constant.) Ah, this makes sense that. I might as well revert the OpenRISC patch for this. Though, we shall move to the generic version in the end. With ideal compare: -rwxrwxr-x. 1 shorne shorne 6011932 Feb 9 17:57 vmlinux With comparing (size <= TASK_SIZE && addr <= TASK_SIZE - size): -rwxrwxr-x. 1 shorne shorne 6003556 Feb 11 07:18 vmlinux -Stafford