From patchwork Mon Jan 27 16:05:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 13951591 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 11DF7C0218C for ; Mon, 27 Jan 2025 16:07:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B9D386B015D; Mon, 27 Jan 2025 11:07:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B2826280115; Mon, 27 Jan 2025 11:07:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 92BE22800E8; Mon, 27 Jan 2025 11:07:29 -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 7401A6B015D for ; Mon, 27 Jan 2025 11:07:29 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 192A7C02A4 for ; Mon, 27 Jan 2025 16:07:29 +0000 (UTC) X-FDA: 83053711818.19.F21DEA4 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by imf01.hostedemail.com (Postfix) with ESMTP id 105BB4000B for ; Mon, 27 Jan 2025 16:07:26 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=atR7J5XX; spf=pass (imf01.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.218.41 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=1737994047; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SuZxe+AfFouuIU0wQHkXEH3/7ewa5etNqEUu9GIF73k=; b=vofMl7pAahEW00mD2JWHYOMNfbto2QCAZ2lbDksxnO237Qq2//DEgRJNOVZffVcou6j3xN qTUK7wEEs/tp2sQ61FDbfrm6wUF6iPlucXYUr0X7eFGli1dvxhNu4rUkzACVb9ayygPxal 49+qM21wTP5rOJ7eb6rog3t/3Tr0m2c= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=atR7J5XX; spf=pass (imf01.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.218.41 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=1737994047; a=rsa-sha256; cv=none; b=KE0n13KRhWh8cgzqi2oznv9wvr5AxXaKlxE2Gv+9JRWe2bUODDZlFGToj4D4OQ2HjROIId emfe8gVGZ8Yg3e+TlB2mqusZKySc4R2fawJSl5CDaBRZu+dFGDbSV3LiQ0iy/7eckrtYiq 0O9crpnEM3L6AqtPsxl9E7Q/2mS4fks= Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-ab2e308a99bso902332166b.1 for ; Mon, 27 Jan 2025 08:07:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737994045; x=1738598845; 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=SuZxe+AfFouuIU0wQHkXEH3/7ewa5etNqEUu9GIF73k=; b=atR7J5XX4UGpF6G3X9xGGQwwuMHxydphVh0ht5M8Tl0+Wx3r+x35HBIXo9UAfRkuNz DorLF796ELKs8jTEZmNam8TmaN7llRaM+RimkIDT2YobGro05QsKNTKxa2nC+E6Y73TZ +TU19CjnuYOSDYXbLPdg4kQx4IEEAAVEP2nFhd49+gYwUFfLAdpBptZf8qhiC2Hs2IjI 29J4YmpcO/BjCIqzQnpU2PLhQLUQmDX7mSNmKTVH3voV6z3k2r8mJTyhP0+VE0RduRNS E4zA8FqVIRbEfGB6onRrbfDwiDTe3QrAMenxsQZZJuWyuxm34jWRoPVV/D8GZ0bJP4wh n/EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737994045; x=1738598845; 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=SuZxe+AfFouuIU0wQHkXEH3/7ewa5etNqEUu9GIF73k=; b=ntYIm7BHnLbgmGo6S4P5Asj5N6/FQksRcpLtsiKsv5OYJgIpiBr1BaUq6vp602l/XB 0agj+NpnZaSQwxFCai5pEObs4DoOblfayuoYJcck0bPBtky5or8FwvlqOnh99wBepTa0 TacuMDjOHXKxwH+z6hq6T5yW3hrwoVw67kWs89AX6c7Q9zO76xriUglDznvsHa9zUJqL c+ckDpuDtcZDioy8sCQutwfP47lSf5Q3SVubXcH3gCBFoIhuUPUJFkLdtHT88FCz7U81 NcK/4vzuu+Ft/Nc/nsPMI5La+NyLELOjSd6Aem/nVWZXl0KHEjGvCa0sEfXQGcU0WWuQ BwDg== X-Forwarded-Encrypted: i=1; AJvYcCWltQDteETd/rf95sIeYDUVcnIj5/WIWgg5pM3ymmbkx6ZDelsaiBcsunvmNnXgncrVw4o9VZtHWA==@kvack.org X-Gm-Message-State: AOJu0Yy/62szKU1udw0pgZPF9gR2NWeiOSUDPDGY6W33BZ/j8zSXDuEq WtHHJr+t83XTRCCPcOMtHDLcnLA1DrnmkdZCteAitbbFMDNvNC8i X-Gm-Gg: ASbGnctA+iR8oiyw1AqzuOvIMC7RInyOl5wQZSpOHOqqnhZiHKVmy94aiJpD/tQTkUa akalrKdy9ajQl7NnnPsnsnlreArHIYcG2UwvbcuT9Q/sddtzJTmK8YG8pCSyUmUBvf5VXb9K7zO lO0YuxaXiEK8SQV9Gpam0oppm2maTKRpoY1GnNe/tCffHkk7Y46q4pFga8MjE9Z2QTlbwUdlF2D PzndPrA2tJ2dkYZ/4osEYMKxE5Qa2j/eqswlmMX31o9NWxSnGj8m3L8YvGAeYLn/QmuEwSSV5H2 5faV61uUdmu0ew== X-Google-Smtp-Source: AGHT+IEhkb1QlpKpjEVh9Qlf5cg4BvflbRVDsJrlA2oE2R2yIM44Ae2Zi5eaJQiOnUdYAJplTRaD5w== X-Received: by 2002:a17:907:7e85:b0:ab6:59e0:b756 with SMTP id a640c23a62f3a-ab6629cce1dmr1786130466b.14.1737994045166; Mon, 27 Jan 2025 08:07:25 -0800 (PST) Received: from localhost.localdomain ([46.248.82.114]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab675e8b01asm592643866b.84.2025.01.27.08.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 08:07: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 , Christoph Lameter , Dennis Zhou , Tejun Heo , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Kent Overstreet , Arnd Bergmann , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Peter Zijlstra , Will Deacon , Waiman Long , Boqun Feng , Linus Torvalds , Brian Gerst Subject: [PATCH v4 3/6] percpu: Use TYPEOF_UNQUAL() in variable declarations Date: Mon, 27 Jan 2025 17:05:07 +0100 Message-ID: <20250127160709.80604-4-ubizjak@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20250127160709.80604-1-ubizjak@gmail.com> References: <20250127160709.80604-1-ubizjak@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 105BB4000B X-Stat-Signature: d6h5j7rakzy5rzbmge7gbx4keuje64bg X-Rspam-User: X-HE-Tag: 1737994046-220638 X-HE-Meta: U2FsdGVkX1/T3Mop5pOBoPVON7cKcfGbv3pm+Ww9ORzhi6AKbked5hqzJj0MDN9DKLnNnKmLAR7pLCtxHXP+9LwakzHaTtV+VtYh5l4av1IzDsNSQm+P6vsWDV6ijKfbz6habdHldirG7FpeJVvREXwLlFYRKzh0n0mcK2YCSgALpR1+Giqt5uSbL/bgflvcZ/Dat1tzPxy7Y3D1A+b1JEJjNjQl1kvdOuUBHkYXXUNh4S3RiZCPzfDPsHlGxFPCaSVqjAQBtvoB2diHeRXfGTw2pc9OAglDDvpHImDAtA0IjwcMieGfTrUpGcuWctxVWVA/ZaiQUExDOgtVRPUG//D5iAhaJRC5IzcKuQNvoTPZuVGQodCddaTKrSYEMsJLuL2hbZDWvjbXRVfZd7OVAgu8DSDMYzPJ1XguVS4T7Sr89mtW/do93vY4hl9+XpCKdesPPG0SJFA14vqwRhNsV3ocGSu0anM1rsBM0m5HIZFHNk3f2IcOLh8D/ne9Pe3Cevkm4BzvtUTNPn5J261c5qaYVHYRvsZHJcIm6EE7AI8I7s7puoaZPnFm+nDJtyYL4WVsXToAoDOqf6YNTxEfoTZfFL6NU8W4nhAq3mwg37kAqtZXtuobEqWDgrp0VClZtYnZPOkQ8H2AYxLR6vqLb3r3nxfYxzlTpV8d04yLa9AX12BV0rHnk1Su/T91WMGTaDw4QyEKkqP9nKERyZ7EkUWXBlCuGHX9jFW4rl+ivI3l0g8SGKuo7s+umcXTryFVsF/TiWq9MVnxBnKx6uytV9pGBDaICrruR6BDgxP0BIFiil43gb3rB33If2bDj1RIVMBw4tH+P5mfEFQbvyWGmOATGfrpMLQrjPec6t1UJLQBE8WexdTP7Rmm4uR9X01fApkmO6c6S5c29FL6CIcUDaKR+S0S+FNaxFMTADXOy7u20mSK2vZw12KWjiB20JxLKpO7LxUdUhYDpSmpruV MI3CGABK uTANPFWE7LbgBBi7GZeZ5cjGO0mT5UIxdmhLKz5LP6u92wWwxOUjC7Ov3Bzv/mxJ9u9+eqOeL4/oW84yib/TPeXYLUMfsv5NKS53h+h5/B9R6Pqj6R/1BPq6SMBrO3prp6IS3fj9n0WSG8CdaOqsDhOvb1X+IPTBjzi3WoIQRvdeXBvXzTf9+pgYuoN6aOsdyDQeCIXc9u9R33Mwbn6N+nenGHLGpSLsdr4iEQBU39aWk0a2DO5g53LkIlkud7/ggGsyOMiSU5r8vNDRxQke3WmJ/2g5W0rTHaoQTjWX1HjgdupnMEuj+GOj0wCWER3hgZwIGv1cUqcJIEeK8W42TLyoZRQGQNRGFwlEbwWX/OP+7TCP1OAvLzPWIvQNBjShtRMyKrBdZbmlraG6K3My2aIrUnUAtfK+gj/r8w9s3b4BHIdBb3PvF+QpkaD91fjc7hR/9x3yOJkl6HHMg//sX351SnyS8K+NEyOcogOr9VLclwpJt0toVb9lu4Q1hLQ/OSvqLP4AlRUfU0V8suLB7+In3mH3Q86dX62sRTIX/KDHjajpgw1smWk2IEPFuuirm/QXfDf8ESj4TkaJG6dHwRV0sA9rV6mcXnn7ZA6iPEMeSKZUw9vdmqrI9MB85Go2DFFPjvbabZYrTt/la0T+6gdTqjV8XeH/8uqes87ROGZSeyqhUqC1dUhS/hHt9ubTO8xL1+4SIvILwfZTsG3+rnM/sRfXgmxAAUAHEg0rlYBoSuYBfDYvdBP3TIUNrDHRxNJFgp/Y9VLL+tZwiVXlJ7JtojOumtKGIHevj2UC6/ofkcsxbutyWMAz/3JgZZBvzmlguE914+P60nSzAQhXvaCkuuA096Qi5KmnwEpUkG8Mn5JT4HTVKksEwlRUcH+ns6st69+I8OsY0Ra8cCXGq2J1XGVyQKaRZWtsw 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: Use TYPEOF_UNQUAL() to declare variables as a corresponding type without named address space qualifier to avoid "‘__seg_gs’ specified for auto variable ‘var’" errors. Signed-off-by: Uros Bizjak Acked-by: Nadav Amit Acked-by: Christoph Lameter Cc: Dennis Zhou Cc: Tejun Heo Cc: Andy Lutomirski Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Kent Overstreet Cc: Arnd Bergmann Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Peter Zijlstra Cc: Will Deacon Cc: Waiman Long Cc: Boqun Feng Cc: Linus Torvalds Cc: Brian Gerst --- arch/x86/include/asm/percpu.h | 10 +++++----- fs/bcachefs/util.h | 2 +- include/asm-generic/percpu.h | 26 +++++++++++++------------- include/linux/part_stat.h | 2 +- include/linux/percpu-defs.h | 4 ++-- include/net/snmp.h | 5 ++--- kernel/locking/percpu-rwsem.c | 2 +- net/mpls/internal.h | 4 ++-- 8 files changed, 27 insertions(+), 28 deletions(-) diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index e525cd85f999..666e4137b09f 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h @@ -180,7 +180,7 @@ do { \ __pcpu_type_##size pto_val__ = __pcpu_cast_##size(_val); \ \ if (0) { \ - typeof(_var) pto_tmp__; \ + TYPEOF_UNQUAL(_var) pto_tmp__; \ pto_tmp__ = (_val); \ (void)pto_tmp__; \ } \ @@ -219,7 +219,7 @@ do { \ __pcpu_type_##size pto_val__ = __pcpu_cast_##size(_val); \ \ if (0) { \ - typeof(_var) pto_tmp__; \ + TYPEOF_UNQUAL(_var) pto_tmp__; \ pto_tmp__ = (_val); \ (void)pto_tmp__; \ } \ @@ -240,7 +240,7 @@ do { \ (val) == (typeof(val))-1)) ? (int)(val) : 0; \ \ if (0) { \ - typeof(var) pao_tmp__; \ + TYPEOF_UNQUAL(var) pao_tmp__; \ pao_tmp__ = (val); \ (void)pao_tmp__; \ } \ @@ -273,7 +273,7 @@ do { \ */ #define raw_percpu_xchg_op(_var, _nval) \ ({ \ - typeof(_var) pxo_old__ = raw_cpu_read(_var); \ + TYPEOF_UNQUAL(_var) pxo_old__ = raw_cpu_read(_var); \ \ raw_cpu_write(_var, _nval); \ \ @@ -287,7 +287,7 @@ do { \ */ #define this_percpu_xchg_op(_var, _nval) \ ({ \ - typeof(_var) pxo_old__ = this_cpu_read(_var); \ + TYPEOF_UNQUAL(_var) pxo_old__ = this_cpu_read(_var); \ \ do { } while (!this_cpu_try_cmpxchg(_var, &pxo_old__, _nval)); \ \ diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h index 1a1720116071..e430a32050c2 100644 --- a/fs/bcachefs/util.h +++ b/fs/bcachefs/util.h @@ -609,7 +609,7 @@ do { \ #define per_cpu_sum(_p) \ ({ \ - typeof(*_p) _ret = 0; \ + TYPEOF_UNQUAL(*_p) _ret = 0; \ \ int cpu; \ for_each_possible_cpu(cpu) \ diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index 94cbd50cc870..50597b975a49 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h @@ -74,7 +74,7 @@ do { \ #define raw_cpu_generic_add_return(pcp, val) \ ({ \ - typeof(pcp) *__p = raw_cpu_ptr(&(pcp)); \ + TYPEOF_UNQUAL(pcp) *__p = raw_cpu_ptr(&(pcp)); \ \ *__p += val; \ *__p; \ @@ -82,8 +82,8 @@ do { \ #define raw_cpu_generic_xchg(pcp, nval) \ ({ \ - typeof(pcp) *__p = raw_cpu_ptr(&(pcp)); \ - typeof(pcp) __ret; \ + TYPEOF_UNQUAL(pcp) *__p = raw_cpu_ptr(&(pcp)); \ + TYPEOF_UNQUAL(pcp) __ret; \ __ret = *__p; \ *__p = nval; \ __ret; \ @@ -91,7 +91,7 @@ do { \ #define __cpu_fallback_try_cmpxchg(pcp, ovalp, nval, _cmpxchg) \ ({ \ - typeof(pcp) __val, __old = *(ovalp); \ + TYPEOF_UNQUAL(pcp) __val, __old = *(ovalp); \ __val = _cmpxchg(pcp, __old, nval); \ if (__val != __old) \ *(ovalp) = __val; \ @@ -100,8 +100,8 @@ do { \ #define raw_cpu_generic_try_cmpxchg(pcp, ovalp, nval) \ ({ \ - typeof(pcp) *__p = raw_cpu_ptr(&(pcp)); \ - typeof(pcp) __val = *__p, ___old = *(ovalp); \ + TYPEOF_UNQUAL(pcp) *__p = raw_cpu_ptr(&(pcp)); \ + TYPEOF_UNQUAL(pcp) __val = *__p, ___old = *(ovalp); \ bool __ret; \ if (__val == ___old) { \ *__p = nval; \ @@ -115,14 +115,14 @@ do { \ #define raw_cpu_generic_cmpxchg(pcp, oval, nval) \ ({ \ - typeof(pcp) __old = (oval); \ + TYPEOF_UNQUAL(pcp) __old = (oval); \ raw_cpu_generic_try_cmpxchg(pcp, &__old, nval); \ __old; \ }) #define __this_cpu_generic_read_nopreempt(pcp) \ ({ \ - typeof(pcp) ___ret; \ + TYPEOF_UNQUAL(pcp) ___ret; \ preempt_disable_notrace(); \ ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \ preempt_enable_notrace(); \ @@ -131,7 +131,7 @@ do { \ #define __this_cpu_generic_read_noirq(pcp) \ ({ \ - typeof(pcp) ___ret; \ + TYPEOF_UNQUAL(pcp) ___ret; \ unsigned long ___flags; \ raw_local_irq_save(___flags); \ ___ret = raw_cpu_generic_read(pcp); \ @@ -141,7 +141,7 @@ do { \ #define this_cpu_generic_read(pcp) \ ({ \ - typeof(pcp) __ret; \ + TYPEOF_UNQUAL(pcp) __ret; \ if (__native_word(pcp)) \ __ret = __this_cpu_generic_read_nopreempt(pcp); \ else \ @@ -160,7 +160,7 @@ do { \ #define this_cpu_generic_add_return(pcp, val) \ ({ \ - typeof(pcp) __ret; \ + TYPEOF_UNQUAL(pcp) __ret; \ unsigned long __flags; \ raw_local_irq_save(__flags); \ __ret = raw_cpu_generic_add_return(pcp, val); \ @@ -170,7 +170,7 @@ do { \ #define this_cpu_generic_xchg(pcp, nval) \ ({ \ - typeof(pcp) __ret; \ + TYPEOF_UNQUAL(pcp) __ret; \ unsigned long __flags; \ raw_local_irq_save(__flags); \ __ret = raw_cpu_generic_xchg(pcp, nval); \ @@ -190,7 +190,7 @@ do { \ #define this_cpu_generic_cmpxchg(pcp, oval, nval) \ ({ \ - typeof(pcp) __ret; \ + TYPEOF_UNQUAL(pcp) __ret; \ unsigned long __flags; \ raw_local_irq_save(__flags); \ __ret = raw_cpu_generic_cmpxchg(pcp, oval, nval); \ diff --git a/include/linux/part_stat.h b/include/linux/part_stat.h index ac8c44dd8237..c5e9cac0575e 100644 --- a/include/linux/part_stat.h +++ b/include/linux/part_stat.h @@ -33,7 +33,7 @@ struct disk_stats { #define part_stat_read(part, field) \ ({ \ - typeof((part)->bd_stats->field) res = 0; \ + TYPEOF_UNQUAL((part)->bd_stats->field) res = 0; \ unsigned int _cpu; \ for_each_possible_cpu(_cpu) \ res += per_cpu_ptr((part)->bd_stats, _cpu)->field; \ diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 5b520fe86b60..79b9402404f1 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h @@ -317,7 +317,7 @@ static __always_inline void __this_cpu_preempt_check(const char *op) { } #define __pcpu_size_call_return(stem, variable) \ ({ \ - typeof(variable) pscr_ret__; \ + TYPEOF_UNQUAL(variable) pscr_ret__; \ __verify_pcpu_ptr(&(variable)); \ switch(sizeof(variable)) { \ case 1: pscr_ret__ = stem##1(variable); break; \ @@ -332,7 +332,7 @@ static __always_inline void __this_cpu_preempt_check(const char *op) { } #define __pcpu_size_call_return2(stem, variable, ...) \ ({ \ - typeof(variable) pscr2_ret__; \ + TYPEOF_UNQUAL(variable) pscr2_ret__; \ __verify_pcpu_ptr(&(variable)); \ switch(sizeof(variable)) { \ case 1: pscr2_ret__ = stem##1(variable, __VA_ARGS__); break; \ diff --git a/include/net/snmp.h b/include/net/snmp.h index 468a67836e2f..4cb4326dfebe 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h @@ -159,7 +159,7 @@ struct linux_tls_mib { #define __SNMP_ADD_STATS64(mib, field, addend) \ do { \ - __typeof__(*mib) *ptr = raw_cpu_ptr(mib); \ + TYPEOF_UNQUAL(*mib) *ptr = raw_cpu_ptr(mib); \ u64_stats_update_begin(&ptr->syncp); \ ptr->mibs[field] += addend; \ u64_stats_update_end(&ptr->syncp); \ @@ -176,8 +176,7 @@ struct linux_tls_mib { #define SNMP_INC_STATS64(mib, field) SNMP_ADD_STATS64(mib, field, 1) #define __SNMP_UPD_PO_STATS64(mib, basefield, addend) \ do { \ - __typeof__(*mib) *ptr; \ - ptr = raw_cpu_ptr((mib)); \ + TYPEOF_UNQUAL(*mib) *ptr = raw_cpu_ptr(mib); \ u64_stats_update_begin(&ptr->syncp); \ ptr->mibs[basefield##PKTS]++; \ ptr->mibs[basefield##OCTETS] += addend; \ diff --git a/kernel/locking/percpu-rwsem.c b/kernel/locking/percpu-rwsem.c index 6083883c4fe0..d6964fc29f51 100644 --- a/kernel/locking/percpu-rwsem.c +++ b/kernel/locking/percpu-rwsem.c @@ -184,7 +184,7 @@ EXPORT_SYMBOL_GPL(__percpu_down_read); #define per_cpu_sum(var) \ ({ \ - typeof(var) __sum = 0; \ + TYPEOF_UNQUAL(var) __sum = 0; \ int cpu; \ compiletime_assert_atomic_type(__sum); \ for_each_possible_cpu(cpu) \ diff --git a/net/mpls/internal.h b/net/mpls/internal.h index b9f492ddf93b..83c629529b57 100644 --- a/net/mpls/internal.h +++ b/net/mpls/internal.h @@ -33,7 +33,7 @@ struct mpls_dev { #define MPLS_INC_STATS_LEN(mdev, len, pkts_field, bytes_field) \ do { \ - __typeof__(*(mdev)->stats) *ptr = \ + TYPEOF_UNQUAL(*(mdev)->stats) *ptr = \ raw_cpu_ptr((mdev)->stats); \ local_bh_disable(); \ u64_stats_update_begin(&ptr->syncp); \ @@ -45,7 +45,7 @@ struct mpls_dev { #define MPLS_INC_STATS(mdev, field) \ do { \ - __typeof__(*(mdev)->stats) *ptr = \ + TYPEOF_UNQUAL(*(mdev)->stats) *ptr = \ raw_cpu_ptr((mdev)->stats); \ local_bh_disable(); \ u64_stats_update_begin(&ptr->syncp); \