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 B7F76C04A94 for ; Sun, 30 Jul 2023 17:08:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229640AbjG3RF4 (ORCPT ); Sun, 30 Jul 2023 13:05:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjG3RFx (ORCPT ); Sun, 30 Jul 2023 13:05:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9528C10C8 for ; Sun, 30 Jul 2023 10:05:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 27A3360C8F for ; Sun, 30 Jul 2023 17:05:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6EA4C433C8; Sun, 30 Jul 2023 17:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690736748; bh=f6knECm1fSH39bAiPEYJzLYKh7YYP7L6/h+4LW/qes4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uQOJWLr/LbONgAeQgr7lYLT3cyw9wn+Hadapyh65h14zthl4gHBLmf23gr8haxCC7 wztWJ9FwyAmETNwqSFs+OrHVCy5x6Y84J7mkE9Fe8vCMcyBnzFiQcSoMCou03Lc6Oo gQwM4BEnrL/PIoZfTFcqmDoUD8GaVIwaQoKBG8qi/rtzy0OS4mw//dmKw2rg223voo yl3Il6e34075yBC9IiN5H+kH9vGSGTJW8T/1UAItkxD9Xzk906yJ4JiG/wF308/9iL eDYGHIQuShl9C/FJ4Q8i5mFROJ4N3E8dcUrC5dwjr+9lKm5UvUKrKU8Y45w/vrRuAf wDBtRqsg8HHvw== Date: Sun, 30 Jul 2023 10:05:46 -0700 From: Nathan Chancellor To: David Laight Cc: 'kernel test robot' , "'linux-kernel@vger.kernel.org'" , 'Andy Shevchenko' , 'Andrew Morton' , "'Matthew Wilcox (Oracle)'" , 'Christoph Hellwig' , "'Jason A. Donenfeld'" , "llvm@lists.linux.dev" , "oe-kbuild-all@lists.linux.dev" Subject: Re: [PATCH next v2 2/5] minmax: Allow min()/max()/clamp() if the arguments have the same signedness. Message-ID: <20230730170546.GA1666163@dev-arch.thelio-3990X> References: <202307290943.ODVeyeK6-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 30, 2023 at 02:55:50PM +0000, David Laight wrote: > From: kernel test robot > > Sent: 29 July 2023 03:01 > > > > kernel test robot noticed the following build errors: > > > ...) > > compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git > > 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a) > > reproduce: (https://download.01.org/0day-ci/archive/20230729/202307290943.ODVeyeK6- > > lkp@intel.com/reproduce) > > > ... > > >> mm/percpu.c:3102:10: error: static assertion expression is not an integral constant expression > > base = min(ptr, base); > > ^~~~~~~~~~~~~~ > ... ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/minmax.h:23:2: note: expanded from macro '__types_ok' > > (is_signed_type(typeof(x)) == is_signed_type(typeof(y))) > > ^ > ... > > mm/percpu.c:3102:10: note: cast that performs the conversions of a reinterpret_cast is not allowed > > in a constant expression > > That is a C++ error that seems to have crept into C. > The relevant definition is: > > #define is_signed_type(type) (((type)(-1)) < (type)1) > > This seems to have been fixed in clang 16.0.0. Indeed, it looks like https://github.com/llvm/llvm-project/commit/a181de452df311d7647329120d05f4eb9c158b6c fixed this as a result of the discussion at https://github.com/llvm/llvm-project/issues/57687, which certainly makes sense. Cheers, Nathan