Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp178915lqp; Wed, 22 May 2024 00:42:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtccptmB+w3DQ1v2aVr3XgsXQG/CZdmxguTp4D//PRkifg3uRfBry7lxvTiu5Ow0DbpFmRAmG1wggfVKMFncbfGjklrB+m8Z7X77UKTw== X-Google-Smtp-Source: AGHT+IEVy8Sw1J9y3jL7yuxiHBJO0v66QOCP+c20wQB7bk8YSyUX0ArjzpdFt7sgVUmeXktC1Zfk X-Received: by 2002:a05:6a21:920e:b0:1ad:746:3f61 with SMTP id adf61e73a8af0-1b1f87f88a3mr1392956637.28.1716363751095; Wed, 22 May 2024 00:42:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716363751; cv=pass; d=google.com; s=arc-20160816; b=ZI2Ur++UhDFveU3i5uufg4wUrGQEeifYoFDdRMuCqk4rZx+gF3oteASUe1gWwJZmzL KFKBqcCl9QfbS/AE1U1X429e2w6+Hch9MvmuIzgIYqqPN5CwwxQoBgfvw+shwUb2F5ZD Ys3Sx3Q2TZKZPB0GZYN2xtMtxxgYJ7SdwExkC1Wbzak0maHyUIq65p64gWGemeKNs8BK 9YXeSGrE5thcy1//jYgrBUhWm5UnNG89j2/4cTtB5okJy2ph4wRWK38AXykw5dRhhZaW qjdJ3HULmvUrhAQgV3ZRWXD8PkSpTSa7oUcl0pzWFKq3VcwOIwbOTlF+rbrEOqwyB1cJ V8Kw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:cc:subject:to:reply-to:sender:from:dkim-signature :dkim-signature:date; bh=/S8FV9j2oiYN4vc8M28HvM1rkdMF6GJRTY8GZcK8n0I=; fh=VqGsixQznpZ/n4aXcTuvQRIzhg2kAIDe5yDJxgMJ6Fo=; b=aLywVPoefjQ0lj38zbjMonYeVEGEWrVcuTn7HJNzM0rCn21oySxdbf/U0OWJxmHtIP eseCE8fBnAujBYo4sfg1YxHku+OkofBF3BuCbFW33SI7nh3fSx0nS5+l7LP8xWglcljn a3wwHLL6TpuOV6B8H82ijYCaTnK4kvc9CnuzfSEshQMyJ4f3EYiWLQKWcgXp3rQwZvH6 T03tgeE/O9yho8I+ZTrQYAYqv6xUclVabsFIYcV46UODhHAC0Z/cH3Eifn7QfRno7QKz smCEZz7OAqo8jEqGsWxh5+0QzXlDvDsQ2q0wVqKGnnadU+kK4xKoEzRA5ZBoKWF/ZZSn U0Pg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=bZt7NAqb; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-185870-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185870-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b9967228c0si2472279a91.15.2024.05.22.00.42.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 00:42:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185870-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=bZt7NAqb; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-185870-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185870-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id BC216B216C5 for ; Wed, 22 May 2024 07:42:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 536437D40D; Wed, 22 May 2024 07:42:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="bZt7NAqb"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wNt1EplU" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 61AEAB65E; Wed, 22 May 2024 07:42:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716363742; cv=none; b=UrRkVqcK8i8+lHozu/QJoHEX9j6bykVZ3tyBdjTXaTTHDaxQlkJHO5bXABwR2HBuTySDAlR7Jl2kJvbXQTOmk9RDLtwbVd2LD4NvB/FAH5RbMwQwDFSLEHKg3R0v6YJge8XjRPVfUh+zjrYGBnFTafqNYvIyUOMgiChrxwC9/z0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716363742; c=relaxed/simple; bh=rxKN71VpGxYtjkgxNReprJSlk2dzVEoZhuFNDMk6Wxc=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=PYVC0bhwl6jkHMZZWaCoo8H7whWxK21Dm8xJticBwwy3NysvsIUfh554CxwZPFGn0yMupAA0RnYlGEgqDdV+zF46Q0khqvB+MWS2Hgo2rJIsP6iZ3QB/JSVC8Sz14q4PSiVnc57mOSAKGX7k2Aby+ZO/vjC0vlYHWTsB872Q4g4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=bZt7NAqb; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=wNt1EplU; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Wed, 22 May 2024 07:42:17 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1716363737; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/S8FV9j2oiYN4vc8M28HvM1rkdMF6GJRTY8GZcK8n0I=; b=bZt7NAqbECp/PnWzUob6TL/gKv8Z8YuJNkRVrZn6gWaj9NTMzINmp/Zc/DITrxgyARFXGf 0M4/4LY42mzumSQwp37zl42ulr8oyGeX/Egw0B4TiABQrfdUzvCJY7lqINNIeAh/UdRqsp xRpsmjSOfI95jP6joHnYgJ36dgNvAlDwu6qAmRESQXL6CKtavCqTTge7Sa0YKWHY7GRNmh LCX2QG/KzJHyDlYrSOH6FpMS/hO9Q2GFWCKCOastOt8Irv8kpA6NM/iaN6crAfIRV67thv xFeHzREt65Af/Lw5cz8sirKywPTAwkXWGy1/2+bhrJMxuizWKUmnGeFvdUFo4g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1716363737; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/S8FV9j2oiYN4vc8M28HvM1rkdMF6GJRTY8GZcK8n0I=; b=wNt1EplUUBjWYO7LdjcO0vAKaXt+wrLnQ790VrXMrSCCHKlmFkRJr22h+GwnBOIr+Jl4gL /PNbf3iXAbvyENCA== From: "tip-bot2 for Ingo Molnar" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/boot] x86/boot: Clean up the arch/x86/boot/main.c code a bit Cc: Ingo Molnar , Uros Bizjak , linux-kernel@vger.kernel.org, x86@kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171636373729.10875.4887706398268223159.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the x86/boot branch of tip: Commit-ID: 52cccc64cf7c90696d09d54a383793804ba872ba Gitweb: https://git.kernel.org/tip/52cccc64cf7c90696d09d54a383793804ba872ba Author: Ingo Molnar AuthorDate: Tue, 21 May 2024 13:42:17 +02:00 Committer: Ingo Molnar CommitterDate: Wed, 22 May 2024 09:36:49 +02:00 x86/boot: Clean up the arch/x86/boot/main.c code a bit - Don't line break user-visible strings - Use consistent comment style - Remove unnecessary col80 line breaks Signed-off-by: Ingo Molnar Cc: Uros Bizjak Cc: linux-kernel@vger.kernel.org --- arch/x86/boot/main.c | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/arch/x86/boot/main.c b/arch/x86/boot/main.c index ac78f8c..9d0fea1 100644 --- a/arch/x86/boot/main.c +++ b/arch/x86/boot/main.c @@ -27,34 +27,32 @@ char *heap_end = _end; /* Default end of heap = no heap */ * screws up the old-style command line protocol, adjust by * filling in the new-style command line pointer instead. */ - static void copy_boot_params(void) { struct old_cmdline { u16 cl_magic; u16 cl_offset; }; - const struct old_cmdline * const oldcmd = - absolute_pointer(OLD_CL_ADDRESS); + const struct old_cmdline * const oldcmd = absolute_pointer(OLD_CL_ADDRESS); BUILD_BUG_ON(sizeof(boot_params) != 4096); memcpy(&boot_params.hdr, &hdr, sizeof(hdr)); - if (!boot_params.hdr.cmd_line_ptr && - oldcmd->cl_magic == OLD_CL_MAGIC) { - /* Old-style command line protocol. */ + if (!boot_params.hdr.cmd_line_ptr && oldcmd->cl_magic == OLD_CL_MAGIC) { + /* Old-style command line protocol */ u16 cmdline_seg; - /* Figure out if the command line falls in the region - of memory that an old kernel would have copied up - to 0x90000... */ + /* + * Figure out if the command line falls in the region + * of memory that an old kernel would have copied up + * to 0x90000... + */ if (oldcmd->cl_offset < boot_params.hdr.setup_move_size) cmdline_seg = ds(); else cmdline_seg = 0x9000; - boot_params.hdr.cmd_line_ptr = - (cmdline_seg << 4) + oldcmd->cl_offset; + boot_params.hdr.cmd_line_ptr = (cmdline_seg << 4) + oldcmd->cl_offset; } } @@ -66,6 +64,7 @@ static void copy_boot_params(void) static void keyboard_init(void) { struct biosregs ireg, oreg; + initregs(&ireg); ireg.ah = 0x02; /* Get keyboard status */ @@ -83,8 +82,10 @@ static void query_ist(void) { struct biosregs ireg, oreg; - /* Some older BIOSes apparently crash on this call, so filter - it from machines too old to have SpeedStep at all. */ + /* + * Some older BIOSes apparently crash on this call, so filter + * it from machines too old to have SpeedStep at all. + */ if (cpu.level < 6) return; @@ -119,16 +120,13 @@ static void init_heap(void) char *stack_end; if (boot_params.hdr.loadflags & CAN_USE_HEAP) { - stack_end = (char *) - (current_stack_pointer - STACK_SIZE); - heap_end = (char *) - ((size_t)boot_params.hdr.heap_end_ptr + 0x200); + stack_end = (char *) (current_stack_pointer - STACK_SIZE); + heap_end = (char *) ((size_t)boot_params.hdr.heap_end_ptr + 0x200); if (heap_end > stack_end) heap_end = stack_end; } else { /* Boot protocol 2.00 only, no heap available */ - puts("WARNING: Ancient bootloader, some functionality " - "may be limited!\n"); + puts("WARNING: Ancient bootloader, some functionality may be limited!\n"); } } @@ -149,12 +147,11 @@ void main(void) /* Make sure we have all the proper CPU support */ if (validate_cpu()) { - puts("Unable to boot - please use a kernel appropriate " - "for your CPU.\n"); + puts("Unable to boot - please use a kernel appropriate for your CPU.\n"); die(); } - /* Tell the BIOS what CPU mode we intend to run in. */ + /* Tell the BIOS what CPU mode we intend to run in */ set_bios_mode(); /* Detect memory layout */