From patchwork Wed Apr 26 06:50:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 87638 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp49716vqo; Tue, 25 Apr 2023 23:59:15 -0700 (PDT) X-Google-Smtp-Source: AKy350YaVN37AIjiGcdMECXLa07ahk8ghIpClnj3KXHzCSc7hldDiRWBN9X5t/ZHG8c87+LoWDNF X-Received: by 2002:a17:90a:e7cf:b0:23a:ad68:25a7 with SMTP id kb15-20020a17090ae7cf00b0023aad6825a7mr19179770pjb.2.1682492354871; Tue, 25 Apr 2023 23:59:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682492354; cv=none; d=google.com; s=arc-20160816; b=1Al6RPPX9hZTjYbTYEgqaD7Y1ywlxrlYK3EEgiyp4yJT24QsM3hfWJrzF1Chi2KzdI 8zgzu08eDqTvJlz4Msu8j2N+M0pr8tzSXbfusDE/SCEj51bhYG8MgbLR91K16+Gq+hsM U6oycwgHiMrimYPtMAyOtFxdnUYT+PUxDNL9jcgVRC/g9iFrcyZ2UUKkdMs++S6s/cF1 Dyrn5V/6F2NP8p/kZnpDglEKHYzzmLPGYeMWWwHQmobKMexQ9Ob1jDtjOxsgzzKTDETq sN/HnL/avaFpvFGCy9ruOLkZqikV4r2FF0WU2f50pFzYjyL4562m6lqv+Xck0Tm6KEep N/3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2EMYluwvhrMA17BDykO/E+Vbp/FohqG3vlUmCHX23RY=; b=nQYgecOezug+at7OxtiJ4mksqKGcZkwDDGRBIj2SfCjznuQ+YeJqqC/lhb7POUDcc4 8Hjmd1bxwqEh3WZef1Cn5cX0M5id2u7VYVdpGULj3kqdMZEQ7ejpSYCsaOvmeOT3UwDC esb0uFbAj18Lhj72DS/EGE8qrSNOHOb9xH8s/Awk7e5rme/2gpHOLNbblhmE3/9NqGuw Ttbt+LKB2yB1/gZFD1aqNI980ysZCcTcGw7RWeVF2wxjtNclyggNGyPu7xRPXzcid7dQ o9oWdHt4cwYDkUhCpL6xR/PYwIQVQ2uJ/Qlije8ZRcpkOYqvnxeCZlCLzkJmKYGAWlIm yKaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IqvtpSGy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mw4-20020a17090b4d0400b0024736406f7dsi19720218pjb.97.2023.04.25.23.59.00; Tue, 25 Apr 2023 23:59:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IqvtpSGy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239534AbjDZGv2 (ORCPT + 99 others); Wed, 26 Apr 2023 02:51:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239490AbjDZGvY (ORCPT ); Wed, 26 Apr 2023 02:51:24 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BB1C26AD for ; Tue, 25 Apr 2023 23:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682491836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=2EMYluwvhrMA17BDykO/E+Vbp/FohqG3vlUmCHX23RY=; b=IqvtpSGyrf4TVSrzBsSODe9+HSucHL6RpLyMPvz9V1RLMHbGkBpQGWx33rjk6xzMfRg4GD zsk/nOyQCbVeZEeXaP1uzodO6Je2dBAnCejeaXGEcpuJBY18EdY8uIV0nmDS8wGE4IS/t8 QG24Ifyis6Bszxmr4xuc+jxJixJ5KPk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-176-fJMySYbeMG6TtRg1n50BnA-1; Wed, 26 Apr 2023 02:50:34 -0400 X-MC-Unique: fJMySYbeMG6TtRg1n50BnA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 55105858F09; Wed, 26 Apr 2023 06:50:34 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.151]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F29040C6E67; Wed, 26 Apr 2023 06:50:33 +0000 (UTC) From: Thomas Huth To: linux-kernel@vger.kernel.org, Arnd Bergmann Cc: linux-ia64@vger.kernel.org Subject: [PATCH] arch/ia64/include: Remove CONFIG_IA64_DEBUG_CMPXCHG from uapi header Date: Wed, 26 Apr 2023 08:50:32 +0200 Message-Id: <20230426065032.517693-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764221103513749283?= X-GMAIL-MSGID: =?utf-8?q?1764221103513749283?= CONFIG_* switches should not be exposed in uapi headers. The macros that are defined here are also only useful for the kernel code, so let's move them to asm/cmpxchg.h instead. The only two files that are using these macros are the headers arch/ia64/include/asm/bitops.h and arch/ia64/include/asm/atomic.h and these include asm/cmpxchg.h via asm/intrinsics.h, so this movement should not cause any trouble. Signed-off-by: Thomas Huth --- arch/ia64/include/asm/cmpxchg.h | 17 +++++++++++++++++ arch/ia64/include/uapi/asm/cmpxchg.h | 17 ----------------- scripts/headers_install.sh | 1 - 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/arch/ia64/include/asm/cmpxchg.h b/arch/ia64/include/asm/cmpxchg.h index 94ef84429843..d9f01ede9768 100644 --- a/arch/ia64/include/asm/cmpxchg.h +++ b/arch/ia64/include/asm/cmpxchg.h @@ -13,4 +13,21 @@ #define arch_cmpxchg_local arch_cmpxchg #define arch_cmpxchg64_local arch_cmpxchg64 +#ifdef CONFIG_IA64_DEBUG_CMPXCHG +# define CMPXCHG_BUGCHECK_DECL int _cmpxchg_bugcheck_count = 128; +# define CMPXCHG_BUGCHECK(v) \ +do { \ + if (_cmpxchg_bugcheck_count-- <= 0) { \ + void *ip; \ + extern int _printk(const char *fmt, ...); \ + ip = (void *) ia64_getreg(_IA64_REG_IP); \ + _printk("CMPXCHG_BUGCHECK: stuck at %p on word %p\n", ip, (v));\ + break; \ + } \ +} while (0) +#else /* !CONFIG_IA64_DEBUG_CMPXCHG */ +# define CMPXCHG_BUGCHECK_DECL +# define CMPXCHG_BUGCHECK(v) +#endif /* !CONFIG_IA64_DEBUG_CMPXCHG */ + #endif /* _ASM_IA64_CMPXCHG_H */ diff --git a/arch/ia64/include/uapi/asm/cmpxchg.h b/arch/ia64/include/uapi/asm/cmpxchg.h index 259ae57570bf..986dbe01d883 100644 --- a/arch/ia64/include/uapi/asm/cmpxchg.h +++ b/arch/ia64/include/uapi/asm/cmpxchg.h @@ -133,23 +133,6 @@ extern long ia64_cmpxchg_called_with_bad_pointer(void); #define cmpxchg64_local cmpxchg64 #endif -#ifdef CONFIG_IA64_DEBUG_CMPXCHG -# define CMPXCHG_BUGCHECK_DECL int _cmpxchg_bugcheck_count = 128; -# define CMPXCHG_BUGCHECK(v) \ -do { \ - if (_cmpxchg_bugcheck_count-- <= 0) { \ - void *ip; \ - extern int _printk(const char *fmt, ...); \ - ip = (void *) ia64_getreg(_IA64_REG_IP); \ - _printk("CMPXCHG_BUGCHECK: stuck at %p on word %p\n", ip, (v));\ - break; \ - } \ -} while (0) -#else /* !CONFIG_IA64_DEBUG_CMPXCHG */ -# define CMPXCHG_BUGCHECK_DECL -# define CMPXCHG_BUGCHECK(v) -#endif /* !CONFIG_IA64_DEBUG_CMPXCHG */ - #endif /* !__ASSEMBLY__ */ #endif /* _UAPI_ASM_IA64_CMPXCHG_H */ diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh index 36b56b746fce..afdddc82f02b 100755 --- a/scripts/headers_install.sh +++ b/scripts/headers_install.sh @@ -76,7 +76,6 @@ arch/arc/include/uapi/asm/swab.h:CONFIG_ARC_HAS_SWAPE arch/arm/include/uapi/asm/ptrace.h:CONFIG_CPU_ENDIAN_BE8 arch/hexagon/include/uapi/asm/ptrace.h:CONFIG_HEXAGON_ARCH_VERSION arch/hexagon/include/uapi/asm/user.h:CONFIG_HEXAGON_ARCH_VERSION -arch/ia64/include/uapi/asm/cmpxchg.h:CONFIG_IA64_DEBUG_CMPXCHG arch/m68k/include/uapi/asm/ptrace.h:CONFIG_COLDFIRE arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_NO arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_SUPPORT