From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E9DF4C48BF8 for ; Thu, 22 Feb 2024 14:01:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9758B10E958; Thu, 22 Feb 2024 14:01:24 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="QsARzQ7B"; dkim-atps=neutral Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) by gabe.freedesktop.org (Postfix) with ESMTPS id C8EEB10E815 for ; Wed, 21 Feb 2024 21:26:28 +0000 (UTC) Received: by mail-il1-f178.google.com with SMTP id e9e14a558f8ab-363bdac74c6so19662415ab.2 for ; Wed, 21 Feb 2024 13:26:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708550788; x=1709155588; darn=lists.freedesktop.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ei6xuNgF/xoTMzRe+RBiR7YMpzO4E4Wmr5k4IfUD1BE=; b=QsARzQ7BujHWULGsClKw3DMHY/bOWo1z4NZT56AovlxtleTfF1qM+QEXLeQD+VYZth 07t+p9MT8U2IjxKlueatCTyeL5mCr1dDjnPCkvvmN/7GkfHPsEY23zPT7HYfQC1YZMKD s5Mt+QbaTwK+vcRLrmFpxnG57+5FIMbQ7rlWcU80yBHQHtjHeoOoC9n86heqzhX+a5nR wO9ZsVj0nsn6At5tL6n7rhKSB7mAG72yUZoDm2OwfZbz7s163xeNMYGMBytaCmBFBRoy yvuD5JNxVVHMmGTxh9L333+/lanuOxuNVAeJlL3F6MlgSSWL9TLzT8yhpMGdefo1+mle WcqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550788; x=1709155588; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ei6xuNgF/xoTMzRe+RBiR7YMpzO4E4Wmr5k4IfUD1BE=; b=jf2v2q7pZHcNEGpNxK13Sjw6c63xmXPsMtaM7zNDIS8MjaVLB0RyKr6bz1MVdqNO1j BJaJh0Uc/K/E0U2HC5gfQikaDZfh8K8GiVmRY+9+bOh8juSSb4OL3s/dKjc+dFMDn6u9 vtU+PgbInEZIPthd9Z289Ms7Rqojy3Y5CM4JcIBG5ViiKOJqwgvnZYTP59JLmHgsYlEV 2dF1d1Jn/tGfECJfHxKwNCv15mjFiE5Y9PjQlnD2eKhhEyzJcD8vAMrM6mDv+FOMiWzF 5OgngkerrZHd2srFylceJDIb12dpGC4fFv4ZboeD7O2n6pePoJ5r02bduiJXs2SCuOhL oOpw== X-Forwarded-Encrypted: i=1; AJvYcCUe/fTQRTukK3ouXE/W+hAYbe2AboPibCK+GYWZ+Ro1N7zOFqYjTESj43v78YzwmIhOJ6IeWdzqDlyiYX3Q2B6YsQtakfJrTdqX4S0KiMg= X-Gm-Message-State: AOJu0YyzlTOXGBp/ll3/qRnG9GgiG1Siyprj4XizqQ4sB+dzcSXBPvkc PXyi/mqzzmhhQb2NmZjH7Icr8FDYKP8x7k3WBj1qqV7pu56PF+aIytvbq96vmw== X-Google-Smtp-Source: AGHT+IE94cj8KTh5vsD6rggbO3A8K/diAIkIrFg2CCSYRvCxTJhEhQffit7CiRPnd2AjVYaPB7SsEQ== X-Received: by 2002:a05:6e02:4cd:b0:365:b29:3fda with SMTP id f13-20020a056e0204cd00b003650b293fdamr16002018ils.24.1708550787816; Wed, 21 Feb 2024 13:26:27 -0800 (PST) Received: from google.com (161.74.123.34.bc.googleusercontent.com. [34.123.74.161]) by smtp.gmail.com with ESMTPSA id o16-20020a056e02069000b00362759b0e4asm3592139ils.32.2024.02.21.13.26.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 13:26:27 -0800 (PST) Date: Wed, 21 Feb 2024 21:26:24 +0000 From: Justin Stitt To: David Gow Cc: Linus Torvalds , Shuah Khan , Guenter Roeck , Rae Moar , Matthew Auld , Arunpravin Paneer Selvam , Christian =?utf-8?B?S8O2bmln?= , Kees Cook , =?utf-8?B?TWHDrXJh?= Canal , Rodrigo Vivi , Matthew Brost , Willem de Bruijn , Florian Westphal , Cassio Neri , Javier Martinez Canillas , Arthur Grillo , Brendan Higgins , Daniel Latypov , Stephen Boyd , David Airlie , Maxime Ripard , "David S . Miller" , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-xe@lists.freedesktop.org, linux-rtc@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-hardening@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 6/9] net: test: Fix printf format specifier in skb_segment kunit test Message-ID: <20240221212624.w4r2w6acijkwn7qg@google.com> References: <20240221092728.1281499-1-davidgow@google.com> <20240221092728.1281499-7-davidgow@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240221092728.1281499-7-davidgow@google.com> X-Mailman-Approved-At: Thu, 22 Feb 2024 14:01:23 +0000 X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" Hi, On Wed, Feb 21, 2024 at 05:27:19PM +0800, David Gow wrote: > KUNIT_FAIL() accepts a printf-style format string, but previously did > not let gcc validate it with the __printf() attribute. The use of %lld > for the result of PTR_ERR() is not correct. > > Instead, use %pe and pass the actual error pointer. printk() will format > it correctly (and give a symbolic name rather than a number if > available, which should make the output more readable, too). > > Fixes: b3098d32ed6e ("net: add skb_segment kunit test") > Signed-off-by: David Gow Looks good. For those wondering, %pe has a special meaning in the kernel which can be seen in lib/vsprintf.c. Reviewed-by: Justin Stitt > --- > net/core/gso_test.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/core/gso_test.c b/net/core/gso_test.c > index 4c2e77bd12f4..358c44680d91 100644 > --- a/net/core/gso_test.c > +++ b/net/core/gso_test.c > @@ -225,7 +225,7 @@ static void gso_test_func(struct kunit *test) > > segs = skb_segment(skb, features); > if (IS_ERR(segs)) { > - KUNIT_FAIL(test, "segs error %lld", PTR_ERR(segs)); > + KUNIT_FAIL(test, "segs error %pe", segs); > goto free_gso_skb; > } else if (!segs) { > KUNIT_FAIL(test, "no segments"); > -- > 2.44.0.rc0.258.g7320e95886-goog > Thanks Justin