Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2281745imn; Mon, 1 Aug 2022 18:53:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR7kmva938cW3MeDSVs5k31DmGb0I/yfl7IslomUyLgAY+v0qFPgZ2tXnF/L5iEOivauyCXC X-Received: by 2002:a63:1d5:0:b0:41c:6b8a:df4a with SMTP id 204-20020a6301d5000000b0041c6b8adf4amr36638pgb.410.1659405189831; Mon, 01 Aug 2022 18:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659405189; cv=none; d=google.com; s=arc-20160816; b=Cw6PSTGr6cDzZycpn22UhWtZFwRTabJtF5iVMY/uNEDazMCuggTpxVicXs8nYURH96 +ry2ESRbGxHYY1b9RHTkIIg1UsyEsIEM10O7MIlAp/KD8X233TLa3sWLJOVLfjVk1X4k l8M39I0TgdlNk57Fck1X7UT5eM35G476UsINUFLAK73A2QnX0aWHz3CP+vDv+QL/6Qd1 EvRiVTzMAYHthyBrMcsCsyyLNtzZpmXwUBmSOwjqoV2eLj+fQHkjXxiUGYlvnQAZx2rZ S0bCBKms6cWqUPVvmgV7NBcGhcuXDF50ZrpRWOlmUPDwV+rfYCq+qC1yj4fQlE2w976Z A3ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PKqgNNnCDZjkbrB/4XMJ1GmU2M1ZwPhAdfOnhCfoEZ8=; b=TjST/zZjmBS1/gYTddBzpHtEz0yEqNhuq6mSyHsdBeRjzv8IyKrkYovjs4V+KXeWix axDjse9Ijpo+MMl/hmRn3tj9N3gXL4ONrupT9uXc77Mrt9hdtpVskEmIgGNys9qBDlWF 59rtQS0mzpLLEjUico2Q6/kGNlIlVyyS585XRGqPAxLfdxvBh2WXFuZaR1NLgSL/CKQV kJiq+Q7L2gz6OzV9wiqpQiKYnzIk3P4/OanI2PkJuXmzTkkggzgeR4jJ1929pWqC0VXy Mc0eGHVwYuwi939GlxYg/bG5lZMc3yXJLpWZc2cbFlWKPxL6WeTffAKq6an3IAE5GTT+ 1Q6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M5AxP4mf; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v184-20020a6389c1000000b0041bc1f00d19si7762782pgd.97.2022.08.01.18.52.55; Mon, 01 Aug 2022 18:53:09 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M5AxP4mf; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235507AbiHBBvu (ORCPT + 99 others); Mon, 1 Aug 2022 21:51:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235481AbiHBBvn (ORCPT ); Mon, 1 Aug 2022 21:51:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B6462CC93; Mon, 1 Aug 2022 18:51:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ED3356109E; Tue, 2 Aug 2022 01:51:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97680C433D7; Tue, 2 Aug 2022 01:51:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659405097; bh=J1kZYuBmy2p9V5rJr5cWhtju3zoN163Uf1mW1Uq9geI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M5AxP4mf4Iu3qEUZfXedzNz44vtyOofAn711pkzt4+DjVe7y+vBnBYB3ORnEwewTF g3JZIrZlG3+/r2GsZvkertUOTRHDQ4xpq9HwC/vFTUEed/ddDdupy3AaRdzQOM61B2 25K+ibXl/MR3xk6VK/o4djWkFi28TRcZAzAvtcJvGrHvMyc23FKW4m9ff9eJ2UzeG+ Cy5YwMvZ91HS5JGrOyDm5Fm65OEu3Hidy7UU7iQOwRV8HTE0WKwHkuXrCqqjGj99HT K1wKSGiNfA4RcYSvVE7yF+H211jM2NBf9jhKo1ck3+tCaES7gO+PANehJDpHbeYeyk wJZDNAJyKXMXA== From: Miguel Ojeda To: Linus Torvalds , Greg Kroah-Hartman Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Jarkko Sakkinen , Miguel Ojeda , Boqun Feng Subject: [PATCH v8 03/31] kallsyms: add static relationship between `KSYM_NAME_LEN{,_BUFFER}` Date: Tue, 2 Aug 2022 03:49:50 +0200 Message-Id: <20220802015052.10452-4-ojeda@kernel.org> In-Reply-To: <20220802015052.10452-1-ojeda@kernel.org> References: <20220802015052.10452-1-ojeda@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 This adds a static assert to ensure `KSYM_NAME_LEN_BUFFER` gets updated when `KSYM_NAME_LEN` changes. The relationship used is one that keeps the new size (512+1) close to the original buffer size (500). Co-developed-by: Boqun Feng Signed-off-by: Boqun Feng Signed-off-by: Miguel Ojeda --- scripts/kallsyms.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index f3c5a2623f71..f543b1c4f99f 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -33,7 +33,11 @@ #define KSYM_NAME_LEN 128 /* A substantially bigger size than the current maximum. */ -#define KSYM_NAME_LEN_BUFFER 499 +#define KSYM_NAME_LEN_BUFFER 512 +_Static_assert( + KSYM_NAME_LEN_BUFFER == KSYM_NAME_LEN * 4, + "Please keep KSYM_NAME_LEN_BUFFER in sync with KSYM_NAME_LEN" +); struct sym_entry { unsigned long long addr; -- 2.37.1