From patchwork Tue Oct 29 10:22:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: gyeyoung X-Patchwork-Id: 13854630 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 C5301D2AB14 for ; Tue, 29 Oct 2024 10:22:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3614210E618; Tue, 29 Oct 2024 10:22:48 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TNMOOYQ+"; dkim-atps=neutral Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by gabe.freedesktop.org (Postfix) with ESMTPS id 40C4D10E615 for ; Tue, 29 Oct 2024 10:22:47 +0000 (UTC) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-20cbcd71012so55665565ad.3 for ; Tue, 29 Oct 2024 03:22:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730197367; x=1730802167; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=01Umf8iUVZfC58kdjKuuiE82OEKV9wbOQ6pjiqKLUv8=; b=TNMOOYQ+lsc2F3nEAc44bato+cyP7IhlcKDQ7P5alecDLNMFHy0cMWv1QY2TN9cNo/ KNeVdlMK4Rec6dsKH9MTbuKZkmgRSVc3D7zLtGI4oBiasPrcOAnB89QIbyWlIEPwGh+u ftnAbXKElho9SVGRzPr2j6ZebDRfGaAw25BaZEprgtaTXysNAOAtAyfkgLp7tGB9gN8Q wYPVj9lRTpFz+DjcPpjYMWtDq8dseEUaLLVd9Wh2x+ZssUXzoYdXG8k00DyiacALW0P2 mokdZ2sSrOsSaN/77oOo8OWY/ybB/6uN4+BuPZCiUF4Jpb45qDEu3Yb7PuUS/xXWvZxc t8tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730197367; x=1730802167; 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=01Umf8iUVZfC58kdjKuuiE82OEKV9wbOQ6pjiqKLUv8=; b=T2uzhSQ9f4PJf81MT8mnMqNZH4k+57W3C7W7rFDSV1fla/Dy2+mr3TGzzl8amSpkSu YDRpePTRWO4f7fUyQCZRZ7JdNfMonI3yMdmAgMcxH8cnwLDqYtq46eAkCPgDTzqOEXEs 4R1AzEAGqIlaMErB5NsDkJCeSHOtYLJegc9UI592QbuvvVAJKW6D1SVZB9Cl6F4hTe/D PiuqboKY4YCDObPoizfLCEEcROuekg8rVpdSzPN50lZzQqe5Y8xDPdah+hi0NbNL5mwK qIjU6H7tzbyCWwVfZykcR6h2Vpy4nnQBG00oePkF5YbbeO+X5XpjNPV+0tZSHZzVxj3g efqQ== X-Forwarded-Encrypted: i=1; AJvYcCWSA/GGwxiaP5Trmpy2qeDfXn8PpIGh928P3F3qy9Ib3i9NxPB+vrPpr5SkT4sXXvHhAuK8WWDzZ7k=@lists.freedesktop.org X-Gm-Message-State: AOJu0YwpfoSwGQae2yNqVcTtI2uuwOEHWDgAZYVDcxLkNHmWS9mQJLII GH/X1Bg8/zU1O0otNKcQI/9ogva7TY1U0tGPCbQHHhOdWFXgM2yg X-Google-Smtp-Source: AGHT+IElqNym4BeJPNCJTlbSlHkx0TRDzfK6WFA45y6XkQcbHMPJugv4gb8Tn9WYSnPeio2CIZlTCg== X-Received: by 2002:a17:903:228a:b0:20c:83e7:ca4f with SMTP id d9443c01a7336-210c6bfd3afmr147760185ad.26.1730197366561; Tue, 29 Oct 2024 03:22:46 -0700 (PDT) Received: from gye-ThinkPad-T590.. ([39.120.225.141]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-210bbf6dd62sm63475445ad.95.2024.10.29.03.22.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2024 03:22:46 -0700 (PDT) From: Gyeyoung Baek To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Gyeyoung Baek , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] Fix unused variable warning in 'drm_print.h' Date: Tue, 29 Oct 2024 19:22:34 +0900 Message-Id: <20241029102234.187480-1-gye976@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" previous code can make unused variable warning, e.g. when CONFIG_DRM_USE_DYNAMIC_DEBUG is set, this outputs the following build error. drivers/gpu/drm/drm_print.c: In function ‘__drm_printfn_dbg’: drivers/gpu/drm/drm_print.c:218:33: error: unused variable ‘category’ [-Werror=unused-variable] 218 | enum drm_debug_category category = p->category; so i simply add '(void)(category);' to remove unused variable warning, by referring to "https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html". Signed-off-by: Gyeyoung Baek --- include/drm/drm_print.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index d2676831d765..6a5dc1f73ff2 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -157,7 +157,7 @@ static inline bool drm_debug_enabled_raw(enum drm_debug_category category) * a descriptor, and only enabled callsites are reachable. They use * the private macro to avoid re-testing the enable-bit. */ -#define __drm_debug_enabled(category) true +#define __drm_debug_enabled(category) ({ (void)(category); true; }) #define drm_debug_enabled(category) drm_debug_enabled_instrumented(category) #else #define __drm_debug_enabled(category) drm_debug_enabled_raw(category)