Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4321505rdh; Tue, 28 Nov 2023 19:36:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IFR8fDlFHaUW+p+7mJg5zAspieK3F80jAFmQ64iCP1mLLa/St9o/q6TDwgxidAJbMkBf8E7 X-Received: by 2002:a17:90b:1c02:b0:285:a94b:85d6 with SMTP id oc2-20020a17090b1c0200b00285a94b85d6mr14441198pjb.45.1701228999641; Tue, 28 Nov 2023 19:36:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701228999; cv=none; d=google.com; s=arc-20160816; b=VnkidDueePyBGpGKFW/zmDOzcCKTaTqKp12IJ8BSx7vLs8xZa1gr4fvQtizIVRunJw GSmcaT8lSrSYJ51U1wofsaP9yhzDNHvAiFNB8nxjfwTi6tmDXhWieKQ5kK+bL3hBC02V i4yftNPLKs2oRa+G2jRijjkjoZtQFDiHTsS6S5V5auAMdAWzMxvAi42w3Yn/uSBdji3F RUrlHmS95H0wrXOJygk6tuPDonmniJ+g+WwNYhLzAwUCwDoZaeMgc+qshFOoJcqhNafu 0P+CPtzVpAI0Ci0Ue/Pfvgc0cGVdAqHvvYCvrBA96qD8W7sY2dVwGTm9JBh1YoMkfZ1L QD8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=qhpsd/CJqEzY2wViCgUIbvNNXzGivZKIEmu3PQkzhVE=; fh=xr2tRmJO5CCcvERKgUbQiCfZD8weRWjaLLzHWlvNSHA=; b=VhJA5p1II65mzK9IBVUnhpNR+dO/Fw0chSXaZaHie+zwESNy7ezNsjnu3+TSjN+SMX 3LyBbQ4OqmXiTGeU8Mzc3WKoagsCDY29BYRvKgCTN8fDJ/IA4+P+avhVEPo1zIN/m6/s vg3ZjKRyL+mvRdjpd6OlLSDEPfLbwcARY3D+Df0m5R+wyrk5/3G2kA3jemZF8Eq9z8dc tpRhqYg8ZTBnCetYgRbCdvEG7Wyo8pQPLckPo0528B26pR3KRaM9SLgt9J/Bl4rjnNf5 I7z49UrM9gmZ4Osrr6XLtw2AJLTZvv4IazGRKN2JuT3m0fObFrS/SQ+O4mXvNHUol0i4 rntg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Gxr5Claw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id cl14-20020a17090af68e00b00285807d0f79si454180pjb.56.2023.11.28.19.36.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 19:36:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Gxr5Claw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id DB8B680A30BA; Tue, 28 Nov 2023 19:36:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376771AbjK2DgX (ORCPT + 99 others); Tue, 28 Nov 2023 22:36:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbjK2DgV (ORCPT ); Tue, 28 Nov 2023 22:36:21 -0500 Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BDC4E1; Tue, 28 Nov 2023 19:36:28 -0800 (PST) Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-5d279bcce64so850217b3.3; Tue, 28 Nov 2023 19:36:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701228987; x=1701833787; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qhpsd/CJqEzY2wViCgUIbvNNXzGivZKIEmu3PQkzhVE=; b=Gxr5ClawcMr0jE4AZxWDC/nTeAMe0rBaTfaSWawF1MHC3wBh0OlGX1VKhKmMlGzJT2 /Um6HbldbvJ1JTGtvU4K39KL4pDqYYFNkG8XhHvpAuZNh1BDgN1qE0tOxMTBhCRAexP3 HpOJCHGp6MOSaDG/lyHCMbJaMmjqp+7NSVjn2m57hQ5H7pujg3oqB3zfJ/wMycA43WWj FPifgq6E0Y9kMI3RdECsAFQG3r4lbWe4MCVFy6AScoXExUCHU+rG4dFnKwy1yb3aJL5z lKHgXGETNi31SmYHUJ0wXf6mlzE5sSDVcjaKiqz7WgI4FftJCv7Pj6rmU4X2Z5Uv63MT HPwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701228987; x=1701833787; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qhpsd/CJqEzY2wViCgUIbvNNXzGivZKIEmu3PQkzhVE=; b=sDJ+nrOpJm58RZrmYt4fX5y/qrCxv6d+pmwu89XlFqZz/6nx1hRVIX0PBN/w2J4/Ol GevULGoSX/SvNHa5YNEBwDYrCcxyqlazvVuErYQyAJWadzUGClb0qxjkc1V7HhzNfRzl Zs1paArp6CJdBWKXnXGU1iAzPDcdi9RD1+rhOxYoupW7kWYMjPqTyduJfaJ5XdyQ0e58 znV++ycRZ5Lj5IbNm6NPgA6gG7mroseQGJ5qQJdlhBo7mkfHdUjmaUaZlo5KJtSkOUYx H9Pq5YBhA1rD52twcdvWCNyof9xiEgMToHmhFSFI5Mrf4s8cqwquGITPsfDpqxtxwtft /XKA== X-Gm-Message-State: AOJu0Yw41YJwRDsllToZtOfYjxWvxdL5UAxfiNoRrUU7Z+eu6Iy/KsTM VRjzox+OX70UdOkGemBJC34= X-Received: by 2002:a0d:c983:0:b0:5c9:86c:216c with SMTP id l125-20020a0dc983000000b005c9086c216cmr17462276ywd.46.1701228987546; Tue, 28 Nov 2023 19:36:27 -0800 (PST) Received: from angquan-linux.. ([72.36.119.4]) by smtp.gmail.com with ESMTPSA id a24-20020a0ca998000000b00677a12f11bcsm5726238qvb.24.2023.11.28.19.36.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 19:36:27 -0800 (PST) From: angquan yu X-Google-Original-From: angquan yu To: skhan@linuxfoundation.org Cc: shuah@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, angquan yu Subject: [PATCH] selftests:x86: Fix Format String Warnings in lam.c Date: Tue, 28 Nov 2023 21:36:15 -0600 Message-Id: <20231129033615.5083-1-angquan21@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 28 Nov 2023 19:36:37 -0800 (PST) From: angquan yu This commit addresses compiler warnings in lam.c related to the usage of non-literal format strings without format arguments in the 'run_test' function. Warnings fixed: - Resolved warnings indicating that 'ksft_test_result_skip' and 'ksft_test_result' were called with 't->msg' as a format string without accompanying format arguments. Changes made: - Modified the calls to 'ksft_test_result_skip' and 'ksft_test_result' to explicitly include a format specifier ("%s") for 't->msg'. - This ensures that the string is safely treated as a format argument, adhering to safer coding practices and resolving the compiler warnings. Signed-off-by: angquan yu --- tools/testing/selftests/x86/lam.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/x86/lam.c b/tools/testing/selftests/x86/lam.c index 8f9b06d9c..215b8150b 100644 --- a/tools/testing/selftests/x86/lam.c +++ b/tools/testing/selftests/x86/lam.c @@ -817,7 +817,7 @@ static void run_test(struct testcases *test, int count) /* return 3 is not support LA57, the case should be skipped */ if (ret == 3) { - ksft_test_result_skip(t->msg); + ksft_test_result_skip("%s", t->msg); continue; } @@ -826,7 +826,7 @@ static void run_test(struct testcases *test, int count) else ret = !(t->expected); - ksft_test_result(ret, t->msg); + ksft_test_result(ret, "%s", t->msg); } } -- 2.39.2