get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2218950/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2218950,
    "url": "http://patchwork.ozlabs.org/api/patches/2218950/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/sparclinux/patch/20260402-cmpxchg-v1-1-4561e2c05d2c@gmail.com/",
    "project": {
        "id": 10,
        "url": "http://patchwork.ozlabs.org/api/projects/10/?format=api",
        "name": "Linux SPARC Development ",
        "link_name": "sparclinux",
        "list_id": "sparclinux.vger.kernel.org",
        "list_email": "sparclinux@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260402-cmpxchg-v1-1-4561e2c05d2c@gmail.com>",
    "list_archive_url": null,
    "date": "2026-04-02T06:56:01",
    "name": "cmpxchg: allow const-qualified old value in cmpxchg()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "b31881f285990c28536ad72719ef4c83f14b3e16",
    "submitter": {
        "id": 15639,
        "url": "http://patchwork.ozlabs.org/api/people/15639/?format=api",
        "name": "Hangbin Liu",
        "email": "liuhangbin@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/sparclinux/patch/20260402-cmpxchg-v1-1-4561e2c05d2c@gmail.com/mbox/",
    "series": [
        {
            "id": 498439,
            "url": "http://patchwork.ozlabs.org/api/series/498439/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/sparclinux/list/?series=498439",
            "date": "2026-04-02T06:56:01",
            "name": "cmpxchg: allow const-qualified old value in cmpxchg()",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/498439/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2218950/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2218950/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <SRS0=8J6b=CB=vger.kernel.org=sparclinux+bounces-6625-patchwork-incoming=ozlabs.org@ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "sparclinux@vger.kernel.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "patchwork-incoming@ozlabs.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=IinDgIYH;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=150.107.74.76; helo=mail.ozlabs.org;\n envelope-from=srs0=8j6b=cb=vger.kernel.org=sparclinux+bounces-6625-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c0a:e001:db::12fc:5321\"\n arc.chain=subspace.kernel.org",
            "gandalf.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com",
            "gandalf.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=IinDgIYH;\n\tdkim-atps=neutral",
            "gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=sparclinux+bounces-6625-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"IinDgIYH\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.214.169",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com"
        ],
        "Received": [
            "from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fmXrF5XHyz1yFv\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 18:03:25 +1100 (AEDT)",
            "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4fmXrF0g1Lz4wSg\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 18:03:25 +1100 (AEDT)",
            "by gandalf.ozlabs.org (Postfix)\n\tid 4fmXrF0ZQZz4wTF; Thu, 02 Apr 2026 18:03:25 +1100 (AEDT)",
            "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4fmXr95NHtz4wSg\n\tfor <patchwork-incoming@ozlabs.org>; Thu, 02 Apr 2026 18:03:21 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 7FC703009140\n\tfor <patchwork-incoming@ozlabs.org>; Thu,  2 Apr 2026 06:56:44 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id E9FBB320A00;\n\tThu,  2 Apr 2026 06:56:43 +0000 (UTC)",
            "from mail-pl1-f169.google.com (mail-pl1-f169.google.com\n [209.85.214.169])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 85FA437D101\n\tfor <sparclinux@vger.kernel.org>; Thu,  2 Apr 2026 06:56:40 +0000 (UTC)",
            "by mail-pl1-f169.google.com with SMTP id\n d9443c01a7336-2b2589c26e3so4352265ad.1\n        for <sparclinux@vger.kernel.org>;\n Wed, 01 Apr 2026 23:56:40 -0700 (PDT)",
            "from 1.0.0.127.in-addr.arpa\n ([240e:34c:5765:500:7999:76d9:8e52:f837])\n        by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2b2749a1e9csm19647945ad.55.2026.04.01.23.56.08\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Wed, 01 Apr 2026 23:56:38 -0700 (PDT)"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1775113405; cv=pass;\n\tb=rbK2UNlkyZ2QsJT5mj0hXovPoccoCQUgHNGMuhhfgZ61LszMiCIix/4/5YwY4xP8fLCqWUcgCUytVcQCa89UKYP6ijXBGAMHpB4FRjFGYrJvgH2h+2QpyDytJGZR5b1j7DnxIpCPUmpFzgc9a47FpruRs1Xss8jYeU0QmTy5t2bZSuJqjhc6Ul2ANW+e6lkJAMZ+JyjSSN0tINdLg2OjTOPPjNhN3sXcla5zncrG7fxoFeRIdasYAselVb46zSk98oMUF5UJtBVG6nIG8jahEWVVPN3fg00gw10s7K8MiGTrIPTOxFRMwYtfClBqE2HBaLoTeDfiZnDH22tF6xtVeA==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775113003; cv=none;\n b=PxHgVhAsiOt9QLWalxUdmFD+uUN0SS1PWraStN39Sw8uNyU5+3NoLtOMbgFLgqj97cAs1lk975RIE244CmQCarCadGB9zXwTbC+HWXlAOFs1euHyECdnDM12WJudDfU6pG/jXI1AkVfQ9ceFYaiC8GgeHVFI+FeDR3b4UpxJ1eU="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1775113405; c=relaxed/relaxed;\n\tbh=FlpdYf1WLDHAMV/rn1y6xYHlGkLnTRJ4f+O5zsHNUww=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc;\n b=yWcHijfHZ9udUR04cHcgQS+STjS1VSiGd6ElNxAnHgyoV52neyFNrxR9At83UFxgk+wH5OrK8fxDSeDyMuPzpQLXrfFgE59FJv52C2mwXK4ZQPmKFcfrsHC5NwNZp9i+ThiS0Nl6ayWRSNBgpDKUzw5RpHiATd1HcpA6BYzg97UR87nNdXHs8KsnhQkSU/p8faIEj4K6RBuDMXPVSG3WKnPYcl+tKLyEPtxmYisGaPpXmPfUUvWzr5QZZ4JQlp7CVHupHyiURL91oeEdaCOFVMasClFGwSdSTrpJFwe8uGGFqHQJnJboe2lP4Xx5A1+19k0BOSIRcCMnpY/Zfktc+w==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775113003; c=relaxed/simple;\n\tbh=duIUmMHX/NLgaTXyePmtipwg8X2dHzvr4MT8FB07vLE=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc;\n b=JKjaGgX04P9BRyPyI0l0j41mU/8Yel7gn7v73hC/Z2Tz2RcfTE2YROF3XG9XSG7MX+lEUoWQSKd35wcyjIsn10BpzGHuR3xT2gvjwoKTu2xD/tDgRA4UgTb4JuSIHcc1Juw+nHk1GfJEnC4bT2ww0ocAjVyjZZWHcjcQqFBooCw="
        ],
        "ARC-Authentication-Results": [
            "i=2; gandalf.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com; dkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=IinDgIYH; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=sparclinux+bounces-6625-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org",
            "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=IinDgIYH; arc=none smtp.client-ip=209.85.214.169"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1775112999; x=1775717799;\n darn=vger.kernel.org;\n        h=cc:to:message-id:content-transfer-encoding:mime-version:subject\n         :date:from:from:to:cc:subject:date:message-id:reply-to;\n        bh=FlpdYf1WLDHAMV/rn1y6xYHlGkLnTRJ4f+O5zsHNUww=;\n        b=IinDgIYH0oyXAPxGGKk4lI6hwBNshlo8FY9/XREnT8nuK7rFpzyb5WdqNr/oSKhPvl\n         VOgjTHqLdijiOybFzWW92uFZPnlbRRb+tu1AmJtr1yTJw47vO+6J5kPKS8C+kM/1BpOx\n         ZLnlhANXeDoCq32y6h+ypHi3Hi6kVz1PkIbpuMmHPcFwM7GkZ6jN13IL6WzhmpIdSmCh\n         39ectPh0cHz/WE+SmEsrKALYpByT3XE7q8eSO/fPPPZ+Fn+zLhdf46kU8JxR6Va5rd3Q\n         si2gpvewD8uZPkRXeF/S8cE84M/YlprKaOvEsClhalHTjEKcJVg8noPImb2+4XT9TEes\n         Ow/g==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1775112999; x=1775717799;\n        h=cc:to:message-id:content-transfer-encoding:mime-version:subject\n         :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=FlpdYf1WLDHAMV/rn1y6xYHlGkLnTRJ4f+O5zsHNUww=;\n        b=EPa3JH1At9Rl8x94wFc9ag1kXcEo6kMZpzq62q8MAMNqesjl6qR2JCsy/93RXmOTBW\n         I1TxxbZ02A/QyeBJEGH8f+FsTGoE0u8CuifxQWj43OxQti5NPM847AzOAm6LaQCYhck/\n         yDq51KKKG3nwFcdOj4Rt0nyzGqaQH2dSw5JaxZmJr/aempgdMA6kNLgU1vyeK7KCPWWQ\n         pC11psYZCitqCfwIN11hPhFFgk9oGyCAFy/lDKmhUBO9NxFelyDG3BytSOvacO9XUiTW\n         AS5jp0YW9OEvMJ9K/wa2ryr0WT8OmN5nCzBCjz7RzDAtEv5AOI1Vr6ypj4ZRXFDFcmrY\n         4B9w==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCUF6IWo2BnHyAqDVemzvehOIvX3KGEAA9n7rq/QIwVs0QiYxwUniXVIVQpWAvFBYE2KPJpLE1RyIIna@vger.kernel.org",
        "X-Gm-Message-State": "AOJu0Yzbba6CZ9ozZkWZNZLgyYddubbi9SgapPiprgZKnyiv0c9p7xWg\n\tl2i7Fij2YBzQpdpbZKZjapIsjfDVyHXA2YnH/aGsXNtZzVQ/+tgvJcwE",
        "X-Gm-Gg": "AeBDievU0ydPl95DMA6c+e3M9tDstsTYlHy09hxxvDtRm3rd6JPluITHyKfBWPEj9W1\n\tWUHcz+v9blM3MsdacAfD/udGLqzSI1+21MxKqM8uaJFBc/PFy1JaVIIHsrXnqAwsuKnHqC/wRiM\n\tJbXiTjSOlIcU8zve6skv8+ZD+R81U3/Y4sLqOWuEu2lgAWZWETDeO7pfDz2HBuXYK+Z5GUz7L3c\n\tQG7u3r8XwkGu1ECNXDpWyyxGIVgpqSvNZf7K8+rLzb+RanFJQXCcw6HR6hZQGPA1uGfBghwyVgQ\n\t04zNphA1Otyivm17kBzzhwGfuyHko/8E8JWZWh+cz5mggCSyfF26TSerVcE/jnmo1hQRwNOzg4s\n\tBX3kgv7VO1pAQYK65ZGnKq6rm9m3JF5v7JcT7ewnK7bTJbTdBnJEqokVhSVhrGXNRtdoPM0OPTQ\n\tQhthBHaSKG8hdOD39hO6lfYKTUNCWT9E/3zuya4wj5oAc30kUBFJkdW1+V9Jq8PHPeCCE=",
        "X-Received": "by 2002:a17:903:90b:b0:2b2:470d:6d18 with SMTP id\n d9443c01a7336-2b269adfea5mr73898055ad.8.1775112999356;\n        Wed, 01 Apr 2026 23:56:39 -0700 (PDT)",
        "From": "Hangbin Liu <liuhangbin@gmail.com>",
        "Date": "Thu, 02 Apr 2026 14:56:01 +0800",
        "Subject": "[PATCH] cmpxchg: allow const-qualified old value in cmpxchg()",
        "Precedence": "bulk",
        "X-Mailing-List": "sparclinux@vger.kernel.org",
        "List-Id": "<sparclinux.vger.kernel.org>",
        "List-Subscribe": "<mailto:sparclinux+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:sparclinux+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "Message-Id": "<20260402-cmpxchg-v1-1-4561e2c05d2c@gmail.com>",
        "X-B4-Tracking": "v=1; b=H4sIAAAAAAAC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE\n vPSU3UzU4B8JSMDIzMDEwMj3eTcgorkjHRdo7QUYwPzNBOTRBNDJaDqgqLUtMwKsEnRsbW1AGI\n cTBRZAAAA",
        "X-Change-ID": "20260402-cmpxchg-2fd307f44a41",
        "To": "Richard Henderson <richard.henderson@linaro.org>,\n Matt Turner <mattst88@gmail.com>, Magnus Lindholm <linmag7@gmail.com>,\n Vineet Gupta <vgupta@kernel.org>, Brian Cain <bcain@kernel.org>,\n \"James E.J. Bottomley\" <James.Bottomley@HansenPartnership.com>,\n Helge Deller <deller@gmx.de>, Madhavan Srinivasan <maddy@linux.ibm.com>,\n Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,\n \"Christophe Leroy (CS GROUP)\" <chleroy@kernel.org>,\n Paul Walmsley <pjw@kernel.org>, Palmer Dabbelt <palmer@dabbelt.com>,\n Albert Ou <aou@eecs.berkeley.edu>, Alexandre Ghiti <alex@ghiti.fr>,\n Yoshinori Sato <ysato@users.sourceforge.jp>, Rich Felker <dalias@libc.org>,\n John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,\n \"David S. Miller\" <davem@davemloft.net>,\n Andreas Larsson <andreas@gaisler.com>, Thomas Gleixner <tglx@kernel.org>,\n Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,\n Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,\n \"H. Peter Anvin\" <hpa@zytor.com>, Chris Zankel <chris@zankel.net>,\n Max Filippov <jcmvbkbc@gmail.com>",
        "Cc": "linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org,\n linux-snps-arc@lists.infradead.org, linux-hexagon@vger.kernel.org,\n linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,\n linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org,\n sparclinux@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,\n Hangbin Liu <liuhangbin@gmail.com>",
        "X-Mailer": "b4 0.14.3",
        "X-Spam-Status": "No, score=-1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tFREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,\n\tMAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=disabled\n\tversion=4.0.1",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"
    },
    "content": "The old value passed to cmpxchg() is semantically read-only: it is\nonly loaded into a register as a comparand and is never written back.\nHowever, the macro currently assigns it implicitly to a local variable\nof type __typeof__(*(ptr)), which triggers -Werror=discarded-qualifiers\nwhen old is a const-qualified pointer and ptr points to a non-const type.\n\nTo avoid this, let's add an explicit cast to __typeof__(*(ptr)) for the\nold local variable in the cmpxchg macros. This explicit cast suppresses\nthe -Wdiscarded-qualifiers diagnostic.\n\nThe new value is intentionally left without a cast: new will be stored\ninto *ptr, so silently accepting a const-qualified new would allow\ncallers to store a pointer-to-const into a non-const location without\nany compiler warning.\n\nSuggested-by: Jakub Kicinski <kuba@kernel.org>\nSigned-off-by: Hangbin Liu <liuhangbin@gmail.com>\n---\nThis is my first time posting a patch with multi-architecture specific\nchanges, so I'm not sure which target repository I should use. Please\ncorrect me if I made any mistakes.\n---\n arch/alpha/include/asm/cmpxchg.h     | 4 ++--\n arch/arc/include/asm/cmpxchg.h       | 4 ++--\n arch/hexagon/include/asm/cmpxchg.h   | 2 +-\n arch/parisc/include/asm/cmpxchg.h    | 2 +-\n arch/powerpc/include/asm/cmpxchg.h   | 8 ++++----\n arch/riscv/include/asm/cmpxchg.h     | 4 ++--\n arch/sh/include/asm/cmpxchg.h        | 2 +-\n arch/sparc/include/asm/cmpxchg_32.h  | 2 +-\n arch/sparc/include/asm/cmpxchg_64.h  | 2 +-\n arch/x86/include/asm/cmpxchg.h       | 2 +-\n arch/xtensa/include/asm/cmpxchg.h    | 2 +-\n tools/arch/x86/include/asm/cmpxchg.h | 2 +-\n 12 files changed, 18 insertions(+), 18 deletions(-)\n\n\n---\nbase-commit: 48b3cd69265f346f64b93064723492da46206e9b\nchange-id: 20260402-cmpxchg-2fd307f44a41\n\nBest regards,",
    "diff": "diff --git a/arch/alpha/include/asm/cmpxchg.h b/arch/alpha/include/asm/cmpxchg.h\nindex ae1b96479d0c..b4b8dac759c4 100644\n--- a/arch/alpha/include/asm/cmpxchg.h\n+++ b/arch/alpha/include/asm/cmpxchg.h\n@@ -234,7 +234,7 @@ ____cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,\n \n #define arch_cmpxchg_local(ptr, o, n)\t\t\t\t\t\\\n ({\t\t\t\t\t\t\t\t\t\\\n-\t__typeof__(*(ptr)) _o_ = (o);\t\t\t\t\t\\\n+\t__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o);\t\t\\\n \t__typeof__(*(ptr)) _n_ = (n);\t\t\t\t\t\\\n \t(__typeof__(*(ptr))) ____cmpxchg((ptr), (unsigned long)_o_,\t\\\n \t\t\t\t\t  (unsigned long)_n_,\t\t\\\n@@ -265,7 +265,7 @@ ____cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,\n #define arch_cmpxchg(ptr, o, n)\t\t\t\t\t\t\\\n ({\t\t\t\t\t\t\t\t\t\\\n \t__typeof__(*(ptr)) __ret;\t\t\t\t\t\\\n-\t__typeof__(*(ptr)) _o_ = (o);\t\t\t\t\t\\\n+\t__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o);\t\t\\\n \t__typeof__(*(ptr)) _n_ = (n);\t\t\t\t\t\\\n \tsmp_mb();\t\t\t\t\t\t\t\\\n \t__ret = (__typeof__(*(ptr))) ____cmpxchg((ptr),\t\t\t\\\ndiff --git a/arch/arc/include/asm/cmpxchg.h b/arch/arc/include/asm/cmpxchg.h\nindex 76f43db0890f..9637e2cdb5b1 100644\n--- a/arch/arc/include/asm/cmpxchg.h\n+++ b/arch/arc/include/asm/cmpxchg.h\n@@ -42,7 +42,7 @@\n #define arch_cmpxchg_relaxed(ptr, old, new)\t\t\t\t\\\n ({\t\t\t\t\t\t\t\t\t\\\n \t__typeof__(ptr) _p_ = (ptr);\t\t\t\t\t\\\n-\t__typeof__(*(ptr)) _o_ = (old);\t\t\t\t\t\\\n+\t__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(old);\t\t\t\\\n \t__typeof__(*(ptr)) _n_ = (new);\t\t\t\t\t\\\n \t__typeof__(*(ptr)) _prev_;\t\t\t\t\t\\\n \t\t\t\t\t\t\t\t\t\\\n@@ -64,7 +64,7 @@\n #define arch_cmpxchg(ptr, old, new)\t\t\t\t        \\\n ({\t\t\t\t\t\t\t\t\t\\\n \tvolatile __typeof__(ptr) _p_ = (ptr);\t\t\t\t\\\n-\t__typeof__(*(ptr)) _o_ = (old);\t\t\t\t\t\\\n+\t__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(old);\t\t\t\\\n \t__typeof__(*(ptr)) _n_ = (new);\t\t\t\t\t\\\n \t__typeof__(*(ptr)) _prev_;\t\t\t\t\t\\\n \tunsigned long __flags;\t\t\t\t\t\t\\\ndiff --git a/arch/hexagon/include/asm/cmpxchg.h b/arch/hexagon/include/asm/cmpxchg.h\nindex 9c58fb81f7fd..7e117964cb6b 100644\n--- a/arch/hexagon/include/asm/cmpxchg.h\n+++ b/arch/hexagon/include/asm/cmpxchg.h\n@@ -54,7 +54,7 @@ __arch_xchg(unsigned long x, volatile void *ptr, int size)\n #define arch_cmpxchg(ptr, old, new)\t\t\t\t\\\n ({\t\t\t\t\t\t\t\t\\\n \t__typeof__(ptr) __ptr = (ptr);\t\t\t\t\\\n-\t__typeof__(*(ptr)) __old = (old);\t\t\t\\\n+\t__typeof__(*(ptr)) __old = (__typeof__(*(ptr)))(old);\t\\\n \t__typeof__(*(ptr)) __new = (new);\t\t\t\\\n \t__typeof__(*(ptr)) __oldval = (__typeof__(*(ptr))) 0;\t\\\n \t\t\t\t\t\t\t\t\\\ndiff --git a/arch/parisc/include/asm/cmpxchg.h b/arch/parisc/include/asm/cmpxchg.h\nindex bf0a0f1189eb..2a87942227f8 100644\n--- a/arch/parisc/include/asm/cmpxchg.h\n+++ b/arch/parisc/include/asm/cmpxchg.h\n@@ -78,7 +78,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)\n \n #define arch_cmpxchg(ptr, o, n)\t\t\t\t\t\t \\\n ({\t\t\t\t\t\t\t\t\t \\\n-\t__typeof__(*(ptr)) _o_ = (o);\t\t\t\t\t \\\n+\t__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o);\t\t \\\n \t__typeof__(*(ptr)) _n_ = (n);\t\t\t\t\t \\\n \t(__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,\t \\\n \t\t\t\t    (unsigned long)_n_, sizeof(*(ptr))); \\\ndiff --git a/arch/powerpc/include/asm/cmpxchg.h b/arch/powerpc/include/asm/cmpxchg.h\nindex dbb50c06f0bf..36d113b13623 100644\n--- a/arch/powerpc/include/asm/cmpxchg.h\n+++ b/arch/powerpc/include/asm/cmpxchg.h\n@@ -698,7 +698,7 @@ __cmpxchg_acquire(void *ptr, unsigned long old, unsigned long new,\n }\n #define arch_cmpxchg(ptr, o, n)\t\t\t\t\t\t \\\n   ({\t\t\t\t\t\t\t\t\t \\\n-     __typeof__(*(ptr)) _o_ = (o);\t\t\t\t\t \\\n+     __typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o);\t\t\t \\\n      __typeof__(*(ptr)) _n_ = (n);\t\t\t\t\t \\\n      (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,\t\t \\\n \t\t\t\t    (unsigned long)_n_, sizeof(*(ptr))); \\\n@@ -707,7 +707,7 @@ __cmpxchg_acquire(void *ptr, unsigned long old, unsigned long new,\n \n #define arch_cmpxchg_local(ptr, o, n)\t\t\t\t\t \\\n   ({\t\t\t\t\t\t\t\t\t \\\n-     __typeof__(*(ptr)) _o_ = (o);\t\t\t\t\t \\\n+     __typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o);\t\t\t \\\n      __typeof__(*(ptr)) _n_ = (n);\t\t\t\t\t \\\n      (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_,\t \\\n \t\t\t\t    (unsigned long)_n_, sizeof(*(ptr))); \\\n@@ -715,7 +715,7 @@ __cmpxchg_acquire(void *ptr, unsigned long old, unsigned long new,\n \n #define arch_cmpxchg_relaxed(ptr, o, n)\t\t\t\t\t\\\n ({\t\t\t\t\t\t\t\t\t\\\n-\t__typeof__(*(ptr)) _o_ = (o);\t\t\t\t\t\\\n+\t__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o);\t\t\\\n \t__typeof__(*(ptr)) _n_ = (n);\t\t\t\t\t\\\n \t(__typeof__(*(ptr))) __cmpxchg_relaxed((ptr),\t\t\t\\\n \t\t\t(unsigned long)_o_, (unsigned long)_n_,\t\t\\\n@@ -724,7 +724,7 @@ __cmpxchg_acquire(void *ptr, unsigned long old, unsigned long new,\n \n #define arch_cmpxchg_acquire(ptr, o, n)\t\t\t\t\t\\\n ({\t\t\t\t\t\t\t\t\t\\\n-\t__typeof__(*(ptr)) _o_ = (o);\t\t\t\t\t\\\n+\t__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o);\t\t\\\n \t__typeof__(*(ptr)) _n_ = (n);\t\t\t\t\t\\\n \t(__typeof__(*(ptr))) __cmpxchg_acquire((ptr),\t\t\t\\\n \t\t\t(unsigned long)_o_, (unsigned long)_n_,\t\t\\\ndiff --git a/arch/riscv/include/asm/cmpxchg.h b/arch/riscv/include/asm/cmpxchg.h\nindex 8712cf9c69dc..3026a9ff43c4 100644\n--- a/arch/riscv/include/asm/cmpxchg.h\n+++ b/arch/riscv/include/asm/cmpxchg.h\n@@ -215,7 +215,7 @@\n \t\t      cas_prepend, cas_append)\t\t\t\t\\\n ({\t\t\t\t\t\t\t\t\t\\\n \t__typeof__(ptr) __ptr = (ptr);\t\t\t\t\t\\\n-\t__typeof__(*(__ptr)) __old = (old);\t\t\t\t\\\n+\t__typeof__(*(__ptr)) __old = (__typeof__(*(__ptr)))(old);\t\\\n \t__typeof__(*(__ptr)) __new = (new);\t\t\t\t\\\n \t__typeof__(*(__ptr)) __ret;\t\t\t\t\t\\\n \t\t\t\t\t\t\t\t\t\\\n@@ -331,7 +331,7 @@ union __u128_halves {\n \n #define __arch_cmpxchg128(p, o, n, cas_sfx)\t\t\t\t\t\\\n ({\t\t\t\t\t\t\t\t\t\t\\\n-\t__typeof__(*(p)) __o = (o);                                             \\\n+\t__typeof__(*(p)) __o = (__typeof__(*(p)))(o);                           \\\n \tunion __u128_halves __hn = { .full = (n) };\t\t\t\t\\\n \tunion __u128_halves __ho = { .full = (__o) };\t\t\t\t\\\n \tregister unsigned long t1 asm (\"t1\") = __hn.low;\t\t\t\\\ndiff --git a/arch/sh/include/asm/cmpxchg.h b/arch/sh/include/asm/cmpxchg.h\nindex 1e5dc5ccf7bf..7fb9214d246f 100644\n--- a/arch/sh/include/asm/cmpxchg.h\n+++ b/arch/sh/include/asm/cmpxchg.h\n@@ -68,7 +68,7 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,\n \n #define arch_cmpxchg(ptr,o,n)\t\t\t\t\t\t \\\n   ({\t\t\t\t\t\t\t\t\t \\\n-     __typeof__(*(ptr)) _o_ = (o);\t\t\t\t\t \\\n+     __typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o);\t\t\t \\\n      __typeof__(*(ptr)) _n_ = (n);\t\t\t\t\t \\\n      (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,\t\t \\\n \t\t\t\t    (unsigned long)_n_, sizeof(*(ptr))); \\\ndiff --git a/arch/sparc/include/asm/cmpxchg_32.h b/arch/sparc/include/asm/cmpxchg_32.h\nindex 8c1a3ca34eeb..f733bd5b5d3b 100644\n--- a/arch/sparc/include/asm/cmpxchg_32.h\n+++ b/arch/sparc/include/asm/cmpxchg_32.h\n@@ -55,7 +55,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)\n \n #define arch_cmpxchg(ptr, o, n)\t\t\t\t\t\t\\\n ({\t\t\t\t\t\t\t\t\t\\\n-\t__typeof__(*(ptr)) _o_ = (o);\t\t\t\t\t\\\n+\t__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o);\t\t\\\n \t__typeof__(*(ptr)) _n_ = (n);\t\t\t\t\t\\\n \t(__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,\t\\\n \t\t\t(unsigned long)_n_, sizeof(*(ptr)));\t\t\\\ndiff --git a/arch/sparc/include/asm/cmpxchg_64.h b/arch/sparc/include/asm/cmpxchg_64.h\nindex 3de25262c411..4a9ccf80487a 100644\n--- a/arch/sparc/include/asm/cmpxchg_64.h\n+++ b/arch/sparc/include/asm/cmpxchg_64.h\n@@ -170,7 +170,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)\n \n #define arch_cmpxchg(ptr,o,n)\t\t\t\t\t\t \\\n   ({\t\t\t\t\t\t\t\t\t \\\n-     __typeof__(*(ptr)) _o_ = (o);\t\t\t\t\t \\\n+     __typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o);\t\t\t \\\n      __typeof__(*(ptr)) _n_ = (n);\t\t\t\t\t \\\n      (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,\t\t \\\n \t\t\t\t    (unsigned long)_n_, sizeof(*(ptr))); \\\ndiff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h\nindex a88b06f1c35e..a7984842c58a 100644\n--- a/arch/x86/include/asm/cmpxchg.h\n+++ b/arch/x86/include/asm/cmpxchg.h\n@@ -85,7 +85,7 @@ extern void __add_wrong_size(void)\n #define __raw_cmpxchg(ptr, old, new, size, lock)\t\t\t\\\n ({\t\t\t\t\t\t\t\t\t\\\n \t__typeof__(*(ptr)) __ret;\t\t\t\t\t\\\n-\t__typeof__(*(ptr)) __old = (old);\t\t\t\t\\\n+\t__typeof__(*(ptr)) __old = (__typeof__(*(ptr)))(old);\t\t\\\n \t__typeof__(*(ptr)) __new = (new);\t\t\t\t\\\n \tswitch (size) {\t\t\t\t\t\t\t\\\n \tcase __X86_CASE_B:\t\t\t\t\t\t\\\ndiff --git a/arch/xtensa/include/asm/cmpxchg.h b/arch/xtensa/include/asm/cmpxchg.h\nindex b6db4838b175..0f68eddb6d2d 100644\n--- a/arch/xtensa/include/asm/cmpxchg.h\n+++ b/arch/xtensa/include/asm/cmpxchg.h\n@@ -83,7 +83,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)\n }\n \n #define arch_cmpxchg(ptr,o,n)\t\t\t\t\t\t      \\\n-\t({ __typeof__(*(ptr)) _o_ = (o);\t\t\t\t      \\\n+\t({ __typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o);\t\t      \\\n \t   __typeof__(*(ptr)) _n_ = (n);\t\t\t\t      \\\n \t   (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,\t      \\\n \t   \t\t\t        (unsigned long)_n_, sizeof (*(ptr))); \\\ndiff --git a/tools/arch/x86/include/asm/cmpxchg.h b/tools/arch/x86/include/asm/cmpxchg.h\nindex 0ed9ca2766ad..b71938db9422 100644\n--- a/tools/arch/x86/include/asm/cmpxchg.h\n+++ b/tools/arch/x86/include/asm/cmpxchg.h\n@@ -35,7 +35,7 @@ extern void __cmpxchg_wrong_size(void)\n #define __raw_cmpxchg(ptr, old, new, size, lock)\t\t\t\\\n ({\t\t\t\t\t\t\t\t\t\\\n \t__typeof__(*(ptr)) __ret;\t\t\t\t\t\\\n-\t__typeof__(*(ptr)) __old = (old);\t\t\t\t\\\n+\t__typeof__(*(ptr)) __old = (__typeof__(*(ptr)))(old);\t\t\\\n \t__typeof__(*(ptr)) __new = (new);\t\t\t\t\\\n \tswitch (size) {\t\t\t\t\t\t\t\\\n \tcase __X86_CASE_B:\t\t\t\t\t\t\\\n",
    "prefixes": []
}