From patchwork Sat Feb 4 10:17:12 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: 52763 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1308028wrn; Sat, 4 Feb 2023 03:20:02 -0800 (PST) X-Google-Smtp-Source: AK7set8XbUfH0y0OYPabH5SPr/iB0fGth9BlSKzCHqhb1E7NfVyoKbY1whadBO+4MnqvE64xfGfh X-Received: by 2002:a17:906:b2cb:b0:888:497a:c51c with SMTP id cf11-20020a170906b2cb00b00888497ac51cmr12751358ejb.12.1675509602407; Sat, 04 Feb 2023 03:20:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675509602; cv=none; d=google.com; s=arc-20160816; b=kvrzBlD6CcEuUHB60AKTNCa6Y9/SMOjQv0QHr9NK4YB+P3ZoysKQdDOuywrJNSPfND 6N5FyZW0YGUN44wkOeTzY6Es63Chz0M8Zi5Y2i7BWsPeAXXGLBqtZqkLa1WEzO4S0g2g fp+owfZ93HxQiOOB/CkBxkN1UBeZYjT01EIafSJ2xMyfocwUSGo1TuRKy52N66rhqwej KzlOL0y2aDhEHmQ2xDLFmxfFnnHkSEO23lAwsNVlO+eOwSZomwkE+hyIN/VJNJB4cSUK kkEJ6FNJvfSuyniDsB1Qwh/+zVFm9W1HaiWeAd8+qnNd3xccio1kb+G6c/jgYrl+PL7G 6s4w== 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=0wJn3bVGYanUgnPRXGSIEsEijONrQy3w2WvDeWz6/vo=; b=ko1xDZ7PbUpoKnKq+D5Kyxvi4K8a7lsh8DslrA6Lt4ThKPUv5DKzoYMcq4DUmszc68 TBXcHxHan/mYuWv9xIPdnn6hTlERKZh+S7Sapi8/NPKWdYm3RFbMD72f5EynQ84dOaK7 15z/y11H9Kq1uRnFPTrKhduVWzFbVIoPfCJJyEr1lEjFc7k8tmSFTU3KJT5dadcEPO0c S5CWHcSDtVdpT5t+N2JqHwRt5rh/62LiRYH1XGfb9GSLW/JnV5SK8eHDajQLs/BxygLw xZeRXzL3QP5XWEA2oOoimmNnZGrJ9U2kAuu3q9By1FWhPLipzRCtsu5FOr6WvHhk1Tkl YSCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=eywHCIxF; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=nKw1FQTT; 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 fq4-20020a1709069d8400b00892bd6aca11si1419290ejc.13.2023.02.04.03.19.37; Sat, 04 Feb 2023 03:20:02 -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=eywHCIxF; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=nKw1FQTT; 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 S233697AbjBDKRo (ORCPT + 99 others); Sat, 4 Feb 2023 05:17:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233325AbjBDKRY (ORCPT ); Sat, 4 Feb 2023 05:17:24 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AAB26EAF8; Sat, 4 Feb 2023 02:17:14 -0800 (PST) Date: Sat, 04 Feb 2023 10:17:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1675505832; 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=0wJn3bVGYanUgnPRXGSIEsEijONrQy3w2WvDeWz6/vo=; b=eywHCIxFBOsPeJ9e1OsE8+x+TF3r4zi/IILrht+yYoA7DIyDwTuOPhrKryu5T2NS0VrprE 80AjXHM0vaFdk+fEN2v1i0wV5CsyFmix8uNUkAyci26sRosOyXE9ooTVDo6fGOlZm5apxD b2OEIFAwOao+v1X/rJiNJcuiO2NPg8MPb0xKO8MOWaofGzvQiJsVB81fUpwmKzBXOXab+7 bMEL2nFwGWP0oe3C9y0w4sYXs1GqRCWmhlG0333XZvYQnzAinEPxxDAC7FniiY/rt56Nwb PvelKdsA966EKtRt/WtkBC8MWXAs7svmgtE8afkupnM9OXNPJJMiz4CszW14og== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1675505832; 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=0wJn3bVGYanUgnPRXGSIEsEijONrQy3w2WvDeWz6/vo=; b=nKw1FQTTqbEYQhUBLBQkrRIJ8lHQCfiylxrIf3kxkw3tD+Qv4LcOUJlG5mzSw+DqdRUIo3 tpS4b7xmPwRo+4Ag== 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: <167550583213.4906.16896019408675810020.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?1756899156772544867?= The following commit has been merged into the objtool/core branch of tip: Commit-ID: d93ee0553cf2e83c1696a18423bcf05b94b85e1d Gitweb: https://git.kernel.org/tip/d93ee0553cf2e83c1696a18423bcf05b94b85e1d Author: Thomas Weißschuh AuthorDate: Tue, 27 Dec 2022 16:00:57 Committer: Josh Poimboeuf CommitterDate: Wed, 01 Feb 2023 09:15:22 -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;