From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 6A6C926989E for ; Thu, 13 Mar 2025 11:44:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741866286; cv=none; b=uxOyPG8Jf2g46NNCsdgZP4UC3OxWn9lkyr99cg1cJIMAlgyNR9iK6ZssFNs8qvpkOj3GG5Tex+/tnKCVZgJskEwprw2RU4/1fZIlsfnOZlGVHVlD278S5pAvzUzGy6A8bOdpy3BD1Y1xetQc/EybGiZ5rGOrOcu2YVdAiEIxPQc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741866286; c=relaxed/simple; bh=0zAXw8Fu4pWyrls3J/qZaqJC0Q8LMMCdN0t5bJavxBw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type:Content-type; b=lriGudza7EhTf1GoEAgWOrGUqrMi/xyBKxaXRF4rTbnvKahkZkrvG4LPUDC6vq2m1I61g+3TfZU6lFwXqJxM0j6A5lQm6qBPOmT3BD/LWkYEh74p0wnUFPMvnXHxIq6TKKcwnbL0w+O08+ZQBSTqkANRE1XkHuSxwUBGBAdxMeY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=RdoCSBAi; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RdoCSBAi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741866282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a3r2g39Wllme+8/IppJMHdqpnHPlgxpExHUFAvvaA/g=; b=RdoCSBAiPYJ109xGNV3VC0uyjkz6ryHoOvMjHiNDyNN1RkcPylZZUkN6BBAaBFWzC4tsUy 2rYVVhU8BlAZPFfTbCatOPp89VWeumbN734nm8v25tclawuOba+IWG0SboNZDCUiVE3Dmv 1HIuZICOFH2oRkMKX6elrXkHSxthvl0= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-371-kaV-J9GYOlOU-GQcGMdhbQ-1; Thu, 13 Mar 2025 07:44:41 -0400 X-MC-Unique: kaV-J9GYOlOU-GQcGMdhbQ-1 X-Mimecast-MFC-AGG-ID: kaV-J9GYOlOU-GQcGMdhbQ_1741866280 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-391425471ddso503907f8f.0 for ; Thu, 13 Mar 2025 04:44:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741866280; x=1742471080; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a3r2g39Wllme+8/IppJMHdqpnHPlgxpExHUFAvvaA/g=; b=QVSlxWIFHUN+fAbV8txki8FQWfLLdEybo6d9Ok/1AzeUpTeHbZucYiu6ySdslalxM5 TiVYXpYlJYyU6sCV00KsXSgtDKNM1qGWwT2DCvHY3ynzIoZTM4NY8LstrD5NMtRrOwLP iqezMzDBzTL0zsRONI+kLX3TlTexrVGNx/D/71Bw/fCD8FaODFOE+lf6V0LawLzr9IKj wyxcEbkFgwME+QgNHPBOAnX0joeECEpCwV6fWoXWLtuY3ELo4xgP3oV4P36pM46wRv// aWFQ0nExjB1LbTpLAP5Hl+aDkU5Mh24shvLArZkvDnoz2nGcIaDaFksp5jZGAwB3RMi2 WS2w== X-Forwarded-Encrypted: i=1; AJvYcCUbFKBXgengAJw1Asr6vF1ERSuCWR30pXomjONryKSVg+H4ZDjPPvjn5dwI7YjGgq7sJz3BJY2of+s=@vger.kernel.org X-Gm-Message-State: AOJu0YzzpcLDBYuhjfZnzkZtuPGdbVgsxwUgN70BN8+ooi7TSkBB2mna 2gXdxLVuUrsMAHIopdgCXiSQ2fuTPy9S/xbxaJoXi6COPZAOi41/35pw0FzWOxuLNqFEQAixU4o ePaUpYKW4Wy2pDQJ/aDQ0+Ogkfux7VdQFMjQ55m7QX8j6oEL+p4ls10k01Q== X-Gm-Gg: ASbGncunHL99Uqjp9U6kvuiwcLuVUVqo48DuwXwPSU9B1Yrl7OR2/e/4YlERoPEJP8v lmFvNqmYNPnlziRe8dm7HUOSda37eJ/y7hYUgYP7yCDVpLOhzhFJvmxzP6Bxyh5g6o4/E6Jj72Q wMlt1rUfrOmBMa+c/4a9PeLF9UyX1gDW1G6FkYcPrICdi4XqfHzkqJaKJ+F3iHUA3UH/jQyaSHo 3PhqcBuzQeqMI5M3it/GRZjnBfmEOpfpSrOcME1zVBlhvj82PWR1Yp7YoSIFUVZ7fby9ES+sLzf AxM/IlJivsVqBLpC5+65 X-Received: by 2002:a05:6000:402a:b0:390:d73a:4848 with SMTP id ffacd0b85a97d-39132db1bdcmr22489006f8f.47.1741866280383; Thu, 13 Mar 2025 04:44:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGX54DwhuuXuiX517uvSUEgVEhgO3UBbgNo/IaPOPi6DbNC92jX9q/7SC3qQwivycyOtbvIkA== X-Received: by 2002:a05:6000:402a:b0:390:d73a:4848 with SMTP id ffacd0b85a97d-39132db1bdcmr22488963f8f.47.1741866280013; Thu, 13 Mar 2025 04:44:40 -0700 (PDT) Received: from lab.hqhome163.com ([81.57.75.210]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-43d188b754asm17844115e9.14.2025.03.13.04.44.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 04:44:38 -0700 (PDT) From: Alessandro Carminati To: linux-kselftest@vger.kernel.org Cc: David Airlie , Arnd Bergmann , =?UTF-8?q?Ma=C3=ADra=20Canal?= , Dan Carpenter , Kees Cook , Daniel Diaz , David Gow , Arthur Grillo , Brendan Higgins , Naresh Kamboju , Maarten Lankhorst , Andrew Morton , Maxime Ripard , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Daniel Vetter , Thomas Zimmermann , Guenter Roeck , Alessandro Carminati , Jani Nikula , dri-devel@lists.freedesktop.org, kunit-dev@googlegroups.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, loongarch@lists.linux.dev, x86@kernel.org, Linux Kernel Functional Testing , Alessandro Carminati Subject: [PATCH v4 05/14] drm: Suppress intentional warning backtraces in scaling unit tests Date: Thu, 13 Mar 2025 11:43:20 +0000 Message-Id: <20250313114329.284104-6-acarmina@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250313114329.284104-1-acarmina@redhat.com> References: <20250313114329.284104-1-acarmina@redhat.com> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-type: text/plain Content-Transfer-Encoding: 8bit From: Guenter Roeck The drm_test_rect_calc_hscale and drm_test_rect_calc_vscale unit tests intentionally trigger warning backtraces by providing bad parameters to the tested functions. What is tested is the return value, not the existence of a warning backtrace. Suppress the backtraces to avoid clogging the kernel log and distraction from real problems. Tested-by: Linux Kernel Functional Testing Acked-by: Dan Carpenter Acked-by: MaĆ­ra Canal Cc: Maarten Lankhorst Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Guenter Roeck Signed-off-by: Alessandro Carminati --- drivers/gpu/drm/tests/drm_rect_test.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_rect_test.c b/drivers/gpu/drm/tests/drm_rect_test.c index 17e1f34b7610..e8d707b4a101 100644 --- a/drivers/gpu/drm/tests/drm_rect_test.c +++ b/drivers/gpu/drm/tests/drm_rect_test.c @@ -406,22 +406,38 @@ KUNIT_ARRAY_PARAM(drm_rect_scale, drm_rect_scale_cases, drm_rect_scale_case_desc static void drm_test_rect_calc_hscale(struct kunit *test) { + DEFINE_SUPPRESSED_WARNING(drm_calc_scale); const struct drm_rect_scale_case *params = test->param_value; int scaling_factor; + /* + * drm_rect_calc_hscale() generates a warning backtrace whenever bad + * parameters are passed to it. This affects all unit tests with an + * error code in expected_scaling_factor. + */ + KUNIT_START_SUPPRESSED_WARNING(drm_calc_scale); scaling_factor = drm_rect_calc_hscale(¶ms->src, ¶ms->dst, params->min_range, params->max_range); + KUNIT_END_SUPPRESSED_WARNING(drm_calc_scale); KUNIT_EXPECT_EQ(test, scaling_factor, params->expected_scaling_factor); } static void drm_test_rect_calc_vscale(struct kunit *test) { + DEFINE_SUPPRESSED_WARNING(drm_calc_scale); const struct drm_rect_scale_case *params = test->param_value; int scaling_factor; + /* + * drm_rect_calc_vscale() generates a warning backtrace whenever bad + * parameters are passed to it. This affects all unit tests with an + * error code in expected_scaling_factor. + */ + KUNIT_START_SUPPRESSED_WARNING(drm_calc_scale); scaling_factor = drm_rect_calc_vscale(¶ms->src, ¶ms->dst, params->min_range, params->max_range); + KUNIT_END_SUPPRESSED_WARNING(drm_calc_scale); KUNIT_EXPECT_EQ(test, scaling_factor, params->expected_scaling_factor); } -- 2.34.1