From patchwork Wed Feb 21 09:27:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gow X-Patchwork-Id: 13565201 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 6867B40BEE for ; Wed, 21 Feb 2024 09:28:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708507706; cv=none; b=hTZ/eLvQjbt4Jg606+V8ywPW/LnD1USTB60LCMiFA90UFB1wH2SUKfWG94L9DfmQYT5eSxvD9C0fdgeXD8FcL6MjK4pCC+TD8aMcfwAWiKOb2Qx+Cpz0ko+f19jGoVVEFnEWP0OBwJTw7GoCbX2tEP/xO7xUd+wCD4n6xS5e5p8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708507706; c=relaxed/simple; bh=qMDq4bdbhpPxmFVNu5BAuMHikajNGQCbrs05AJS2Hgg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=sGnvArgcKVMewygydny6uqF8WIW47hWRI0nf8ee4tYXM2WyR4oXTAt/Vsf7e7Wnhs8DKA9c1Fzswg0CZkVC0XPpJhbgE6DiphLifZzEkwsF1RL2VGLGnQv/gcmqxjaCFrDOQl6uS3gzKpP0ls+g0RaK8Fk2J4kBRaXC2ieRbqNs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--davidgow.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=D6FVsTD4; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--davidgow.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="D6FVsTD4" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6087ffdac8cso7599797b3.2 for ; Wed, 21 Feb 2024 01:28:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708507703; x=1709112503; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=6oh8w0yc8LvH1yvSHI8zU+2R7q+ewyvFM42Am6pdhYA=; b=D6FVsTD4raEeATxpVZ6Qcyn+x0avEjJx8xgJvJ/z4iE0JjaKunjA/Z82BKNy+FzkR2 lp+3qO5dhnzsfc/dM+z2pECqaOjIQ8xuKlLxZGEjL601epK+6DDd3REFZfSGOt+D/HZM QrcMdWaNT/FVPNhZzCaV7aYI3WB+sPL2iR3DZG4z/wBKBkUExn9I09KyWYjc1rEAjpLG kauIplsgkQBLM8u9xwfvIXKs7VSVVqvEg0N0sOMlCRsSrHY+jA3+sukTBOcT88jfJ9ma 2xW1OkO6ZTe6kq8rb096JA8P0VnVHqwLbFWTDc2NCFK2vAaUykNlfA4u9AFqM0ob82Px oggw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708507703; x=1709112503; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6oh8w0yc8LvH1yvSHI8zU+2R7q+ewyvFM42Am6pdhYA=; b=coe0lVgqnBn87XUbHQ0qdI8V3pyy90wTXtuOUm1c86R1UZWjYMORmRDWM35cYBaFhI laF45ewaKw2hRq/1SiH3UfO/WN2JRbLTGYfR+3vGWf0ezA6iX6xR1YSQOoOSbV7yo2BA Kbwz214gCKjHbJEiEJOR6yfOKiBmDmsKRlUejNO5ZUtg5N4MpWW+AaVhlEhPgTwCHy64 +wBE8NfQtWLAFP7K8V6ijK7EHA9UYkOLsXsXTpQgf202BPS4oKGJ7AJSazFHUpEl4AGN pQh0CBY6krE1KKc1HdI6J6N4gmKpGUmhqyyepgClgToeJ85gg0kQntxelCOThnyj9beh L3Ww== X-Forwarded-Encrypted: i=1; AJvYcCVxupBC87+nI7d2kCKLH1ZWNMpXcCmPutAdG7PnQrCkuKjHfdScLIV4db2SNpJnleKlpdc1amP569u2pGKIlNPeztMe6FA9+uQmOFWwH6SS X-Gm-Message-State: AOJu0YxjGAKPi+R4X6c2RqLn/jL3u/tuDeZYskFoZHxtTGVaIZuzdswO /i+an95SmtSHkRkZ/mRP4m9KYDb5yOS0jZjnVQUWH2J3RFXV5qvABTJi6G9hvKAvgnHXUt+N9Gv u781wwjtEkw== X-Google-Smtp-Source: AGHT+IHAVxan3IBdGfT14ZlxAMIfrkzUxv01ETxOcEryam+Wji8MbAhrWelAxlNmlmHCaTgl78twQW5eAT/4hw== X-Received: from slicestar.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:20a1]) (user=davidgow job=sendgmr) by 2002:a0d:e8c4:0:b0:607:cd11:5464 with SMTP id r187-20020a0de8c4000000b00607cd115464mr4264994ywe.9.1708507703514; Wed, 21 Feb 2024 01:28:23 -0800 (PST) Date: Wed, 21 Feb 2024 17:27:18 +0800 In-Reply-To: <20240221092728.1281499-1-davidgow@google.com> Precedence: bulk X-Mailing-List: linux-hardening@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240221092728.1281499-1-davidgow@google.com> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog Message-ID: <20240221092728.1281499-6-davidgow@google.com> Subject: [PATCH 5/9] rtc: test: Fix invalid format specifier. From: David Gow To: Linus Torvalds , Shuah Khan , Guenter Roeck , Rae Moar , Matthew Auld , Arunpravin Paneer Selvam , " =?utf-8?q?C?= =?utf-8?q?hristian_K=C3=B6nig?= " , Kees Cook , " =?utf-8?q?Ma=C3=ADra_Canal?= " , Rodrigo Vivi , Matthew Brost , Willem de Bruijn , Florian Westphal , Cassio Neri , Javier Martinez Canillas , Arthur Grillo Cc: David Gow , 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 'days' is a s64 (from div_s64), and so should use a %lld specifier. This was found by extending KUnit's assertion macros to use gcc's __printf attribute. Fixes: 1d1bb12a8b18 ("rtc: Improve performance of rtc_time64_to_tm(). Add tests.") Signed-off-by: David Gow Tested-by: Guenter Roeck Reviewed-by: Justin Stitt Acked-by: Alexandre Belloni --- drivers/rtc/lib_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/lib_test.c b/drivers/rtc/lib_test.c index d5caf36c56cd..225c859d6da5 100644 --- a/drivers/rtc/lib_test.c +++ b/drivers/rtc/lib_test.c @@ -54,7 +54,7 @@ static void rtc_time64_to_tm_test_date_range(struct kunit *test) days = div_s64(secs, 86400); - #define FAIL_MSG "%d/%02d/%02d (%2d) : %ld", \ + #define FAIL_MSG "%d/%02d/%02d (%2d) : %lld", \ year, month, mday, yday, days KUNIT_ASSERT_EQ_MSG(test, year - 1900, result.tm_year, FAIL_MSG);