From nobody Fri Dec 19 17:43:30 2025 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 84652254AF8 for ; Wed, 12 Mar 2025 14:38:12 +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=1741790294; cv=none; b=PcJEhQQVG0WYrmz2/HIXsGMY7yIFR7gY6RmcEpr5aHoPSrxxZ9Xc3goOrUmYEDcru4y4fJ4Suc/3EiahSzPoI5vKJE9VTU+kWk7LVSwNcEXBfkQXbVlu8kMijXF4EFMmFt8hdYmkboRBWTi62MoqcxaMK48/7Rb9ZRE2GurPZu4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741790294; c=relaxed/simple; bh=U3FmrnZ/4s402XkrjUkox44nIGjdsllUxaqR4EvG7sE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V9ywctNAbCgcJh3XDTU9V13Va7WM6VZ+trmwr19fuzFIB1AIxLDESbeAJrEwG9bu2W+lDSKpsoi1LP9gfSZ+2DskOoaaCwjcPti/kMpuAvhL0C8EIUdchTjAguHnZRVIT/xjW136r9gMwYigVymnmWgmS589zuNwO2e7uNE7I5U= 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=HWsz2x7p; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=gaTeWF0A; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="HWsz2x7p"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="gaTeWF0A" From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1741790291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WB5MGuGK6W7gcR2a2ltq4pCZnHfnzbng6Wl2oKZ1l8c=; b=HWsz2x7pbWSFn0Nyi5lZmCxfAEeSzrm54cl9VFKpxNXDIqxEntCYPlx6c9dC+k79stICxQ mSAsKXzVRsFfil1eF90/YxkysElzrfDBrYwaVYJOGCNwHyeyDTalzbD/A+8EEKds2R6cJR JY36GqL5oKP5NWdFrnmE/KxcKyStIjsdFg3n3LVw9bgOyQB7guBeQpLboaVs6w02Mu/bzN 2KD3pwrwiYfB5ygMoBgtRQUDMzr2o6aFur42Be4aaw6XLeB23bu5Ji2CXw4wGMv90AcTWo a3u4yaTRVW12y8hVOHWsZXGqFxYQburxb9yEx5hzMlo1pJOYM0XYM5CrhOI0Bw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1741790291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WB5MGuGK6W7gcR2a2ltq4pCZnHfnzbng6Wl2oKZ1l8c=; b=gaTeWF0Al7dnSL4qWC9SBSfno/89YaqJ5qE62wSCIr42HvWRUQ+LqOkRCzHWnD9M8OsNop TTIALH3exD3BQ0AA== To: Ingo Molnar , Dave Hansen , Borislav Petkov Cc: Thomas Gleixner , Andrew Cooper , "H. Peter Anvin" , John Ogness , x86@kernel.org, x86-cpuid@lists.linux.dev, LKML , "Ahmed S. Darwish" Subject: [PATCH v2 08/20] tools/x86/kcpuid: Set function return type to void Date: Wed, 12 Mar 2025 15:37:25 +0100 Message-ID: <20250312143738.458507-9-darwi@linutronix.de> In-Reply-To: <20250312143738.458507-1-darwi@linutronix.de> References: <20250312143738.458507-1-darwi@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" parse_line() returns an integer but its caller ignored it. Change the function signature to return void. While at it, adjust some of the "Skip line" comments for readability. Signed-off-by: Ahmed S. Darwish --- tools/arch/x86/kcpuid/kcpuid.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tools/arch/x86/kcpuid/kcpuid.c b/tools/arch/x86/kcpuid/kcpuid.c index 908f0de2d4f0..1db2c8d7cf27 100644 --- a/tools/arch/x86/kcpuid/kcpuid.c +++ b/tools/arch/x86/kcpuid/kcpuid.c @@ -277,7 +277,7 @@ struct cpuid_range *setup_cpuid_range(u32 input_eax) * 0, 0, EAX, 31:0, max_basic_leafs, Max input value for supported = subleafs * 1, 0, ECX, 0, sse3, Streaming SIMD Extensions 3(SSE3) */ -static int parse_line(char *line) +static void parse_line(char *line) { char *str; int i; @@ -307,7 +307,7 @@ static int parse_line(char *line) =20 /* Skip comments and NULL line */ if (line[0] =3D=3D '#' || line[0] =3D=3D '\n') - return 0; + return; =20 strncpy(buffer, line, 511); buffer[511] =3D 0; @@ -330,16 +330,15 @@ static int parse_line(char *line) else range =3D leafs_basic; =20 - index &=3D 0x7FFFFFFF; /* Skip line parsing for non-existing indexes */ + index &=3D 0x7FFFFFFF; if ((int)index >=3D range->nr) - return -1; + return; =20 + /* Skip line parsing if the index CPUID output is all zero */ func =3D &range->funcs[index]; - - /* Return if the index has no valid item on this platform */ if (!func->nr) - return 0; + return; =20 /* subleaf */ buf =3D tokens[1]; @@ -352,11 +351,11 @@ static int parse_line(char *line) subleaf_start =3D strtoul(start, NULL, 0); subleaf_end =3D min(subleaf_end, (u32)(func->nr - 1)); if (subleaf_start > subleaf_end) - return 0; + return; } else { subleaf_start =3D subleaf_end; if (subleaf_start > (u32)(func->nr - 1)) - return 0; + return; } =20 /* register */ @@ -389,12 +388,11 @@ static int parse_line(char *line) strcpy(bdesc->simp, strtok(tokens[4], " \t")); strcpy(bdesc->detail, tokens[5]); } - return 0; + return; =20 err_exit: warnx("Wrong line format:\n" "\tline[%d]: %s", flines, line); - return -1; } =20 /* Parse csv file, and construct the array of all leafs and subleafs */ --=20 2.48.1