Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1944994pxb; Mon, 20 Sep 2021 08:40:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx24ihgJJCe9Mtl2ly+JCXdp1w/pvtakMfK+78qPxoY+d6Oh9XQaYKhDwRxwgNH+0sg+7nm X-Received: by 2002:a02:716b:: with SMTP id n43mr19956413jaf.14.1632152429674; Mon, 20 Sep 2021 08:40:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632152429; cv=none; d=google.com; s=arc-20160816; b=Sa68RTIytzUgVrCuJ6cgJfAdEvMtz7I0TjwLke6Xkbqd63gBy7VwrUTaJnCvwPOiJn 848InQxqiLIJxtNzFvGoXiG52FtPK/+BvHiawd36yMWLJDvu+YJO9VT6AyCqrf7fDXHg T/KCib3n3BAdnVJpAPxfg7wgaKqi+EaPYotAwlWeOD/MIIRrF2uYcEWkRekB0q5jveRO XK6Cag/VTBb0q/t2GV2eSJTLNp8vKJ054+rGpubiDhsPvKQlnfv0vyqBPBWbZ5DSXcca tURo0f7ewrxFNHYQyR1tffaw/waLgPmfhSpeRBLIp9FqjqE9PwYqnrrp5/qDF+MEn03Q Fa1Q== 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=2I1mnu6FBzqv0/EOYmausr6zFyqQK9InalGWF8QQsEs=; b=YEHurg+sF/4cc+yK+KJxvZIFzI37ny9UXLVpaSfKC7garcuYEjswbD8sPrdCbk0O6L LbKEMrLChPJozVSdcFY18zZK74IUOKderCpqLfkaAXNSSVIeaBNLpUl38ju5WcEUfQ4D rXRIJgl6/WmamyB8qn2rLjogUHGa2Ekj02yW00Fu8nr3tsufCuSltQLyEg2xmINHJo+V j2pW8FYpL7ttyawwolF3PkViVd0jRdlJPqel/xxRIqvFslfkDtOGdrnLYEBkadMG2ff4 4KFNPr6iiOI7KqJ49XPZV5/mznIlY1EuR3uZduT5qgJty2Vfpoy+djYo/4klXAzdxrQK fWgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FBRLyWZc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e2si12562449jaa.68.2021.09.20.08.40.15; Mon, 20 Sep 2021 08:40:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FBRLyWZc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237625AbhITMRj (ORCPT + 99 others); Mon, 20 Sep 2021 08:17:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:46272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234824AbhITMRj (ORCPT ); Mon, 20 Sep 2021 08:17:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2797961040; Mon, 20 Sep 2021 12:16:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632140172; bh=aSGPmPDRLP16GIl3fPiwaIaI2XvPbLSEi9QZQZG0BZY=; h=From:To:Cc:Subject:Date:From; b=FBRLyWZcK8iMM9gQEg0Jk86YoAgzLk5VU2iSBVgom1MMQIVrPrtpkBbfOnpqdGwiS ikF4EBcBk/dj7+wO6GUnDEyqgjALDkkH0aA2DIxIVX0JcBEwDtNMklwsomq+TH+eWl ubqm5bClcaOR8SxpHUdcTS8tyl5tC5VmoP5FcKx9GRi/fVFlAiwyNe5QIoP1Vd9Ekm rGvl9pm/pfWEqvlIcFl4Y3iyZlqxYB+OuyyQjeUwIXumDW7wr8XTfXEkCBjnEzMS0m +PJhWJy+p8ejrIY9+Y+bKJUUQL4H0SprG6tBEX21XYyErKxObCgpDI8UCG+yoKXjBp 3WZkK31iPrZdQ== From: Arnd Bergmann To: Harry Wentland , Leo Li , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Zhan Liu , Ashley Thomas , Anson Jacob Cc: Arnd Bergmann , Jun Lei , Wesley Chalmers , Lee Jones , Meenakshikumar Somasundaram , Wyatt Wood , Jude Shih , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/amd/display: fix empty debug macros Date: Mon, 20 Sep 2021 14:16:00 +0200 Message-Id: <20210920121606.93700-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Using an empty macro expansion as a conditional expression produces a W=1 warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c: In function 'dce_aux_transfer_with_retries': drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:775:156: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 775 | "dce_aux_transfer_with_retries: AUX_RET_SUCCESS: AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER"); | ^ drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:783:155: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 783 | "dce_aux_transfer_with_retries: AUX_RET_SUCCESS: AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK"); | ^ Expand it to "do { } while (0)" instead to make the expression more robust and avoid the warning. Fixes: 56aca2309301 ("drm/amd/display: Add AUX I2C tracing.") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c index e14f99b4b0c3..3c3347341103 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c @@ -42,7 +42,7 @@ #define DC_LOGGER \ engine->ctx->logger -#define DC_TRACE_LEVEL_MESSAGE(...) /* do nothing */ +#define DC_TRACE_LEVEL_MESSAGE(...) do { } while (0) #define IS_DC_I2CAUX_LOGGING_ENABLED() (false) #define LOG_FLAG_Error_I2cAux LOG_ERROR #define LOG_FLAG_I2cAux_DceAux LOG_I2C_AUX @@ -76,7 +76,7 @@ enum { #define DEFAULT_AUX_ENGINE_MULT 0 #define DEFAULT_AUX_ENGINE_LENGTH 69 -#define DC_TRACE_LEVEL_MESSAGE(...) /* do nothing */ +#define DC_TRACE_LEVEL_MESSAGE(...) do { } while (0) static void release_engine( struct dce_aux *engine) -- 2.29.2