Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2316292pxb; Mon, 20 Sep 2021 18:36:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoG90WCudeFal/Hpe9v8NUkjuPXsErmyzquoqm/WWw+Piczdzvu3Rsibpo1g2LkWPU/zOz X-Received: by 2002:a17:906:ecf4:: with SMTP id qt20mr31369245ejb.375.1632188190869; Mon, 20 Sep 2021 18:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188190; cv=none; d=google.com; s=arc-20160816; b=UL/gckPTcnHqrlidnE7WTXC07Dm2A0Wu2+xnLD4Dx/CmRMCspTfQT2KQ+o5JOLF+fA hHd5kDAbRSHXwq5fNR9ibrUugCkiyC+CQkk8gnD6OY7MRQ2zYuv8kmVLvpCAteMVBmvU j9JlRjFQhpWQ7gFD/RZvE3JtiDhXTTZ8Z25dCztRWV7k2KSVTIzNHcrw/f3JC4L8550V KkFHqBcIp7g6xoRHdIv+ZaTLajOTg2VOM4hO7yLpFVUq+iPrDg9FZmG4UWvn63Phu9jD RNLlq3irjn5eG40w3+ZpwyD7GM9DkcdMFOMMm4YvVENjtfXxN2i6AOPCd4XDFSdYuOPW 9twQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=M1GmJpImkQw6oqUdA7Cxs3NXEIJfwV+W0nlaojmq7tY=; b=bfj8+SdMWFQbQzLoZGeXPVKZOLmrNAx8BxzPv6M5YuVA+2OoDjThvWgx1JQzumt2sg KaEUEXHPyQO36cG6ezi649szLs1c/dkzLJSrRBPiRIMWi1Bb3ypSM8ukjhw29U7dLoQD JJ0SzTwuZ5O/l23gZfi8w6Jc/T1jwCUhHSURuwDH6/YbHE09dzovMyPsrLyIAwF2bYXw 8qTN5BXMF4kj/qJMiE9dvc+gG6eBlr8iLKse80nQl8FCGUk8CMyXQK9x/GZ51m/kov0e dizaORto9KF1umiHUkiVTjExQPfv2aLDDVjlbV95Asl3W0guzqUDW6brABVIXYHCOXXQ eNGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QPxf4kJ5; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d19si18291171edn.202.2021.09.20.18.36.07; Mon, 20 Sep 2021 18:36:30 -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=@gmail.com header.s=20210112 header.b=QPxf4kJ5; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241932AbhITPkF (ORCPT + 99 others); Mon, 20 Sep 2021 11:40:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241891AbhITPkD (ORCPT ); Mon, 20 Sep 2021 11:40:03 -0400 Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08695C061766 for ; Mon, 20 Sep 2021 08:38:37 -0700 (PDT) Received: by mail-ot1-x32b.google.com with SMTP id w64-20020a9d3646000000b0054716b40005so3066834otb.4 for ; Mon, 20 Sep 2021 08:38:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M1GmJpImkQw6oqUdA7Cxs3NXEIJfwV+W0nlaojmq7tY=; b=QPxf4kJ5Ecxw0ZhOqGUAdQ7Ax8ylYAiHGSWFEbcpIwwvziliONhZSZLTch3/pPVUmD 7ft4TT1TUMptaxzyQ38U8PudQq8OwP7KhwuYxcpUbpe9/qmI0tqLCRmN+gz/syb7qh5G 8MCM28jfgjU0s1B1oBuQOJyAHkBI4iYVwlRJcsauYwgo7/WsrLMbjhXP+csQchrPQqji +q54I/YaNTG2NqQAHiyC4z+ViRhZjdTmwIfzgmNKfu0IMvyB3dKjhmKZzHis2M4Ys24m epSXUmHZoLcAaf1lZ8HZzqb7YrKQvXROp6no8Ph7DxWS+vLqbAHh4n9NtJ3AtaK9KEZ+ S4TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M1GmJpImkQw6oqUdA7Cxs3NXEIJfwV+W0nlaojmq7tY=; b=1hyIzh+zh8+U3JNz16FK1zVA8CiIt62Uuk2J5doBewmpKbfDjlPiR6aV1ItGL8/f8n wLyWIh7sQBLBwTemTAWu3VWnHCO1bYXqImvKGktmXFJiudzWrAzyHtE84Tvnxa6T14u/ p03+JiqVdn58UuOTYAO8NvAJEd0mWd+wHAvCPhF3BLOt+RP9Ma2CqkIm6EwfP/Uf89yy rlsN1+dOkW81QuOKc8Y+XveZgtqrLUeKKHThcQAXomql/UJSL9k5rafASZkyr9T5jwh4 V4+Z2o5m+T+C7ZYiqb1BGGrKWVWogApGKVZDOF6enawJjqq5mvPor+YsBh4g6pjJX6Q0 7tDg== X-Gm-Message-State: AOAM5315NX1ekNMeTQybLtI8VS2RAFHorZVT21glEUwi9fqg0uWSoZTR 96Vqko2xvhgFfxmjCu5g+ceX4I5yfdPjbNyPyhQ= X-Received: by 2002:a05:6830:214c:: with SMTP id r12mr21753938otd.200.1632152316355; Mon, 20 Sep 2021 08:38:36 -0700 (PDT) MIME-Version: 1.0 References: <20210920121606.93700-1-arnd@kernel.org> In-Reply-To: <20210920121606.93700-1-arnd@kernel.org> From: Alex Deucher Date: Mon, 20 Sep 2021 11:38:23 -0400 Message-ID: Subject: Re: [PATCH] drm/amd/display: fix empty debug macros To: Arnd Bergmann Cc: Harry Wentland , Leo Li , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Zhan Liu , Ashley Thomas , Anson Jacob , Arnd Bergmann , Jun Lei , Wesley Chalmers , Lee Jones , Meenakshikumar Somasundaram , Wyatt Wood , Jude Shih , amd-gfx list , Maling list - DRI developers , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 20, 2021 at 8:16 AM Arnd Bergmann wrote: > > 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 Applied. Thanks! Alex > --- > 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 >