From patchwork Sun Dec 8 20:45:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 13898662 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 6B1D9E7717F for ; Sun, 8 Dec 2024 20:47:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CDB4E6B038B; Sun, 8 Dec 2024 15:47:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C641F6B038D; Sun, 8 Dec 2024 15:47:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ABA936B038E; Sun, 8 Dec 2024 15:47:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 8A9726B038B for ; Sun, 8 Dec 2024 15:47:29 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 37DA580A56 for ; Sun, 8 Dec 2024 20:47:29 +0000 (UTC) X-FDA: 82872976788.10.A80D48B Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by imf02.hostedemail.com (Postfix) with ESMTP id 8B55A80012 for ; Sun, 8 Dec 2024 20:46:49 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=lUL2EhFx; spf=pass (imf02.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.128.46 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=1733690826; 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=tKnJvA5/HWiGQXgqtTHeswbmM5vs13cpwFWYFIFmEsm861NitKZs1y0bNrXJ4oE9eihBWU Pj5kUBa7rjmFv+Y5YV2Kk8fjnDz+3QOfsxtLoCttml4JS9F7qW/7KvoFAYCZ/Xeebajsyq Apq+rm8ipxPoN5HVa+OrNE2YZt/52zI= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=lUL2EhFx; spf=pass (imf02.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=ubizjak@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733690826; a=rsa-sha256; cv=none; b=bqJ2UHjhKwDEKCVwWq4nQQoFC1zQVxz4LPH6/+JiuVTsPj5bD7q1PAY0QT7cO2DBQUmpMc 1OaD59MpIhUkQT5wBU92bi4YqykGqSU+JemWVRiUnkzHKBacDnOTiSBy+Nj4zGeYlljnQ0 1EhgtQxIg08pUmqP/6ge2YvDWBSYN78= Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-434a14d6bf4so38453615e9.1 for ; Sun, 08 Dec 2024 12:47:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733690846; x=1734295646; 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=lUL2EhFxqZve5WsujojgqusGoUkUoTy3U+ss9PdQ12tX7/j4h89+RmM44wT5d+BJXU ZJrlsRTNoofTBOnKdwQC1I8ifn+kjaOGqlCQRh/cMq1082HR4/IWqvkubHUHwU1BtgHc tsTxwM3nkoZCHMB2cpkQ8VWbZ95iUP07ZIKtr0Fwl3CxaSTgRg7IdTwZWQfkAgQj2Crq ZkZsoRQikCZlIH5fWCNpUTHJtqxrASQcr1yyTCTftl8epN/rmqnoZ2Hg2ae7xPFDoXcO N3xX/RZO+TPNFKMIf4hrth1/sFGEIaFE9YEUIZRNq+BTW+dFwydFahivEjmGr+j9Xl5T hXzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733690846; x=1734295646; 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=ZSvm3miBYq0YvnU4czpNQREvxnRcvh7wWGvcX1mctjpkT8TW6Uku5651pMVGNQIfzP yGz15LXZcKv29fN8Z5mQg0W7b9a2HLCle+uzv1oKoEeQPOU1xnxghxWLHujvCfGDANNx 3u9k03PjJzf5pbsEGSgDAv8MONULPpBIv5WqBSxgusZ1TIdWLeljVwacxd3/t0FJaFh4 gTwfZxT6TjZzdcsW3AnkZwL3xf7ZRt8p1G7KeWZKUQnL/qYzlfGNMZkRYTpcjVSsw+WG gCF3Zpx84bPO25Vv2Xyc6aW8pUehqNkvrY9+BmWZjpVwJVuw4TTwYecpdgpNFlqUHY+Z skNA== X-Forwarded-Encrypted: i=1; AJvYcCV7QuOVVg8ogCGZjuObETQPpYnHCq/aRO9lugPmQwgMyqmS5mEf3TJQiOfQBdtq9oJLmxqa0UV+ig==@kvack.org X-Gm-Message-State: AOJu0YweeXoQlKs6T/6B59AlAaUaC7D6H6LMazLUI9mrbKCnLH5oSLZa 7JmDuVcSIlL/IA77alyeJ7OX0mPdzSZxkC7wuEzJ4iDnqHwrT2VoO6kX6JTO X-Gm-Gg: ASbGncu0fY68gRjEUQv/6K/I/yBi7ZrNCWCs8GhI+uFIl9zXttMN3IhNwV3ciYFFLKq P7srSWYx2YbH3C3PP97TPHjDnuT7riLqyX+80Pd6RoYtwTPC85ZK/vy73mumwgpS4wBXKU2wgOd 2wL1Z0rokqIZvXWbKhDVDbgYn8DVu/cfBJaqmjTx06OC3k4QkLq3kG5kU0/ptXHNSQNSk6jz/9p rYnZe9sRA6Q4jgqK3zZ3Zs0hllgcSkfn6lb5IKqg0OVBdssXc5V8SrutG4= X-Google-Smtp-Source: AGHT+IEEx0rgQYQ9iMyor+TEsls9yO5cspee9cXj1IHwee/pJe4BPDGI+xtnRRqbb2a2nmwevxjJVw== X-Received: by 2002:a05:6000:471c:b0:385:fac7:89b9 with SMTP id ffacd0b85a97d-3862b3e4483mr7723302f8f.59.1733690845640; Sun, 08 Dec 2024 12:47:25 -0800 (PST) Received: from localhost.localdomain ([46.248.82.114]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3861f59cc6fsm10874975f8f.34.2024.12.08.12.47.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Dec 2024 12:47:24 -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 v3 2/6] compiler.h: Introduce TYPEOF_UNQUAL() macro Date: Sun, 8 Dec 2024 21:45:17 +0100 Message-ID: <20241208204708.3742696-3-ubizjak@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20241208204708.3742696-1-ubizjak@gmail.com> References: <20241208204708.3742696-1-ubizjak@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 8B55A80012 X-Rspam-User: X-Stat-Signature: 7z13ww1zcpgdr814pr39b1ir9bjhnd45 X-HE-Tag: 1733690809-773643 X-HE-Meta: U2FsdGVkX19B2Pjk4L3F6aT1qvohrpcM2LSNdB1wRGWztx3ONnWtdJgXFpgzZYtVh8wra9dOb7GKjZ5CBwKgOC+vuE+CUBnki3u4fF5YX3+7EA9XE3NYS4SYHArM7RBII9/CnFUiXU1RWHLf5MNbdlfzEExg6z5J2/wfE4R+fMotVbTaSp50gjTxPix7dtAX7GDdD4MqLCVa3y2yPPuIq/5dz6txGBA/nkrwRYDOD5P8bV93XKshZdR5KPL09Rmwi9cb25AXK2BdmG3fF9jy0Me2lLAAgx/IyT6jSX63Df3r0DmMIyTae7dInKESVve7WQRh4eTZ1y/g2PqUaQsl+aDLiwutKcmSGCIGys2t+GWYOtuoVh8vui5JtW56njBLtXGcPxNdOR3CvptQ53jlFI9sxVGPBDPetXiC3prBfEX/4VTItwXBuyKtnWObqUZnB1Z59hlvkE/ger8ggM3b4YGDLxXApgT/bRzZhU6QNjlIIB7BMIXQMD2FJQW9ucXolzLZkNEsG1yWlz2D76GjdOzsyHUvkGqGK/1NB3aixOlLvfhlz4NUrfapQMg9AcdjXMuAAxK+ieUUg10pDa4YyLUbya5XeMjrhK0WTHCfMN88pJR30aKXFY2VmiSKo7l21RkBwc7ipIb0gzQ0s9pMsaFAXTDxU9Jy4C6Do53ndrGr/iWr00f2Xu1pJpPT4/Ji7RuLHJE90cjuED/Nbs8t0/NonBcndm1ROz/fPgxj60TziYkFJjJKVm7tIiTeph+OCoCrlhLqU00Nl4uFg9J9kPORcn9zZkOZE+6S/nRl9aqHbowAiDFpunW0E4OpftS0GZ/fb1kh8311f1CqIHOR+Fqrtec9637uzgSfxxqxmY/Z3WiLWmLzKdzQRA43lmpgFTtwL83uph+Wz2mpOX6bpIyP7fITHUcOzE8ONt/fej/BAsuMmu3lavIXbVmCSafkh7tKwJd0Yf8/AQyKRxQ ILHmaTPd wr3keIyi4YvCN9NByGn46wjb9iycclk/8lWpwVRcoPF+vMvNpgpaN1w7jCGilfVmZ3lcn5UP9Q30ExGDUp55rFSTPIp8MTN+k2hkYIONOco9kuBGFzixRSpUkyMxJLT70LcuNIviv7d26nmAF12gI1wS6h9kde0LmcuRLerTrOpw/opvvEl9Pi06xr5UaHrxd6PzVpWGSwGOwtu2F4HBnLdJ9n+6gxkWS+P48pF3+DMWgUEtTxqdlwZZxdAmkzole1p778qQzAxuhpIfAyCWEXj6NWCG01rP4mEE58kkANO3is2cp5310+Rw6egDf9Ft/y1uDGVv6BN+TK1CsBNdPOsqYR6ABpzFztBbc0rkH1+cngfJzxzjpwNMxa1zKvdpwfjuZq9TP1nKe4AakZIlFVoAQ+s4pu8kD16G0t0gX5BnP/GD027/hvwAEyyHoO6ZpnksoZrnZumAHZ5Hp6wJZK2XTK9Jg4Ye5cWIo39ZPv8rjRmGnNjpAeX+xjm+b585DiHi9W6OZNm7hdF2FeEoFxJgroPde63WJmSxszietC7cwUwyjKiVGTmS2hsQSQZUiVOoSFDZg7+f4ONAVOO7YJQ0prJuNPYbzNvdhX5nCVRvXwdE5P4utlaf7KC9aicCcQkZNywRQS6PNbtcS4XcA8h0hvnoqu4HlMh7/QjKqHbPZwSjV61wZg3tAnesj38GuTpMFWIbjKbVdaBsPK5DyyGtg0RSCNiazA9iuSqjJj9V62RDE6VeUEDY/Blz4Hz1vVul1vjgy5uwb5jzQKUd1gRJU4g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000016, 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)