Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4192693rdh; Tue, 28 Nov 2023 14:46:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IH7in2hHbd5nOh5RHpqhTHLta5/TCJETbbH1Ko/Rn899pxBQ9EtAWFFlc15KK/ZXMDP8ZbH X-Received: by 2002:a17:902:c142:b0:1cc:569b:1df4 with SMTP id 2-20020a170902c14200b001cc569b1df4mr16757945plj.1.1701211596877; Tue, 28 Nov 2023 14:46:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701211596; cv=none; d=google.com; s=arc-20160816; b=d8DAO+IVFMPQ7VQq6vSS9SvNEjx+z73mWL0TK35hGg9RiFesyEhaSjWxqWvgS1Iiz+ wW0LE68whi7ZjG6Z/cJySLPpc9dLkY5UVytqrVQtT+HJu8uzUsfweJVMIPcip8SCqnKA YZX421M0RkSbWNXWtWDrYLgufR8nxmw0h6v0WxthGU83P42Q0WglHldiMLuoqIzudrJq p7UyLwOb6G+HxgtuJQEGkzszOpYpeqqYL6QMNDKDJpg3OlZF6K0E81d1ve8mt1Bu5CpT EGengzhCOdEZHaIdmtFuLUW2HUBQ8DRVeVd2Wrf8J77rqaG45OBqfGkN3GCa0diZoRp3 3tiQ== 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=R8Z5TPuTS4gxATiNVo3UYq2ckYaPlQoByvZsiJWU4AwcpRBcZdeSEDFLF2Opaf0kYw vzQoltvl5NYJ4GYhMeySUZF/dU8Ok+uPj8pVxo47mBG97YA5lWsKBIA+TqUxfP1AJqh6 zleWQjln97DWP3iFWb/JH5+0x/r2OLR05GEOmVe+MawIFIbv0/W9naBfcM2gvd8igkaK eorfmzbHSmV3SRLRmaSFcX/3YAShx11iz5P59LknoTeUcfXw0ofy7xOg7EbL2fxF3pkT WIqddMfqb7OR/jf60zD5abRtcK6ghfQ1vHUxGtrWDrMx6KQujZJMTEkputTlCTOhDjm7 Ex4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XsO10W1q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id g7-20020a1709026b4700b001c9abb72958si12471358plt.590.2023.11.28.14.46.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 14:46:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XsO10W1q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id A5C4580BD268; Tue, 28 Nov 2023 14:46:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229709AbjK1WqT (ORCPT + 99 others); Tue, 28 Nov 2023 17:46:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230346AbjK1WqS (ORCPT ); Tue, 28 Nov 2023 17:46:18 -0500 Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0287019A6; Tue, 28 Nov 2023 14:46:25 -0800 (PST) Received: by mail-qv1-xf35.google.com with SMTP id 6a1803df08f44-67a14f504f8so21906676d6.0; Tue, 28 Nov 2023 14:46:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701211584; x=1701816384; 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=XsO10W1qy+mn6Jn2XJIxwFQda9GAd1l86NcOKW0FIS4X30PWcnafgnYBcgWvDd8vmV cEHV4GVANUDTvwghgrKVKMbsa3l0Bsb6sr711dGbC3yZsdTxnzGDVIBZbAxd71zsFU0X kVlkiAVgQ8+2Jni9zkyJp5udj0ibaduBnV3vIRWGiAJlYYaai8Ej1nk6BUd9b/TrPzz2 q2XwUHj3SxV/WMRI/z+wpJvULjICgspCVH270Qv8nqsk5pIOtmtwSSwA+da3n+qJXEjY q8f3JArkkGXtN7ZW7Nm5Y88C77gCGfH4ZD92+hXBrFwJcegLmh0TFv2N0WoEvJbdwpHa HIpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701211584; x=1701816384; 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=G0sgdxHFCX8gkh2DuOsQv1cGeUr01l/hVnzhpYQAmRubCnnr6kic8u84N8PX9x97cS aBVP2CNo1/9E0ppdQrl3OKPioB3R90Rx74EI7hhjAoJ62HtBg6SoXQ5rHqmPEUFm6Gfg N14YcYWjRQYCWNUVpypCXwZjhmDvHB0yRifg6G0EbAQXlTTrCh03YGoH6J82+ZqvjbMh wTbNbY21TMp6JKzf26yA1jgB1GjcbbN2oOrDIa9G9FhHypbsCbgnlLHSV0vosYw8FH4f MPQY5EL0zZfNKuKQLuaAbX/8Nkz3XVd+WjvsEMgJfSsPX5+23CwBX4U3Kubc+CH82m9e HB3Q== X-Gm-Message-State: AOJu0Yyea1pU+EMtvopn3YiC/puTfF5lCYX9TJg23VeBYiO4NBMAxBPh ealeoMRQmFVZtKVFqGT0Ha8= X-Received: by 2002:a05:6214:806:b0:67a:590a:18f6 with SMTP id df6-20020a056214080600b0067a590a18f6mr3626618qvb.51.1701211584122; Tue, 28 Nov 2023 14:46:24 -0800 (PST) Received: from angquan-linux.. ([72.36.119.4]) by smtp.gmail.com with ESMTPSA id em15-20020ad44f8f000000b0067a543e6379sm1336565qvb.75.2023.11.28.14.46.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 14:46:23 -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] Fix Format String Warnings in lam.c Date: Tue, 28 Nov 2023 16:46:07 -0600 Message-Id: <20231128224607.71334-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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 28 Nov 2023 14:46:29 -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