From patchwork Tue Nov 26 17:21:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 13886258 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 49326D6552F for ; Tue, 26 Nov 2024 17:24:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F12986B0093; Tue, 26 Nov 2024 12:24:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DF6566B0095; Tue, 26 Nov 2024 12:24:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD61F6B0096; Tue, 26 Nov 2024 12:24:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8C2746B0093 for ; Tue, 26 Nov 2024 12:24:01 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 389C91C6F5E for ; Tue, 26 Nov 2024 17:24:01 +0000 (UTC) X-FDA: 82828919040.28.D5ABEAD Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by imf16.hostedemail.com (Postfix) with ESMTP id 5FEE718000D for ; Tue, 26 Nov 2024 17:23:54 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=aFVGSn11; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf16.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.167.47 as permitted sender) smtp.mailfrom=ubizjak@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1732641837; a=rsa-sha256; cv=none; b=TRA3DeMnP+Rfj+ZO5e1zghgDFrTVVsA2QntkfjqqkU5HCdauGqnqNNceSWoMI9ehnEtQ++ TQ0EakVHTjlK007dko4CHo0HOgas7TwwzcozOO2lC+7J5ijLwU8fDmSWTS63w3jy7I0hAO Kb8ofp9MMj1QQxhIfAalwYMmcvQIi6Y= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=aFVGSn11; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf16.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.167.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=1732641837; 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=kox9z7JfiY9O2bkBijsUQnV/alELjzcn+LlxGXFiSRo=; b=L7s+8zNCppfUiNCJ51j36Wssxc4onNuzbxR7AqxPtl2nuvhJlK6P7AclSxZ8Ws2DNRHH8e +Fx+P86a94TPpubZldin0XFsQMye5GORZp4f1GNyXnaONqhjYrMdSmiY6t+L/ScG2o/YTs NIAxP2c1KyRwVieLaZoFqMSwNLT6c2k= Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-53ddb99e9dcso3530609e87.3 for ; Tue, 26 Nov 2024 09:23:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732641837; x=1733246637; 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=kox9z7JfiY9O2bkBijsUQnV/alELjzcn+LlxGXFiSRo=; b=aFVGSn119nzfatinopPb+lrxAseHABuERdkHWeISHzztR1gO3N5DP7y2ENIazbsNeE fpsQ51kpKi/2XMiBXBzFZni/ivMaDEgGamUhettQK2jHY5b/1DM7/7vDnNw6V0jD+kKK UIlX9D4qKoaieQ8QzghM8CaE8HEe6j30jF/TD6C93bwPdIp9aPtaWAiTet71KX6HZQrT x6SjSUUYKjEaL4du4FPPQ0SZEu92WFMFFZ/eF9NhJpcI+T89cQp2jRZjL4zrp47GnlJv WSNDjTc/ivKJ4c/7an773jSti5whK6ynz9n2dMCjPq4cItOLEAgJA/Rc+ycC6q1XotyE MdyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732641837; x=1733246637; 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=kox9z7JfiY9O2bkBijsUQnV/alELjzcn+LlxGXFiSRo=; b=gjG2WW3Q8SJlZ0dHEJECLHiGuxT1HuY38XpeqNbMICl+vYxlxBS1Pk7fo7jkU7zfO5 YceQfw4MycXiZPGkZWBf42F/lWppfqevsR3YEIEf1UaxPkmTqEuhYkvF97TM606Xo2B+ xritEzmdx04CBjDAQgb5Lsxk7ERL+nT1+y2A91tW6+f7AbMzMDhWf5hNtq7jgbtoeogJ jz4tEpSE9At5hk0FA7oVdZkegS9dT2DepEWDZghKKX/jQV/xtw0L6klgoE4rsnv+gbsS DhB2/7VtV0q9PcHWMSjD6tJ3zB+Ae+lOZE0QViAeg00rv6DQP7PXAJ9WYBtQmK2MJh/v ddgA== X-Forwarded-Encrypted: i=1; AJvYcCXbBMTRSj2M3ohollwGsAR5d3byy6r/Pn71NZyohIfvThPAq33ud1dJbznXTDEf/QiBv4VJio8rQw==@kvack.org X-Gm-Message-State: AOJu0YyQCZCqoqh59J3NvYZsvBDkmo8HycdC6Dw74mM90dSa4KWRP+Ob aFFJxUJNulAIYlRfrBMUeJwxCPXmlvJ8lnMsbK0yQAKzEsgWQ7M9 X-Gm-Gg: ASbGncsLTxGgwSwNOJWqhR/d6edEQKZZ1Dc/hR4g6eBUTTYzRqHlhHncWl88LUdAZbN C/Cjf78GpU1OYLoGtPacA9N//rqdp1PSXmfrtuyh9YnD8N+9OwCy1AshsqdeMJNoGAMCXq48dz7 6Skkmetpsfz8+AOTwXHEWg7p9c9pHJV6mY/aLaWDUBwa0hveLUqZHauw0zPKoIyqTy7maGky300 MCYTeNmxGebxghSC6A8nSM39b82S3WGZLESiDDWCz9coACizKGX0+NHoCs= X-Google-Smtp-Source: AGHT+IFafhTeOcM4tAMdv0K7GsnHQKDv0NLujRtaLdpUu+P/n+6xxinduNCThfHYJZO8CNUezGgibw== X-Received: by 2002:a05:6512:3d88:b0:53d:ecf2:332c with SMTP id 2adb3069b0e04-53decf233a6mr1552836e87.19.1732641837149; Tue, 26 Nov 2024 09:23:57 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 09:23:56 -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 , Dennis Zhou , Tejun Heo , Christoph Lameter , 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 , Luc Van Oostenryck , Nadav Amit , Brian Gerst Subject: [PATCH 3/6] percpu: Use TYPEOF_UNQUAL() in variable declarations Date: Tue, 26 Nov 2024 18:21:20 +0100 Message-ID: <20241126172332.112212-4-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-Rspam-User: X-Rspamd-Queue-Id: 5FEE718000D X-Rspamd-Server: rspam01 X-Stat-Signature: n1dg4wpzjmw81aeyfrio47k7ktjfdr4i X-HE-Tag: 1732641834-176715 X-HE-Meta: U2FsdGVkX19kZgnN1zmTbP10zaFQB261aPRJr+vP576TE7aLQancMNZUtCt8nF0CEEie9Opzbc8hX4yL3roi8Qljtvmgc9OLPf2CGHr/l+YO3lHs8OKE6Dq5pbzRhMGf369H+mACssx8rC5SEPnetmgVzsWjh0AlUjzdNTON/yTKOaNGAhMB5HQ6P2jeWmT5bOB8Q7dNmL7R0pqbk64NK20h3frE4+F3XDONhwk4olCd3GyEvNR+1yJgt9pO7Bm2riH2Iwo7PRhjDPpjO24ml8N1XcABlvBh6oBqMHXme1f1zdrEvwhPlgPjL2PfWI4dSZNV+Ed9uglPRtPM2XJisYcsMKJVTF9ka2sbwTFlb/JACQ2JTjHHrIbjmToj0xD0auaEzG8keFUTZQ4kWhgA3gZx9gV9cU4yPFh9ChXdfke13NgZxKYYndSG/82V8XJKWp3Ct8RG0F8cogDbH+Jl79YqRW0kS/h24meGCYspVjdgMsWwkN9BfCo9ygs5g6p5LVjigadj1V3OaG9uPUTbTRDJJ/tBUh+0uIn9gLopYfUW29TD5cYXPiqCpBzEXU77XMHTWKM7cifyIDhoFTEWyLkoXqxYOn0xrRXNbqCGgGtlm7qzFkK1AVLaDzHiO/HGgXUbAfadsFHSfEWELwTDBHxxdz+I13ZmoqdBUD0ROGJ4UMUHZmXQkR5o6vKMGxSm0Hv+RdU6f4tE18MObj4S2ERjLzaksk1TJXzTyvwqWjf6SS9EzHaciLINmCAjpOxYCO27dr7USJsTluH7S8f+32txe43W3FDFk0X4N1xv6EcVTphJ0hCDXOGA7V2PaBgFBq6A5r3mWmQHGVAzNl8QodKAPnAzR+an4gpPsYEiguXOfZnd3/RE8i2N4LDWi38v/Y1Qnk2yRsi52dFiCj/rghk1ijw6qxwRffteZqefWdlV5pqwyn5cbby0Zes++noRRgjTiRiadIVtP3UJuWI KAA3OhwD Lc+tv3GjrFbuFb0jqTvx4zM4NR6ReXQqcrlQbXNiGOlZzEsb3G6KpbUkLLpGbF3QTbTruyOvYOWeY4tn+LLVhfToUbJXAuwJzv9LpM5bFtVjgcdHeguvEIUP1NTbrn0d4QBoeD8B/A5PA/c432V46ifSBM/mFR6knQGGU7115lsD6lXfKoEVyDpT6pxW/C/VfQJHYbifcK+tgAfEkldpsL6IGBrmL5gWRGejXpKCNbFqjFhiwkEl3KACt8yahXnbMjBYpi7JJqHe2JkNGCUVzGmj2Ot6a/yc2nly5Kvy6sSsa2GjDH2mIE/ibjUfIC+sR/SJ+ehWbfzWO/6lCg73+KlsNj2bNFKggSZAaGTXnNbhuqrp40G7WWtk4IkbDSGY58PMNrAE2zFqI3xIM08VmgiLzA1XZ4+CST+ApS4AtDr1td2xfNRaK0iRCl35KaEtaG7InYqAC3XWxcaoyiRO2egQwgJxuQpIaMeT45aOCulq5tTq4IbOXzgnyGWkHqWeH7j3E0TPWAV6fEjDVHEwOJtsTKP22jFWQci5ACbfvNNvSpQcxxnhT72NN3OrlIgiZh/4Gr9Am7dVLqlEGAPGNh3lKlUrgkTg/wFNhH5NwKk61OqagAn0am59OEAOY4l6XzAXvxKJet7kbQq2W6J9EK5qrPuRn84SHDDQJW/GNQtwCplJWyAJ1fZXWPOPNoPGbdyqZgoAyVm4ui0B0vVZh2OQRU5rVcuL0iYL2Ffz6BJJ4rPmtQ7mK/48Xqlu1kV8laX+peF5R2/BifCO8pOyNLG5AOchc+GBWDPj5JfjXL4a1MAonhWUiKNnvx1BoaHztiSzGEXySHqBc6wrZVytqAqREDtt1wjkQisM0ef/UDgR7YHG23TXUf5MPndMBxVzNo1nozVRznVcpuQBXttCzCCDFyWM1wbiyzRxH 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 Cc: Dennis Zhou Cc: Tejun Heo Cc: Christoph Lameter 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: Luc Van Oostenryck Cc: Nadav Amit 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 fb02c1c36004..415a5803b8f4 100644 --- a/fs/bcachefs/util.h +++ b/fs/bcachefs/util.h @@ -586,7 +586,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 35842d1e3879..266297b21a5d 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h @@ -320,7 +320,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; \ @@ -335,7 +335,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); \