From patchwork Thu Jan 2 23:26:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 13925001 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1616FC13D; Thu, 2 Jan 2025 23:25:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735860332; cv=none; b=le0VZfjgCYZ8iaFXxcWVZht4gSt+w3bCgdbdVLtHlO8WfBrmbgBTZg+w128WSNAqAHcdz/zMtY0pONR24tDhGl7LyEnzQVO7tknOgStnmaYKpbIU0k5GL7szYH215Op/Z/sOaXG+2Q2dpamXvOfdHrLdhbkPLLAx+J/WLRnTBnE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735860332; c=relaxed/simple; bh=dtsZSR5PGN9lZfaBFK/cPKjmy4rRTW/a7uREJxy5Oaw=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=ZXkNkpkD1z9lvQld1vBwG+x6xh26cLQNbrDmISTVosyR8W4Fz5hCSCM8+KppzvU7S2cu2P3GXXss/xMwVyic1VmAnlvkIoUopjnAFs7QSYzjeYGUa3nqPkvDoh4ImNTQL4baaYWfTE7EqH9hEKhZ0LUZvqZkAdN58IDvSWYmnuw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA09EC4CEDE; Thu, 2 Jan 2025 23:25:31 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1tTUaX-00000005Yrn-0SxA; Thu, 02 Jan 2025 18:26:49 -0500 Message-ID: <20250102232648.958831401@goodmis.org> User-Agent: quilt/0.68 Date: Thu, 02 Jan 2025 18:26:11 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, bpf Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Peter Zijlstra , Linus Torvalds , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Zheng Yejian , Martin Kelly , Christophe Leroy , Josh Poimboeuf Subject: [PATCH v2 02/16] scripts/sorttable: Remove unused write functions References: <20250102232609.529842248@goodmis.org> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Steven Rostedt The code of sorttable.h was copied from the recordmcount.h which defined various write functions for different sizes (2, 4, 8 byte lengths). But sorttable only uses the 4 byte writes. Remove the extra versions as they are not used. Signed-off-by: Steven Rostedt (Google) --- scripts/sorttable.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/scripts/sorttable.c b/scripts/sorttable.c index 83cdb843d92f..4dcdbf7a5e26 100644 --- a/scripts/sorttable.c +++ b/scripts/sorttable.c @@ -68,8 +68,6 @@ static uint32_t (*r)(const uint32_t *); static uint16_t (*r2)(const uint16_t *); static uint64_t (*r8)(const uint64_t *); static void (*w)(uint32_t, uint32_t *); -static void (*w2)(uint16_t, uint16_t *); -static void (*w8)(uint64_t, uint64_t *); typedef void (*table_sort_t)(char *, int); /* @@ -146,31 +144,11 @@ static void wbe(uint32_t val, uint32_t *x) put_unaligned_be32(val, x); } -static void w2be(uint16_t val, uint16_t *x) -{ - put_unaligned_be16(val, x); -} - -static void w8be(uint64_t val, uint64_t *x) -{ - put_unaligned_be64(val, x); -} - static void wle(uint32_t val, uint32_t *x) { put_unaligned_le32(val, x); } -static void w2le(uint16_t val, uint16_t *x) -{ - put_unaligned_le16(val, x); -} - -static void w8le(uint64_t val, uint64_t *x) -{ - put_unaligned_le64(val, x); -} - /* * Move reserved section indices SHN_LORESERVE..SHN_HIRESERVE out of * the way to -256..-1, to avoid conflicting with real section @@ -277,16 +255,12 @@ static int do_file(char const *const fname, void *addr) r2 = r2le; r8 = r8le; w = wle; - w2 = w2le; - w8 = w8le; break; case ELFDATA2MSB: r = rbe; r2 = r2be; r8 = r8be; w = wbe; - w2 = w2be; - w8 = w8be; break; default: fprintf(stderr, "unrecognized ELF data encoding %d: %s\n",