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 D4263C07E9D for ; Mon, 26 Sep 2022 10:00:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234767AbiIZKAr (ORCPT ); Mon, 26 Sep 2022 06:00:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233208AbiIZKA1 (ORCPT ); Mon, 26 Sep 2022 06:00:27 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2ABF17E2C; Mon, 26 Sep 2022 03:00:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664186425; x=1695722425; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=RVGhqtsE7PdAaicNO71PoIIBxIolZaTTzaRRLrULv4s=; b=h/yq0q+nhJalclUupsSx/87PrhF5KvbogRh7h/YAhuugFfNGGzuwsC4e doZym76NjFsrxJBCQciPtQ1lCcmiRzyF3nKc5WX+ez8atOOeBX/P0eP/s VbYbEu/XcoYP0ruoEabyj5T23MwtVJIO/+Fccbya4iu5vOOIjKeaEEP+Z Kj9k2u1nmiBOZpb/T1Rsfp2iSXw6BcJUa8xH2SKDfxSWTOmO69VWwRslq NEHXA0Uj6ThT6M84e3f6VCBsFBuJqBJx6aU8yzp/FLviZIW3NvDGAN6Sc 2PlSAmD2p+pwS1x4/RyguENYzIA9mL7KuUCibc0IcK/PtvLh0o7enJxwQ A==; X-IronPort-AV: E=McAfee;i="6500,9779,10481"; a="298588459" X-IronPort-AV: E=Sophos;i="5.93,345,1654585200"; d="scan'208";a="298588459" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2022 03:00:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10481"; a="724986257" X-IronPort-AV: E=Sophos;i="5.93,345,1654585200"; d="scan'208";a="724986257" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP; 26 Sep 2022 03:00:23 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1ockuU-007jr2-0p; Mon, 26 Sep 2022 13:00:22 +0300 Date: Mon, 26 Sep 2022 13:00:22 +0300 From: Andy Shevchenko To: "Jason A. Donenfeld" Cc: Andrew Morton , linux-kernel@vger.kernel.org, Kees Cook , linux-toolchains@vger.kernel.org Subject: Re: [PATCH v2] minmax: clamp more efficiently by avoiding extra comparison Message-ID: References: <20220923154001.4074849-1-Jason@zx2c4.com> <20220923155412.b0132fc62eca18817a023cd2@linux-foundation.org> 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-toolchains@vger.kernel.org On Sat, Sep 24, 2022 at 12:37:26PM +0200, Jason A. Donenfeld wrote: > On Fri, Sep 23, 2022 at 03:54:12PM -0700, Andrew Morton wrote: > > On Fri, 23 Sep 2022 17:40:01 +0200 "Jason A. Donenfeld" wrote: ... > Worth noting, by the way, is that the input validation check already > caught a bug when 0day test bot choked: > > https://lore.kernel.org/linux-hwmon/20220924101151.4168414-1-Jason@zx2c4.com/ Hooray, it was a good idea! :-) > So, options: > 1) Keep this patch as-is, because it is useful on modern compilers. > 2) Add an ifdef on compiler version, so we generate the best code in > each case. > 3) Go back to testing twice, but keep the checker macro because it's > apparently useful. > 4) Do nothing and discard this series. > > Any of those are okay with me. Opinions? I tend to case 3) (I believe you typo'ed double 2) cases) and apply the rest as a separate change with all downsides explained (kinda 1) approach). -- With Best Regards, Andy Shevchenko