From patchwork Wed Feb 1 16:26:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 51461 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp376190wrn; Wed, 1 Feb 2023 08:30:04 -0800 (PST) X-Google-Smtp-Source: AK7set/QW8HJ+HO3LeeBwtHGyyiU1eI0TPBef+gwkbZfysj34omrctG9GphTyKiqmX/UkzTy4Xts X-Received: by 2002:a05:6a20:3c8d:b0:bc:d18d:b58b with SMTP id b13-20020a056a203c8d00b000bcd18db58bmr4243423pzj.13.1675269004257; Wed, 01 Feb 2023 08:30:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675269004; cv=none; d=google.com; s=arc-20160816; b=Sz4ZnyFhAX18QTy+/+YrMI6ZReNwe3lFZR+SMedYQsNqtcplwsC5lbl0quvD0aXNV0 IAjFqZ2tv++2XTquU7ZOcwyVCys+tpEkFsYlM+FG7w7vjuVwzqr7+3CIi/zxLT26DrPi XDgGpanhbzUho9pwHUsSnqT/WSK789SFV7Vg9W/O8q2v+YFBoOxdUh9XllBAPdsseAn3 DUAYeCfUh41MOvaMF87Ob4GtBdKaJUhUvCGxNOQSxA2DpdRmz0ZKHcPU8mGWaBnJO99A KDUHD5gpJ2mMZJbxDcGKWXvU/kiZ46g7/UY2f+VI5xnrUzKVlbMvRB6zrQ+v+zPaINCI mHcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=b0Ifn1PH0wmWMUpzh2RXtGoObIymq9QWY0W9OAfa5nA=; b=yuNSuf9ti+uaS1CuzQC0KBTdd0K2UNaBz8Fs8Xf7cLFxgtUcuiR2GK2nyTJesj8cTi 7abhIANJE6YlL20n+ICgLXLeNsQCm66dIIV5MKPPLy7qthP1HHbj6j36Yw/mGo54cD1J osaVrAF/7DjrGdvxyFQFeKt7MjHAmW1LQnp+Xiuok1fbimYZWWXTVz2e71VJy5QF+Fz/ 1j7j+Pxj3Kw7DE4o0++ZcAFYuKQNHcDQ+3/I5qJfDHsr1QnfZcFGi/KAlaeA0tZc41K4 Fr7W8sTOJwL6xdu8FrwIkPa0hNojA4NzIGdEN0YwhNDRptbUDRXRU5rlzRJXgyo1EDYb 96Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=38+Jnfa8; dkim=neutral (no key) header.i=@linutronix.de header.b=iyAgTCNQ; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b9-20020a63d809000000b004cf19382fcasi18849566pgh.238.2023.02.01.08.29.51; Wed, 01 Feb 2023 08:30:04 -0800 (PST) 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=@linutronix.de header.s=2020 header.b=38+Jnfa8; dkim=neutral (no key) header.i=@linutronix.de header.b=iyAgTCNQ; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232094AbjBAQ0p (ORCPT + 99 others); Wed, 1 Feb 2023 11:26:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbjBAQ0i (ORCPT ); Wed, 1 Feb 2023 11:26:38 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C85E7921F; Wed, 1 Feb 2023 08:26:36 -0800 (PST) Date: Wed, 01 Feb 2023 16:26:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1675268794; h=from:from:sender:sender:reply-to: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; bh=b0Ifn1PH0wmWMUpzh2RXtGoObIymq9QWY0W9OAfa5nA=; b=38+Jnfa8VdLBhdcRE30W92onKblbsCKk1Iwi6mDrX5qtHap9BjqN546g1CWhKlYZ2/CksW PRRTrH5kh7EStZ+AgqMNZwLB5UUFzlz2c7Wnjlmm9rR18Pmv7A4CJ++SkbkR9YJlK84gYO JuaBua8sBNH+gbPrHzN3KRJw5CjET/kzest6YdZ+RYBBmecWN+HbJEHrlYZPdWeq/966KQ F9Q6ZoGY6wI1hctmDblxaAHDLGBx2ZJPFuJqZ9aEBbTSwghwjssQzXnLOisYOvqfkXtZxC sle3B+tp4Lt1Q+ft5ccLrEXitP0IERPVNH0X7FbpM12luwTZBtWZoX922PfVuw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1675268794; h=from:from:sender:sender:reply-to: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; bh=b0Ifn1PH0wmWMUpzh2RXtGoObIymq9QWY0W9OAfa5nA=; b=iyAgTCNQVBeoy86prrfrY1h1hy3rKHgaXpCHTB1xVV5ps2ZnG0wpYZlB99744HWFMcNQ6e WC25G7j6naFKsCCA== From: tip-bot2 for Thomas =?utf-8?q?Wei=C3=9Fschuh?= Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/core] objtool: Make struct entries[] static and const Cc: linux@weissschuh.net, Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221216-objtool-memory-v2-1-17968f85a464@weissschuh.net> References: <20221216-objtool-memory-v2-1-17968f85a464@weissschuh.net> MIME-Version: 1.0 Message-ID: <167526879446.4906.10494468720128495738.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756646870912648862?= X-GMAIL-MSGID: =?utf-8?q?1756646870912648862?= The following commit has been merged into the objtool/core branch of tip: Commit-ID: 4bf285955dcac1810c5677bf69f5ae7a2e9be1cf Gitweb: https://git.kernel.org/tip/4bf285955dcac1810c5677bf69f5ae7a2e9be1cf Author: Thomas Weißschuh AuthorDate: Tue, 27 Dec 2022 16:00:57 Committer: Josh Poimboeuf CommitterDate: Mon, 30 Jan 2023 16:28:18 -08:00 objtool: Make struct entries[] static and const This data is not modified and not used outside of special.c. Also adapt its users to the constness. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20221216-objtool-memory-v2-1-17968f85a464@weissschuh.net Signed-off-by: Josh Poimboeuf --- tools/objtool/special.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/objtool/special.c b/tools/objtool/special.c index 9c8d827..baa85c3 100644 --- a/tools/objtool/special.c +++ b/tools/objtool/special.c @@ -26,7 +26,7 @@ struct special_entry { unsigned char key; /* jump_label key */ }; -struct special_entry entries[] = { +static const struct special_entry entries[] = { { .sec = ".altinstructions", .group = true, @@ -65,7 +65,7 @@ static void reloc_to_sec_off(struct reloc *reloc, struct section **sec, *off = reloc->sym->offset + reloc->addend; } -static int get_alt_entry(struct elf *elf, struct special_entry *entry, +static int get_alt_entry(struct elf *elf, const struct special_entry *entry, struct section *sec, int idx, struct special_alt *alt) { @@ -139,7 +139,7 @@ static int get_alt_entry(struct elf *elf, struct special_entry *entry, */ int special_get_alts(struct elf *elf, struct list_head *alts) { - struct special_entry *entry; + const struct special_entry *entry; struct section *sec; unsigned int nr_entries; struct special_alt *alt;