Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp82lql; Fri, 12 Apr 2024 01:18:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVBq5H+Xu2qWrIEFEvH+B95VvgA5AtFkbreeDtckLyg4peVfLrOTO18Pw6yATsnvDiB0xYirAgK+3arqOasbow69CM0PYQ1EB6p4LswaQ== X-Google-Smtp-Source: AGHT+IEnxLrbCRv/FZ4Qx//CfZu6BbuPm5fqqx68/4I5dFm19nqDD6FHgRurn7gttyQ0Mj1/3aCn X-Received: by 2002:a05:6808:199d:b0:3c6:f6f9:f6f7 with SMTP id bj29-20020a056808199d00b003c6f6f9f6f7mr670001oib.5.1712909924832; Fri, 12 Apr 2024 01:18:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712909924; cv=pass; d=google.com; s=arc-20160816; b=SA8OpWd3RDxQP0xWZorhUyDjIBS2NM7AIcndaDM4e32Ja5gTaU2qjupfvspDMA3XVE id+fZNQO2CQJl/zPiB1t26U7OHeWG6Il5jp5pg10OigFXv2T0yIlZQ1Zaiuv2bmNmwC8 /YTlybL7B4O1nEV1VkBozlfFd6Xl014wvo6Scsrc5DpxYGRJI6Eyiqh0TNaTzsJxgFs3 3t/tOG2ovq9g4b4UsEVYvm2sBresRs/vNNzt32Q/EUOFWty4A4bohdtVNriSwywzZ6Ba xAZt/URUTlHSwLsi29GRjfzMFpY7EW7GGyOAFHCH2hlJvMkpW9u2QGBHCFpvo5bt3unA 2CPQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Yu+6WxodjHSBLVJ4vTIVXBoPSo2RTNoZ1skXMjVRPl8=; fh=4S+ggujpA4qTXGDsKDWOH+WtVHYCZXETweqfqF66bJ8=; b=GBZ+4XnOcoDTm67x6+kl+pbR1ndCn6cvXM6/h3GGGm6yRFkUNMG6uB2WC73zTRA90u K4upDnCPGZXxNSa9xISHWSLWgNpNKV6c9/djFFUApkdGpLGeV8Vxn8MrWNrNRIFCF4zh /5KLpvPiCOkuDwE6e5a43cbsoVsqFIWHqGA4wA1aMfGEHrsmnVTj8V7l6e6N3k6yAImE vDd2lYx0mAQcMV3eAoFfsT6z6Lhj2E/UzN9qb8WRz1HUDlDQmcIo8q7elxvAE2GdXI+u GUbn1xm8xYGxDhO5lv6khTJuXy+yuphI3leQFapT/GBUrhQPN51Y8sNs9x/LSS1BiT1Q hE0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=CvhTx87m; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-142222-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142222-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n6-20020a63ee46000000b005f0a53f1f58si2683480pgk.768.2024.04.12.01.18.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 01:18:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142222-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=CvhTx87m; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-142222-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142222-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AD3D828470C for ; Fri, 12 Apr 2024 08:18:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 193CA5028B; Fri, 12 Apr 2024 08:18:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CvhTx87m" Received: from mail-oo1-f51.google.com (mail-oo1-f51.google.com [209.85.161.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A99750281 for ; Fri, 12 Apr 2024 08:18:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712909902; cv=none; b=os8qAjElrv6qv+t6n7k6WiNpU1T+TwDkYa5TvjORCThpKuzaZYshZSWSMPhLSKv2D+D6e4S4UQaEm4aWjW2tD+kvTlpeJImtyN5xmhRRn3tcPqGOR5BOClsxzYFuPhClQPE/A1Rj50ePRiHainrZ1Nimbda5qlQflEyuxbndE9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712909902; c=relaxed/simple; bh=O4sSaXp+ZDTJnVTQLLWMUtAcAU7KxZl+BWsdAjRQWok=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AoxODEVeq0yjxn6f6GO+NzPoh1Y77xOYLvt08iSRJeqtxXdEFWjNQ03IX+HLg3yKW8WMlfb42Ot1drDSFnzQdtJ4C4kyeDmtLChT0r9IDSypFmMpeN0h9JgiESW3VrOIdCrmw3YRk3j2iqrfQZmO9aP3M0DkQZ6owL9NjfzL/S8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CvhTx87m; arc=none smtp.client-ip=209.85.161.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f51.google.com with SMTP id 006d021491bc7-5aa2bd6f651so509824eaf.0 for ; Fri, 12 Apr 2024 01:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712909900; x=1713514700; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Yu+6WxodjHSBLVJ4vTIVXBoPSo2RTNoZ1skXMjVRPl8=; b=CvhTx87mqvefiiglmF3X2+3hYTPRY5sXcdoZAM5pwzbVUZlnPJO3zlI0ZSwk0+TnqT UWK6nxUTnamhRfcFukid9xgAGUdErdZR1W0HBGjbIq9kZd3eaDAYdZzGP2SpQP7C/uiZ ufes9LmSDltX1bSwZoYQ/naZR0H4Z2tFyrGJoOJiY8I9pTu/ot6xPEBQPFYEM5pIvaGQ lV5QZ8msGTyixOncL0svJ88X7rp/hhRWIZ6ZVqDgxsjPH0tLnkRD1SbYyGysUwsO8Hid TBjtOA0eTZ7rcoXPZLBQFi5qhqs96q7PXlz/lZv5Xn/IoZjK8IZZlVNMhrMRGw86xZa2 boFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712909900; x=1713514700; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Yu+6WxodjHSBLVJ4vTIVXBoPSo2RTNoZ1skXMjVRPl8=; b=L3snzE1B5AOQXBUwRVKWw+UqhpZIVDcTuEQS+az/x/+5O3v6N2UI0owMI8bdGF1E6k ZjJOz6gIWQJ/CV5stgAhpknhRluOd29oqr27tMPAfhL6874k+nQ3nkTWQqE21yVLwkX/ FgTqQ2Jy9S+VO7dtbbZ6n6IY2/EJwPxlfELBZjalObUhR0mUuoQ2HWj3i2646zdB537o 5AvAs6QIagItkjCUU7ZqRCGnEnYB0WcCk8DDGaKKMpozNSxsQ4izomVeih+P2dg/ux+Q /2q0HZjbaSVxOWJxT0PVVkx2VJsOOuHF1wC/ZouDAfVfjxE70UwMlmOmaxEFyodbkn6A CHzw== X-Forwarded-Encrypted: i=1; AJvYcCUckU7zUwG1UYCQWAi5UnZQueH3MGIiU+IBvPLgEd6wgVG0m4q85+v5Dgq0YonqUtsD18BiuRGbG/teMulXEFvnmyZLa5RWbU7T5uK0 X-Gm-Message-State: AOJu0YxjN+L+loCjQtF8Ug6VCUlNAFNT3ZuC3HI9ThrODqzoL4O+rL1y grddrDyE89kf9A6s/d7xQ2QouCT4UoLaXbSNTg7k8N6CnrqZEjbn X-Received: by 2002:a05:6358:38d:b0:186:16ef:444 with SMTP id a13-20020a056358038d00b0018616ef0444mr2091677rwj.17.1712909900012; Fri, 12 Apr 2024 01:18:20 -0700 (PDT) Received: from code.. ([144.202.108.46]) by smtp.gmail.com with ESMTPSA id i15-20020a63130f000000b005f43a5c4e7dsm2276393pgl.41.2024.04.12.01.18.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 01:18:19 -0700 (PDT) From: Yuntao Wang To: mhiramat@kernel.org Cc: akpm@linux-foundation.org, arnd@arndb.de, christophe.leroy@csgroup.eu, geert@linux-m68k.org, jpoimboe@kernel.org, kjlx@templeofstupid.com, linux-kernel@vger.kernel.org, ndesaulniers@google.com, peterz@infradead.org, rppt@kernel.org, tglx@linutronix.de, tj@kernel.org, ytcoode@gmail.com Subject: [PATCH v2 2/2] init/main.c: Minor cleanup for the setup_command_line() function Date: Fri, 12 Apr 2024 16:17:33 +0800 Message-ID: <20240412081733.35925-3-ytcoode@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240412081733.35925-1-ytcoode@gmail.com> References: <20240412141536.3f59fde391a6d28181562dbe@kernel.org> <20240412081733.35925-1-ytcoode@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This is just a minor cleanup to make the code look a bit cleaner. Signed-off-by: Yuntao Wang --- init/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init/main.c b/init/main.c index 5dcf5274c09c..d6383e397e9f 100644 --- a/init/main.c +++ b/init/main.c @@ -630,11 +630,11 @@ static void __init setup_command_line(char *command_line) if (extra_init_args) ilen = strlen(extra_init_args) + 4; /* for " -- " */ - len = xlen + strlen(boot_command_line) + 1; + len = xlen + strlen(boot_command_line) + ilen + 1; - saved_command_line = memblock_alloc(len + ilen, SMP_CACHE_BYTES); + saved_command_line = memblock_alloc(len, SMP_CACHE_BYTES); if (!saved_command_line) - panic("%s: Failed to allocate %zu bytes\n", __func__, len + ilen); + panic("%s: Failed to allocate %zu bytes\n", __func__, len); len = xlen + strlen(command_line) + 1; -- 2.44.0