Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2004858rwb; Sat, 24 Sep 2022 00:56:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM45gxQ64IqG/M7St68PzKhI3G104B2bfHcaqw9GbwnNTi3Mo8WJBf1XKVDd8uCv9Nq5HPz0 X-Received: by 2002:a63:231a:0:b0:429:fb01:3c5d with SMTP id j26-20020a63231a000000b00429fb013c5dmr10696688pgj.583.1664006172050; Sat, 24 Sep 2022 00:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664006172; cv=none; d=google.com; s=arc-20160816; b=ybNZ59ijst4NvQcEGLeE8ivgZEOVUWl1O2f6cKjMz9LRZhzLq1Pe2ejs0qAF+uHhn0 kCyLi3wQrtYlBgsPMKd/xjFh3upc9YWyS6k3oxdxvfuQy+in9El+4E9QkRg2z3RZHlDz INa7e/kcdj5y/IC2GfC+iapz4FN2cvIBL6EBInREk6zkVows6KLIvSaVhyXRHA6rg0RF 9Opu8SoyIGiW28K++WzmQ0g8YSGpHL7OC1zitelUZb0zfdLgdheTsLjMLZoTUqjahnLS 5J/iqEfgDwImyR/WR+H+PtPgViuoJmUujSd/SNtQFed7DWqsl7T7NQcZ7zmMCxRX4lQX s+Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=/BNFBxK5k2SXALkrlKrq7eQ0lfTe7DZnyy09sG3gFQA=; b=nmMK2ea8pjuC85pymhU+G6xPGqRUWsI+eQMa4dwP4k0/z4mcYPm2PcUHAlzpXKxJ+/ RbJOQ2gUgk1QOgu6U1vYLMTf8a1ov3GoM4Yt+tCysz3YO6iqfHmPtnYDXw1ib6wbrI6Z pNwdBW5MSLNxpZK4yhjwvQC9QMPPZtdkX4Li3IK9oWj7rNrQwWF5pwI7X1wd5eR4dbva lZI1HCh4rm5o2bs+KcogHgh6tBhLJYIwTH/kZOCva1rrtPVOpFtszv0HJW0WlomDQlnT sbWpWhynmdEqUKn0oUxsyT1kezWIPtyE/Ut1nfjPTVRHbN/ckW6LbFQkgHn5dqW/zeae SqQg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k69-20020a638448000000b00439befcd2b7si11508760pgd.725.2022.09.24.00.55.58; Sat, 24 Sep 2022 00:56:12 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233463AbiIXHaU (ORCPT + 99 others); Sat, 24 Sep 2022 03:30:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233492AbiIXHaQ (ORCPT ); Sat, 24 Sep 2022 03:30:16 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5E4D857EA for ; Sat, 24 Sep 2022 00:30:14 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MZLCD5TJ2zHtj7; Sat, 24 Sep 2022 15:25:28 +0800 (CST) Received: from dggpemm500013.china.huawei.com (7.185.36.172) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 24 Sep 2022 15:30:12 +0800 Received: from ubuntu1804.huawei.com (10.67.175.36) by dggpemm500013.china.huawei.com (7.185.36.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 24 Sep 2022 15:30:12 +0800 From: Chen Zhongjin To: CC: , , , , , , , , , , , Subject: [PATCH -next] x86: kprobes: Remove unused macro stack_addr Date: Sat, 24 Sep 2022 15:26:29 +0800 Message-ID: <20220924072629.104759-1-chenzhongjin@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.175.36] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500013.china.huawei.com (7.185.36.172) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 An unused macro reported by [-Wunused-macros]. This macro is used to access the sp in pt_regs because at that time x86_32 can only get sp by kernel_stack_pointer(regs). '3c88c692c287 ("x86/stackframe/32: Provide consistent pt_regs")' This commit have unified the pt_regs and from them we can get sp from pt_regs with regs->sp easily. Nowhere is using this macro anymore. Refrencing pt_regs directly is more clear. Remove this macro for code cleaning. Signed-off-by: Chen Zhongjin --- arch/x86/kernel/kprobes/core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c index 4c3c27b6aea3..eb8bc82846b9 100644 --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c @@ -59,8 +59,6 @@ DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); -#define stack_addr(regs) ((unsigned long *)regs->sp) - #define W(row, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf)\ (((b0##UL << 0x0)|(b1##UL << 0x1)|(b2##UL << 0x2)|(b3##UL << 0x3) | \ (b4##UL << 0x4)|(b5##UL << 0x5)|(b6##UL << 0x6)|(b7##UL << 0x7) | \ -- 2.17.1