Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp238515rwb; Fri, 4 Aug 2023 11:54:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6mrp7TCo5qZREEoxpanPUt/YtoU7tYkH3dQK27Sny6Ux9klktZh7S9B9YRgkKUXaSy2XU X-Received: by 2002:a17:902:e849:b0:1bb:bc6d:45a with SMTP id t9-20020a170902e84900b001bbbc6d045amr2653957plg.28.1691175263022; Fri, 04 Aug 2023 11:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691175263; cv=none; d=google.com; s=arc-20160816; b=mlVAIp4EoYkhPS0gC94Ljse7g3S43dhiDGx/qPIg2I4y6+9L3rS6l0K9wkrZ0Ve5AX yf41dG1WrSLbxhtBRpeFfERcfZpS+byjjSx9H0bg+QAAEZylvOLwuZltm62Q2vrVJptA avbWNHkMoXtveYwN+LZ50Q5hIces/JTT9Len2tDrl9jYi6a9+4BkBBmal0HZFShDnG0B 2QUQ9A+dULwNQ/KdzV+aMyfFclS/h0KalLZNc6MzF8wtU2sny79o+7M/3oHBymwdeDy3 dtElGCVEDh9WssjsolT2lUtPKt2dES4cyJAZBECm7RX+fc7Cq6jmiseQQep9eMCy6MWZ WSvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=MqkTi9KL2+nZFUaTFkEZFlTawUXWajErpZyLi7GvckM=; fh=/sftpfB7jv9ILANoDydmpzBCe1K4ooy1czhb0cz3zgk=; b=GudKPxCc6GnN9+9HI76cJNaAbSE5VAX7osiMdi59anVvOSzEvS1LnTXU5MQ19PNMGo XMeb34pqdt1GY0DL2NeJwuBJ1jbuShV7y/2TqHKk9lkUurFfkW8rnRq5SF07KkUsAR55 ju5qGHQHR+RKN34/FEAXvjDx9BWzi8RXFT4aVi6it5+cQhI67dgZ2tiG4kkbnXXZl/wr m13XRe5C6PcUqjqNzcgU63g8APyVxtOvX5sp5W7l4EMMqDI7OJzukSPY1ZH1RGIhdE9o +0kF47BIZ48b5pB9NJ8xQvYfcLx7v2mJy3QkkkaKIniH3QA90CttGoyQpUywypt041SH WV1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Uiu4CR4S; 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 p4-20020a170902f08400b001b9c205a860si2009196pla.377.2023.08.04.11.54.07; Fri, 04 Aug 2023 11:54:22 -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=@linux-foundation.org header.s=google header.b=Uiu4CR4S; 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 S229714AbjHDSOa (ORCPT + 99 others); Fri, 4 Aug 2023 14:14:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbjHDSO2 (ORCPT ); Fri, 4 Aug 2023 14:14:28 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBBE846A3 for ; Fri, 4 Aug 2023 11:14:27 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4fe0c566788so4058932e87.0 for ; Fri, 04 Aug 2023 11:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1691172866; x=1691777666; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=MqkTi9KL2+nZFUaTFkEZFlTawUXWajErpZyLi7GvckM=; b=Uiu4CR4SqcjIkfRlYt9IVv1nB+xm+BesOMVDXixl4B8+BUuMZYWJZHTakwRY4VXOXw rNMpUHHlCJ/5Z4ldhfvN9Zxni005VXw1uuyLLRO6CsST6+K83YHBTjlqE6ekuXcbh3Wy /55nZgEDfGqfM/7mSEuHXDH5KM+M6cE+fme10= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691172866; x=1691777666; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MqkTi9KL2+nZFUaTFkEZFlTawUXWajErpZyLi7GvckM=; b=F3uOGLiIEEw1FVdUNUjR01+nUAizuU2CMpkee/wi//wwRjgAuxBfzvcsl2xuMRwUaz uEe5esvSOQfmedLlONm22YJgxa3+rWV2R4nRO2cwCU076uq60pZ1CUCGl/X3AdWagtJh 1zAPsVSW/0MKCjM7nzWCObZcQPJYO6cvWQz6QTuSYGbgsdj/yo8OF3xUeEB285w6bmGY jmFZW9z9wMPm4P8CRF10Yd5DvIhE4ScBpX9BXGAUHB5MMfJyJcJSQiJ6SZVd+Ylyzjl4 avYRKIwrDMNfdfqZq16Nt29Nv/gBI6Jn98m4RSxmO7jqOSkqLGEVO8dUmuiqkq27/dYP nRHg== X-Gm-Message-State: AOJu0YwxJ7okmAGmz7etRSbaf9KPl2JlTnqxa4EyM8uDOnENI6LrvqGW CHA4bzncQ3rwGO7FQPnxnMIXccSICh8ciyIgE38JoQ== X-Received: by 2002:a05:6512:2026:b0:4fb:7592:7e03 with SMTP id s6-20020a056512202600b004fb75927e03mr1788096lfs.20.1691172865747; Fri, 04 Aug 2023 11:14:25 -0700 (PDT) Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com. [209.85.208.53]) by smtp.gmail.com with ESMTPSA id bo17-20020a0564020b3100b0051e0cb4692esm1557953edb.17.2023.08.04.11.14.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Aug 2023 11:14:25 -0700 (PDT) Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5217ad95029so2976422a12.2 for ; Fri, 04 Aug 2023 11:14:25 -0700 (PDT) X-Received: by 2002:aa7:c706:0:b0:522:2aba:bb32 with SMTP id i6-20020aa7c706000000b005222ababb32mr2134062edq.13.1691172864776; Fri, 04 Aug 2023 11:14:24 -0700 (PDT) MIME-Version: 1.0 References: <01e3e09005e9434b8f558a893a47c053@AcuMS.aculab.com> In-Reply-To: From: Linus Torvalds Date: Fri, 4 Aug 2023 11:14:07 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 5/5] minmax: Relax check to allow comparison between int and small unsigned constants. To: David Laight Cc: "linux-kernel@vger.kernel.org" , Andy Shevchenko , Andrew Morton , "Matthew Wilcox (Oracle)" , Christoph Hellwig , "Jason A. Donenfeld" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 Fri, 4 Aug 2023 at 03:56, David Laight wrote: > > Convert constants between 0 and INT_MAX to 'int' prior to comparisons > so that min(signed_var, 20u) and, more commonly, min(signed_var, sizeof()) > are both valid. I really think this whole series is broken. What does the "are both valid" even *MEAN*? It's simply not valid to do a "min(int, 20u)". What is the meaning of it? You seem to think that the meaning is to do the operation in "int". Why? You made up a definition of "valid" that I think is completely invalid. Linus