From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD0FFC6FA90 for ; Fri, 23 Sep 2022 15:13:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232474AbiIWPND (ORCPT ); Fri, 23 Sep 2022 11:13:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232524AbiIWPMl (ORCPT ); Fri, 23 Sep 2022 11:12:41 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D76E133CB5 for ; Fri, 23 Sep 2022 08:12:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663945960; x=1695481960; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=gT2lgKgu7tDuuy1LRq+WL2FgQyZaVQ0gLjs4MY/RrWM=; b=TUDEq4iY7/X+Xf19vD+xxXTZBZCpdbWIv1UzeZO2TCwyQhMeNKorRsPj HFHYsLzGO9te6p3zUNncRtyyLuUjlwqymsQqfBli6DRSomzDnDbGxIyQh WwkR791sOlBPedQM2jDH83Re2cZptA2f0eEVntcmGD1C5X0+MUP/Cj+sv yE8obfUZRGXmItn/qXwvXXsAFBo+7PjVTFETrLGfWymKmHi4jccMPH0o3 ftCpEVobpTl9iCQ50ItScc05TvHRtTt8SaRsZVaRSbBWw3ghbN005pEJZ 3wMzIje2gIdSqJl/WhtpPGWVpfrqlz9SCzi8xvwoHLhRjk47a+Gyhfyfe g==; X-IronPort-AV: E=McAfee;i="6500,9779,10479"; a="302060568" X-IronPort-AV: E=Sophos;i="5.93,339,1654585200"; d="scan'208";a="302060568" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 08:12:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,339,1654585200"; d="scan'208";a="571404058" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003.jf.intel.com with ESMTP; 23 Sep 2022 08:12:38 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1obkM1-006VzX-1C; Fri, 23 Sep 2022 18:12:37 +0300 Date: Fri, 23 Sep 2022 18:12:37 +0300 From: Andy Shevchenko To: "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, Andrew Morton , Kees Cook Subject: Re: [PATCH] minmax: clamp more efficiently by avoiding extra comparison Message-ID: References: <20220923100621.3888015-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 23, 2022 at 12:48:48PM +0200, Jason A. Donenfeld wrote: > On Fri, Sep 23, 2022 at 12:40 PM Jason A. Donenfeld wrote: ... > both for the old code and for the new code, the result of lo>hi is > total nonsense: Exactly and my point is to add at least compile-time check for constants. -- With Best Regards, Andy Shevchenko