From patchwork Thu Dec 5 15:40:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 13895607 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24BF7E7716D for ; Thu, 5 Dec 2024 15:43:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AC0906B0176; Thu, 5 Dec 2024 10:43:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A48036B017F; Thu, 5 Dec 2024 10:43:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 84DA56B0182; Thu, 5 Dec 2024 10:43:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 611776B0176 for ; Thu, 5 Dec 2024 10:43:03 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 29A6C1A1702 for ; Thu, 5 Dec 2024 15:43:03 +0000 (UTC) X-FDA: 82861323384.24.51EF17F Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by imf01.hostedemail.com (Postfix) with ESMTP id 2E1FE40016 for ; Thu, 5 Dec 2024 15:42:48 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=URVoHoAY; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf01.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.128.47 as permitted sender) smtp.mailfrom=ubizjak@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733413374; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=G+7I9gi8mucGgoO85kNahA3U27ot3S0RhfZIOhPcQEg=; b=lkSxWVfwCghUpOG0XVqAiEhpfulYyE87pr3+GoSUkMfeRMxRlsn8twTk/470LUJyXuqmeR 6mln5S3PfxaD6AtXm/ZsC0pwT3c3pGIRSSwLZuRIVacU+L9lI3Fz9NDLxOD5i79Q2VUlnZ pQ0Oz5ctVAXtZVKvbM8R31wEbeXzJH0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733413374; a=rsa-sha256; cv=none; b=1loa+ZP0yxd2yzsUkTYxtoJe8mmQENY9TlPLXMuEHh3H5Am6uafVklA/B1fB9ClLRbGCa0 WkC9vrVII7wzQvmDlQQu1rZWRhM85oDCxR5W7BHfwPl85nFXC+eQNNvj3+dKrRHBrz7v3k Jqr8cJGRZt3LcR5UjmX/B+Xsibx8gtQ= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=URVoHoAY; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf01.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.128.47 as permitted sender) smtp.mailfrom=ubizjak@gmail.com Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-434b3e32e9dso11390175e9.2 for ; Thu, 05 Dec 2024 07:43:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733413380; x=1734018180; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G+7I9gi8mucGgoO85kNahA3U27ot3S0RhfZIOhPcQEg=; b=URVoHoAYc68lz7Aldrd/URv1D5oxsM6/DeRkJoI0jNfoRtxWefJ1KMrWZvVaUWZfJ8 8zWrNrrrjXF2htFhTfsKh60HJBmfw1hYtLDu1TjBAQpOm6zZhWyRZbKbU+vRbe9cnEEP lXtMeQIHVlCUXblmtoE8PMD/OEYcrDVYVf6TcEH3eGW7mu5aGm+sa73ZgDvElsdJy9/W tRmQrpOoUAJUkvN1nGRy6T/4Mbldu5+6pkJHc5DiPMYToy0r6nAQL8SQM77qxUPvSYf7 5YY9TrEZzldSQv/TJY59xPjPXs0k3hTpcHFJTfsJkdJoqSOk75s2FcMwjddQewGM38HA tvDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733413380; x=1734018180; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G+7I9gi8mucGgoO85kNahA3U27ot3S0RhfZIOhPcQEg=; b=h/jrX1ZC9MKB+FMo5RxdUBVTwf0ywanTTTu/CZPWLm9byLhFp3UkghJ7MCKyD7xA0O UTYWBfcNfFarYM0LGQCd55mAc80+FvVFu189Uh0Q180Ze1AG8Hk+lkVH4mfYEmknlNvB T8lOJQ01Nkj5sHChDz4SzsQqttAZO9DZGz8rbFxdqxb3UYd99UWe8maCzM0vSDfJKhRd GoZBOupqW93r5XzzAbr0lxkYsgRaIa1lb9Kafeu85u2FVKqq4+cfcPKxh9UOpjqTzCuz Lf3/rfaN36TM6dT5hboxGZaGFmmi8C4cqF782PbJsOqpPmW+Wdkpm1rIPPtX3V2IIJ+0 MCwA== X-Forwarded-Encrypted: i=1; AJvYcCVkehBD4vUCG58odq0Rh7YMTGqJ7u3Iqbj3NbNHpkxoMqsg2Xl5zwK4aKAt3BY8qGd2nPDfGHkZhA==@kvack.org X-Gm-Message-State: AOJu0Yyv90T9RlSV2M+8tSGRh5RwrtxOPsO99/+6ikyPt2td2V0se44V BsUAZftU3Z2Yz3FOUXqXqYV+yTdJf4jYiHPNK9TPSBjlXMaoYODI6iFvlH1W X-Gm-Gg: ASbGncuwu1WVeIMB2StN5IXniMJabXVHkoue3ngUBjEc9Yjp4ZM7yUft1XfNV7VdLeT 42Kd8xSmjPEj2UYafDKz7z8iWI9C3Yx4sB9lkbq0mcSNAZMEykXcpHuJcwfLyuJSslV2OfI70DM Tc8VRMLXol4fPiuVwHowKCaQqIg7bOuFI3A0XtpU1rZiNQOWV8Tb0ka2k60XZKAQQvOfuVo7iCI 6YKGtQq0Z1RYq4Y7/3bHEo58b1XbQTFx4xBda0wQQEsAg/QMbczSpdfPJw= X-Google-Smtp-Source: AGHT+IGfxs/UDP+NchJ2Ajwu/cJXwUlfvxqHc9BB8+DQufR3ysgRKYw2o+8A68R7dOOef3F4mH8x2w== X-Received: by 2002:a05:600c:83c8:b0:434:a962:2aa0 with SMTP id 5b1f17b1804b1-434d0a1533emr87442155e9.32.1733413379677; Thu, 05 Dec 2024 07:42:59 -0800 (PST) Received: from localhost.localdomain ([46.248.82.114]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434da11387dsm27020185e9.30.2024.12.05.07.42.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2024 07:42:59 -0800 (PST) From: Uros Bizjak To: x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-bcachefs@vger.kernel.org, linux-arch@vger.kernel.org, netdev@vger.kernel.org Cc: Uros Bizjak , Nadav Amit , Thomas Gleixner , Dennis Zhou , Tejun Heo , Christoph Lameter , Linus Torvalds , Andy Lutomirski , Ingo Molnar , Brian Gerst , Denys Vlasenko , "H. Peter Anvin" Subject: [PATCH v2 2/6] compiler.h: Introduce TYPEOF_UNQUAL() macro Date: Thu, 5 Dec 2024 16:40:52 +0100 Message-ID: <20241205154247.43444-3-ubizjak@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20241205154247.43444-1-ubizjak@gmail.com> References: <20241205154247.43444-1-ubizjak@gmail.com> MIME-Version: 1.0 X-Stat-Signature: rkwaacac3nnf7ryhmo6kwtb39u39qkn8 X-Rspamd-Queue-Id: 2E1FE40016 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1733413368-984325 X-HE-Meta: U2FsdGVkX18N0E3XgiKdaYeeztUhwxi9LX6uRsuLjrHQ4OoBVC7+QhbljjaZjDaD8xf/weLdP7BvF2DJscMCgZZKf+Z3uvhnaUapnY1IuZHxJxWjij1BDo9qHyYazJokVR/GPAIkgV/U7LsWj0v+8wgjDJuvmWigsWT6ZXhiddKp5lLMk/Stif8mQ2O12NzvI7PVq3Y+h7xqBdt6Z8X/LFTr0TZfyjjg5ws5GZAcmplhvvzDK4P5xJMm+h899SJ0sHiIfhntI4meKFMQS2CgR6IslfbaUqzyF+Be13EDgml7ZDUfM8ecPATzBXIRTsCYcJWMx+CWNouXkIcH5TibbYEWD/pQ+HctqYdicP3IpJLh0coboibhKkoAQMqF5CbyatxZKMNJvR0Jw5I7taQCuo9gDkhjkvltMODrQdiJ5NPciOv2p1seYyAksyq3gKhvZL0FiuiE8r6hSQjyWeWllQTjVOdCIG82hi2laYRGu/1oLn7qVZu0stLFLijJa06NiUSgFX5OtAzVPO/CwUJbUy7/Tig51u9ArQ9vOzU7lvkADEQyEgCZzYwIVsxPX9x/ZabqjrSCTbLSvTb0MhwrKeypd1nk7NArFuLb0ySwlXQGsZC7psF7NEEXRnyTqQn75dGNTB1TWd/wMpRrQeleFE04rLINMPj+fILFShB/ykATywAnvuHkHg70E4p4YiSd3LcV9ALFZxD7APAgitcuE76O8CcB1WpgdgfZ7UWRByK5HJqJtLiRRc/p39Ixj1u5teCj+fM8WjpDJ8iMJxxQrg0umUB+Es2eK0bJA34aIlW2j6mxTINCXUF0MFQHWq/Npw/Q7f2uFMnNq4oSwS6FP7UdbokLjFUIpnuwB06KlhJevpWsn8M3nCL1L4XKwNldwu8eHWHzhchruJWWNxZ18rmqqx6EfcoHoaF707Q8ZuC/2I0NhWdFOm0pL7DhpOTaNkk1zKvNe51DfCjsMVd lfSSne1T o1+f7YtBHgrCBaL31tqz5sI47a+E/WfvO2uFZBi4f/x9U1Vckz+ExuUSNE2cRGAqc0gk633WhUpoJNv0zAK2Obd0mgehqjkR3qC9saHahZYvjmWC6KVjbzulXgTCdDJtGi33TP+IkOqVZDL/K6Q/jhiml4xurLNXbNpzr+/Cplwd4dRK03HyjIYjQWFPUNFDePIeKV6BLKV4wxJBLSqPaIe2Za1DSKwWf5avCdm6YSIDleyRkV9S/9Y408FL3jK19lQUKgooHaXffysNin7B+mocvTO2nIGgpIieY4SXcetc/R8wD1yByZfImoSe8jZfdE0rKya7IXi5P0J1uHA32cVGtqt8DBbUs/q+Ss/oL7fCY1JEBEGfpGCAYLD9kbxQMMWkZdEYpSRsfWdLpflTdzuS6ObY0fci8JoCv3SRinLemN0bxaVzy6OTYzQOqOoLVRcbX+Nnwu7LBMrFseg++qwc2tmOmRzP7wQYu2jBzmx/uKW9++U86JyrNeGxjTEuSdAGQTzKSF2J5Zj+6DrIWUCK83mfpnrJ8wYRcXggW1cH1QgfRbkbXTW1AXG2Ir+3k7gmkJ4eO8yW1x2POEVnTwPoOrduop5gqx7VVyVLc5iSqiqYklpWAfW44AzoeM208Ekj+hnN6VQUuHTs9RPQMk57mvALPNTBtjJuNT5NutDkjblVsAiET2nvcU2FDCeSorJxGTJG+JswbLCKdb4bouSmhE6jN7Naphudeus+SM4L8gLc034uZBfRskLuRhgHoNpx/j6cMwcC0iM7DEAQClGo3Gw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Define TYPEOF_UNQUAL() to use __typeof_unqual__() as typeof operator when available, to return unqualified type of the expression. Current version of sparse doesn't know anything about __typeof_unqual__() operator. Avoid the usage of __typeof_unqual__() when sparse checking is active to prevent sparse errors with unknowing keyword. Signed-off-by: Uros Bizjak Acked-by: Nadav Amit Cc: Thomas Gleixner Cc: Dennis Zhou Cc: Tejun Heo Cc: Christoph Lameter Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Ingo Molnar Cc: Brian Gerst Cc: Denys Vlasenko Cc: "H. Peter Anvin" Cc: Peter Zijlstra #endif /* __LINUX_COMPILER_H */ diff --git a/init/Kconfig b/init/Kconfig index a20e6efd3f0f..c1f9eb3d5f2e 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -894,6 +894,9 @@ config ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH config CC_HAS_INT128 def_bool !$(cc-option,$(m64-flag) -D__SIZEOF_INT128__=0) && 64BIT +config CC_HAS_TYPEOF_UNQUAL + def_bool $(success,echo 'int foo (int a) { __typeof_unqual__(a) b = a; return b; }' | $(CC) -x c - -S -o /dev/null) + config CC_IMPLICIT_FALLTHROUGH string default "-Wimplicit-fallthrough=5" if CC_IS_GCC && $(cc-option,-Wimplicit-fallthrough=5)