From patchwork Mon Sep 20 12:16:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 514308 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1992417jao; Mon, 20 Sep 2021 05:16:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzi6jI64DCcdSWK5EuwXRgEu+cUWthe2MlmP/UZzVAnHndzZBn5iFzpxPgjqL9R/2coE+5i X-Received: by 2002:a05:6a00:a8a:b029:356:be61:7f18 with SMTP id b10-20020a056a000a8ab0290356be617f18mr24817371pfl.29.1632140178609; Mon, 20 Sep 2021 05:16:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632140178; cv=none; d=google.com; s=arc-20160816; b=zrn9Lms1z2J3wBTID72jyeAuz/xo+uFZoGnCyXllzvMG/Ghm9aAXPzJPAJzcu+LNU7 ilKVVEK8DyyTl/gH3N7Dp0FyOkzIP4iqE+oUgAiLZAldQHQFhGWLbNCv+mJtVA5k+Y45 Q5gf99xLqEgd6wCG3wbh3wZJLwUo1yIiojNrU30+FLG0YTOZQw4A/z4xd16wTNOiYpvn Ds/mvXHKXYaTvh3uprTh/CVx2avaiPvpbitCOWdbqSaKBmc4LxNzeQDVmp3JSLd8PvK7 L9BgJfMHnDeS4FAOEeBLaddcr/rzep4vp/Ul7s9rjwrjCQJXj24jUxZg2bikxGNuG0E/ Iz/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :delivered-to; bh=2I1mnu6FBzqv0/EOYmausr6zFyqQK9InalGWF8QQsEs=; b=HUKN7ZqEJLbwGRiquje27YKAHggufW4sFSUXG7//vAbUx5CvPnEL2eo7wc6kk1E/0+ ujI67OmOzvGy8P1tGwytK8C+RHh91Hpo+Gp4c51CyXR0t0XoA5Z2RtmF6rlTHnBWK08P Q7MOrUebmxLgtvcai40DQVTU/7v56p1GeTKurOeo+67ehjOfXwD7aNfaYNaF/yzjIoA2 qLhTJMaGEU/o0o6bdrk/0hGJPkP5+w+LbzpntVf1Gw1DQKYJBnBoXj0Xudg7D3EEb+8D lzgpPUiJf4h7tTXzCvmGYJle2QMHF50XkzS2BbJXnrOKiKXZSZd+xvSWRa5lDgrLnLjn aLXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FBRLyWZc; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id k14si19649525pgg.149.2021.09.20.05.16.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Sep 2021 05:16:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FBRLyWZc; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CFD436E4B5; Mon, 20 Sep 2021 12:16:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id BED5D6E4B5; Mon, 20 Sep 2021 12:16:12 +0000 (UTC) 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_K=C3=B6?= =?utf-8?q?nig?= , "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 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" 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(-) -- 2.29.2 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)