From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCDBFC4332F for ; Tue, 27 Dec 2022 16:02:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231682AbiL0QCz (ORCPT ); Tue, 27 Dec 2022 11:02:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229736AbiL0QCs (ORCPT ); Tue, 27 Dec 2022 11:02:48 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3104EA9 for ; Tue, 27 Dec 2022 08:02:46 -0800 (PST) From: Thomas =?utf-8?q?Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1672156964; bh=kT8j13gOnAKWYlSV+YMQw4TiVnvJKl0cCOa21YM32M0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NryKx8/WX4EttN2Wi7A01V/T+QeFOxPEcOYewudl8K5pU06HrP1jzw1Q1U/9g/UnF BaS2e9pdkU0JrXbUgolwwWI9nN4ODSobyrqO+IQk5DABU29VMAviScn9H34JGMgyX1 B3iiNyzM33rdyzepT8vFzQdaHGMxvMGu6CH7arxU= Date: Tue, 27 Dec 2022 16:00:57 +0000 Subject: [PATCH v2 1/8] objtool: make struct entries[] static and const MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-Id: <20221216-objtool-memory-v2-1-17968f85a464@weissschuh.net> References: <20221216-objtool-memory-v2-0-17968f85a464@weissschuh.net> In-Reply-To: <20221216-objtool-memory-v2-0-17968f85a464@weissschuh.net> To: Josh Poimboeuf , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Thomas =?utf-8?q?Wei=C3=9Fschuh?= X-Mailer: b4 0.11.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1672156865; l=1357; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=kT8j13gOnAKWYlSV+YMQw4TiVnvJKl0cCOa21YM32M0=; b=KVBj9VZ9YQSV25Jq2t8yb7ci7FBwnt5YjyakqphuIDIRCP6beV5l2wrS/0h8KA8/9ibZai5PYDGO 8HfVrMblAEPjhqpksBwKtiEl3VZG0yIzdaDrrLGbQJkoy4ZiEGjG X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 9c8d827f69af..baa85c31526b 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; -- 2.39.0