Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp762057rdb; Thu, 18 Jan 2024 20:01:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkpuwoaooLvOJUNtKlhv8OQpwYbbz9Gtty+hQKbINM9fzgj2dEtfctA+qdOICiVTIv98SV X-Received: by 2002:aa7:da91:0:b0:559:d50c:c366 with SMTP id q17-20020aa7da91000000b00559d50cc366mr781719eds.58.1705636867672; Thu, 18 Jan 2024 20:01:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705636867; cv=pass; d=google.com; s=arc-20160816; b=sDJ+Ct8lqRxh7+Mlfu5dY0iTieTzBus2YDtIP4EStjjtkE222kebVkYyznh+0BIsW5 p3W/CuO0enzcsMC5wp/scbBeWK/rahv3yCBmTjZ0tgIRSFAILjLBicilLPeAPr6+bV6u 1Wuja3MmRb/o7hHSXgm13zk/EnpcNKbP1nT2Iyw1Xl59udz76elMWOghn0puSNfGQZvw eA3VzMpmGQ3j2dy/QW8UBaYSzFAuNRh9WlUphPA8wAjjRIKdYSJO8elhOxsoCvSXDoZu C3wZPULVCDQCX3HaMVhZkg9B4yxHXjJ9u8hdvuNKUmApPdSMAknjm+VVze8cqXTs0Kx1 zcNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=+JAp/I4AHWymktAyZGz9Ne6LhfatwybI4EzP85ctCoY=; fh=+9UhU589H/AYN6mu5McDs8EmZI1N64ROHq00CLawiu0=; b=Cu8K7AdrX+zj9WKxZ8BvztrYJcZ79s6D8OLUj/H16+Tpj8+EP8xQeAgnldH/N7caRd urLhfB4F00TgViPlF+XykCBeLsX7hSKLNZXlud/tpmo07vjQl7sWcgP0ZrX5WmsmnNlg cHbPf9JSzeJtcWaBPI0IgVqrRU1M0uXkXdjiouUmA6ZGK9WKjDZafKvpzAcw7yH9++WW 1u5F/BGpL6nGN9Fz06V9QqYDJxKs6hinBW1VN/NWE6UVMUZVoeDiKZJGFoP6jSP4ayyz Ea90hPYXISKuy71m4Z6vRB0H4dY9iQJnSb/XKF0Rq2/dwdLwQoXhnmCoRH09Vxn/HprS pCzQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lBy3Bzy9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-30755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30755-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t35-20020a056402242300b0055536f0db2esi7978766eda.155.2024.01.18.20.01.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 20:01:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lBy3Bzy9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-30755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30755-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id ED3831F22028 for ; Fri, 19 Jan 2024 04:01:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C6C22117; Fri, 19 Jan 2024 04:00:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lBy3Bzy9" 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 4393E1C15 for ; Fri, 19 Jan 2024 04:00:55 +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=1705636856; cv=none; b=Vuw9AZNzp77FH/R6mQ8qi5XL11pZujP0iac85W9IcfDmpkAFPhhvn9Io1hCP8DE/JZV00B9DbS2m9rQkZn142HcBB/GLpE/GEplYVWP55M6Uz7nixWhL2vRJ7LtEtvqV3/4dc4lqO1bOC+Hv9c6bdLDJkIux+wdMwXXOicgsRVQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705636856; c=relaxed/simple; bh=fkABRRGLW7RKFfCsuZ1YMNSS2p5FF4eBJVlssM9g2SQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gCXlhvYE22FmuRq2fXnOEUqH6og/fV4/Abndi7BJ+bUWOM1B1PDNb9gwLVJB8TnGEsKKfd6Ad/QhegXDpEi+EUOe3JtmFA/oVkGEtH65vdVgYk+Y/QuX7LaJfQKbwgpk+QgWsJLsLETsbMgWrJZboTK+8Tyv3XbyGJ4WGO8ck5I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lBy3Bzy9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94593C433F1; Fri, 19 Jan 2024 04:00:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705636855; bh=fkABRRGLW7RKFfCsuZ1YMNSS2p5FF4eBJVlssM9g2SQ=; h=From:To:Cc:Subject:Date:From; b=lBy3Bzy9comrKqJeJgeD6XCK+VBjj983C6N/3sdm9lrSA7OacD9A8PzIG38XefnT9 QtQMiPkdKNlG5Z4JJkTICAH6EPhIydHrtyJDwJBzMrpyroAkenkVb2Y33AN8is27iw wvatuMMCOgL52dOJTs0bKSYo7AEKvxRrruniMEyimuuNAa+xr8ug97P2pypwfBEcXB GANp5mLwuEyvnNWhZxA2+n4NhrH0ShYQCUXEPoKLUav36Iqa4MVABF8Ku0FQAZ4Smv GHHMl4QZ59PYVTxkpYPseZ/5/RiSO5iVP44f13M8K9a8g88T2RlaXa4qKgk5EccCyo IaGaEKea9b2Ow== From: alexs@kernel.org To: Josh Poimboeuf , Peter Zijlstra , linux-kernel@vger.kernel.org Cc: Alex Shi Subject: [PATCH] objtool: remove unused parameter Date: Fri, 19 Jan 2024 12:02:41 +0800 Message-ID: <20240119040241.2925185-1-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Alex Shi Remove unused file parameter from init_insn_state(), insn from has_modified_stack_frame(). Signed-off-by: Alex Shi To: linux-kernel@vger.kernel.org To: Peter Zijlstra To: Josh Poimboeuf --- tools/objtool/check.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 548ec3cd7c00..ecc56a5ad174 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -274,8 +274,7 @@ static void init_cfi_state(struct cfi_state *cfi) cfi->drap_offset = -1; } -static void init_insn_state(struct objtool_file *file, struct insn_state *state, - struct section *sec) +static void init_insn_state(struct insn_state *state, struct section *sec) { memset(state, 0, sizeof(*state)); init_cfi_state(&state->cfi); @@ -2681,7 +2680,7 @@ static bool is_special_call(struct instruction *insn) return false; } -static bool has_modified_stack_frame(struct instruction *insn, struct insn_state *state) +static bool has_modified_stack_frame(struct insn_state *state) { struct cfi_state *cfi = &state->cfi; int i; @@ -3474,7 +3473,7 @@ static int validate_sibling_call(struct objtool_file *file, struct instruction *insn, struct insn_state *state) { - if (insn_func(insn) && has_modified_stack_frame(insn, state)) { + if (insn_func(insn) && has_modified_stack_frame(state)) { WARN_INSN(insn, "sibling call from callable instruction with modified stack frame"); return 1; } @@ -3504,7 +3503,7 @@ static int validate_return(struct symbol *func, struct instruction *insn, struct return 1; } - if (func && has_modified_stack_frame(insn, state)) { + if (func && has_modified_stack_frame(state)) { WARN_INSN(insn, "return with modified stack frame"); return 1; } @@ -3814,7 +3813,7 @@ static int validate_unwind_hints(struct objtool_file *file, struct section *sec) if (!file->hints) return 0; - init_insn_state(file, &state, sec); + init_insn_state(&state, sec); if (sec) { sec_for_each_insn(file, sec, insn) @@ -4221,7 +4220,7 @@ static int validate_section(struct objtool_file *file, struct section *sec) if (func->type != STT_FUNC) continue; - init_insn_state(file, &state, sec); + init_insn_state(&state, sec); set_func_state(&state.cfi); warnings += validate_symbol(file, sec, func, &state); -- 2.43.0