From: Jonathan Marek <jonathan@marek.ca>
To: linux-efi@vger.kernel.org
Cc: Ard Biesheuvel <ardb@kernel.org>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@linux.intel.com>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 2/3] efi/libstub: remove uneccessary cmdline_size init/check
Date: Fri, 11 Oct 2024 18:48:01 -0400 [thread overview]
Message-ID: <20241011224812.25763-2-jonathan@marek.ca> (raw)
In-Reply-To: <20241011224812.25763-1-jonathan@marek.ca>
efi_convert_cmdline() always sets cmdline_size to at least 1 on success,
so both the initialization to 0 and > 0 comparison are unecessary.
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
---
drivers/firmware/efi/libstub/efi-stub.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c
index 709ae2d41a632..f166614ef8432 100644
--- a/drivers/firmware/efi/libstub/efi-stub.c
+++ b/drivers/firmware/efi/libstub/efi-stub.c
@@ -112,7 +112,7 @@ static u32 get_supported_rt_services(void)
efi_status_t efi_handle_cmdline(efi_loaded_image_t *image, char **cmdline_ptr)
{
- int cmdline_size = 0;
+ int cmdline_size;
efi_status_t status;
char *cmdline;
@@ -137,7 +137,7 @@ efi_status_t efi_handle_cmdline(efi_loaded_image_t *image, char **cmdline_ptr)
}
}
- if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && cmdline_size > 0) {
+ if (!IS_ENABLED(CONFIG_CMDLINE_FORCE)) {
status = efi_parse_options(cmdline);
if (status != EFI_SUCCESS) {
efi_err("Failed to parse options\n");
--
2.45.1
next prev parent reply other threads:[~2024-10-11 22:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-11 22:48 [PATCH 1/3] efi/libstub: fix efi_parse_options() ignoring the default command line Jonathan Marek
2024-10-11 22:48 ` Jonathan Marek [this message]
2024-10-12 7:49 ` [PATCH 2/3] efi/libstub: remove uneccessary cmdline_size init/check Ard Biesheuvel
2024-10-11 22:48 ` [PATCH 3/3] efi/libstub: consider CONFIG_CMDLINE for initrd= and dtb= options Jonathan Marek
2024-10-12 7:54 ` Ard Biesheuvel
2024-10-12 12:00 ` Jonathan Marek
2024-10-12 13:36 ` Ard Biesheuvel
2024-10-12 14:07 ` Jonathan Marek
2024-10-12 14:50 ` Ard Biesheuvel
2024-10-12 15:00 ` Jonathan Marek
2024-10-15 0:13 ` kernel test robot
2024-10-15 2:08 ` kernel test robot
2024-10-12 7:46 ` [PATCH 1/3] efi/libstub: fix efi_parse_options() ignoring the default command line Ard Biesheuvel
2024-10-12 11:55 ` Jonathan Marek
2024-10-12 13:15 ` Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241011224812.25763-2-jonathan@marek.ca \
--to=jonathan@marek.ca \
--cc=ardb@kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox