From patchwork Tue Nov 26 17:21:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 13886257 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 83969D6552F for ; Tue, 26 Nov 2024 17:24:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DB456B0088; Tue, 26 Nov 2024 12:23:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9880B6B0093; Tue, 26 Nov 2024 12:23:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 801346B0095; Tue, 26 Nov 2024 12:23:59 -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 604A56B0088 for ; Tue, 26 Nov 2024 12:23:59 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 065E941438 for ; Tue, 26 Nov 2024 17:23:59 +0000 (UTC) X-FDA: 82828918914.14.92B116B Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by imf04.hostedemail.com (Postfix) with ESMTP id 2C2014001D for ; Tue, 26 Nov 2024 17:23:50 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=evRvvzKW; spf=pass (imf04.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=ubizjak@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1732641835; 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=scK7sUlNwfpZu+VLLnedXLuF+xaa2OfJ8eCpocRXk/o=; b=XQhSa/txnJUWOZnyf0naepeufnigt9mfR1qbMCkrQ8MrH5EGWJptFU9y5WiHHAoOCbrfM3 wsv15bM2uxiEPdnxmM5Pm1z/i7GpfHX62id8q2Twq2RoKYqMMXJlLW3XEky/+7EaiU4TwK LYcxcdc9wd5zvDv/KM9QH+q04lxXkAU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1732641835; a=rsa-sha256; cv=none; b=hy4D1w5Ca5QYH6NUfCKlBWyAAXWrOAXtHAPYH7klqOzJws6j8T9u99A0NpLbl3lp0uBHS0 c8O+jEgBHPDpxLMtXK8k843PGyq3hRKVzFry7JamPAm+YhxIu14+gxpu4NvUjV9nl4xr37 Y5BUXeMuYQ+YT3LIKKmwGE4JMQ7T63w= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=evRvvzKW; spf=pass (imf04.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=ubizjak@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-aa543c4db92so424189966b.0 for ; Tue, 26 Nov 2024 09:23:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732641835; x=1733246635; 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=scK7sUlNwfpZu+VLLnedXLuF+xaa2OfJ8eCpocRXk/o=; b=evRvvzKWl31QuZBdsWt97TLEUl3a79VPy1obkNl2HkyKtIAfRA0/EyLWf9oyAPYp9M ZKyP1clswoqNNFWGp/NIOXzuEcFX4mm0sSMCm/NH22oQD9E8yeljmWwa7r87mVRGDFo1 +cVdMWYSqyYBRyeMSH7DIf1A5vGuvj8EV6xfdaBruDqyMMnmIpah0+8WRDoCXwD68VKr W0NXxRi4Ddi+8814SBg+1SLYT+kbbQC4EFT1/MNhmL/dxsF/k+CqEeTjwNOvET+iIorF mqGYWVGasrMQkGSEghlhr7fl58eLmJahdqiLDVpS18gqclxbG/sM73niDbLOT8W51jvW DFyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732641835; x=1733246635; 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=scK7sUlNwfpZu+VLLnedXLuF+xaa2OfJ8eCpocRXk/o=; b=OV3H2bIW/1u5shStSPw0sO4IybMsAJ6Ajm+IsmJPzMwBx8/VlDwsQ7JEyKBLyNzFot 7chxJxdrGHbPlGmoVdkzDHDwUcgz52eNHcAIIhQQUkLsjB8siwEHFjzBKdh9/Pp+bng7 QEhmMfpbEQG+csipCOZxanjFjuHiOVwAJfPqOAg2HkSmlvdiPUYe9d4JNxDGbqD6ny85 ZNySHVQzaQZM1ieu8PRGFNks2iCAEBFAEjcC7ONjoVrRyqUUMZHqukN7LUYYikxXYz6F MKRzYWDLy7OTJze4rRWkFtWYDffu2BatT0neWWKA/HJ8dCpgnxgVx6oLSX+QE4g1yDZT JVVg== X-Forwarded-Encrypted: i=1; AJvYcCXZQYXQbwur5+QoZLBsecQx/3SS0rDA2OTzAEkGUH4v6Ncqgviz25zNKY9io088dnxSnlWoGo8Tvg==@kvack.org X-Gm-Message-State: AOJu0YznV+L02UlAds57eI5fQN/nbrDXkKjM5vDed9rw/a2GPWawHRZU adj+FvUz2RGXaomoN0mlnEYi5zVcH0Oe4bbzV231iDhZ7/lIPRXq X-Gm-Gg: ASbGncsucd0wQV8YZ/C7MuNTluVHBIrsS/u+Co4e24z6Bf7ih5NK+VoRfU8SvXqepsx xUV8LgmyKlYfw6NjP8Hh2SYa14z6Ka7/8PfK3wyRv+7AaTN4k8SNloyrizd9KYKsfrhFZM7eEzD 82GtGSJGyO/ZrOQ+OQdn52Ufy664fquHBuGo9CdZD9VGBD9wRT4RvviWOmUTC7p4u1XAe6Cpnc3 7Rs9x/jjHwt0Y0cee44FvbvfNitLKl7Cl2Xl+N9LdsxOtptUquNs+3SP2U= X-Google-Smtp-Source: AGHT+IFUI0YUp1+RBJSqcGYBOc1FhgIJEm5xni8unk9E56g4XY//7qbTg95Zcg5DcOFquH1FM+TtEQ== X-Received: by 2002:a17:906:1daa:b0:aa5:3748:2ee3 with SMTP id a640c23a62f3a-aa537483463mr1076090466b.50.1732641835429; Tue, 26 Nov 2024 09:23:55 -0800 (PST) Received: from localhost.localdomain ([46.248.82.114]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa534232086sm473832866b.42.2024.11.26.09.23.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 09:23:55 -0800 (PST) From: Uros Bizjak To: x86@kernel.org, linux-sparse@vger.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 , Luc Van Oostenryck , Thomas Gleixner , Dennis Zhou , Tejun Heo , Christoph Lameter , Linus Torvalds , Andy Lutomirski , Ingo Molnar , Nadav Amit , Brian Gerst , Denys Vlasenko , "H. Peter Anvin" Subject: [PATCH 2/6] compiler.h: Introduce TYPEOF_UNQUAL() macro Date: Tue, 26 Nov 2024 18:21:19 +0100 Message-ID: <20241126172332.112212-3-ubizjak@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20241126172332.112212-1-ubizjak@gmail.com> References: <20241126172332.112212-1-ubizjak@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: r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aR3J4WBM h26t4eUJ FEa+jnjRgfZgIEnJpMj+mAoPTTtmlpb3msI1Tmmb0evZpQlSFUfpxqdW+fdqGdAkwwuRDQBX64rke41AYRbixFVkxk1VyjPam6tHUkbiZKHPeeuBoNmhquCRLkZx+h1uDJz9XTmW/0Q3rfmkGj7m2dqkptqbfhm+Ul7cJrT1ZPsOQQIOMZDXmwM7O0r2omv6zfZPGIfKsGAdbWhWkQE98YLMkyy22PBhdGGDkdfeCMfTJfUfvqMcduIK3OiXPzw63kiKDreOYvd7fPap0d50lYvcEPq+QBoj18IYgz6HPpkDWjLqxpITtGDvcmA/oZrAXgOQv8LktERHRXd5wo4AiOTminrr8Xm/Ki06eOUGDuT2F0n+8Xc5/LSwb72Wnr7Ya3s8WbFqOZUgc8l2gIZUwevRDsPqkjZtoOAIfgAZ5L/36h6a4IJvu+WDxhnx1RoHzn953dTHXiHyqLyUWkvnVJzqvicxuKbe30hVIc3TFguNDD0BpwC8Eo/qWdlMrGjYHQHpI4J4FsCUbMcjPwbczJ92H4+M2DNqtBM70MfK+N41WEIRhe3DaCFxoGWaoZaGfO2Vh5fE2ihqvvumhODoNy1ELZnRqyyBml7Nxiq1BvQDgGDJcPrThepLRIM9JzwOiOIai7+HozDxDynXXyQDnE3NSshV7e5K4vhIrx/o9tn9wFctZ44FhyhWmDIfRaaA5jnQEUr40LB5BEPZ5hWaSzzh7PrVhbnXS0Ew1kTrlziYolWfpidLTZ93EudqsfZH+M0UcNQpaiA6KPeloGK3WbooyqA== 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 Cc: Luc Van Oostenryck Cc: Thomas Gleixner Cc: Dennis Zhou Cc: Tejun Heo Cc: Christoph Lameter Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Ingo Molnar Cc: Nadav Amit 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)