Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4634956ybg; Mon, 21 Oct 2019 11:59:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqx82MZ4DFmG38+uOu00CCK9th8HQFrK1agqS1HnActOup3sMln2fMtowhhipXvpZLSeLUIV X-Received: by 2002:a50:970e:: with SMTP id c14mr9573084edb.20.1571684370590; Mon, 21 Oct 2019 11:59:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571684370; cv=none; d=google.com; s=arc-20160816; b=isJSoJAviMGuQsk4PsxdcbWQd54IxWVp2kdcNsh1r1ybZ4QqbK5/FwJcznLGwiUBZV jDsYkq3qKFYFVnKkoQnqdMBn2aCI+W5jU5Q7sMT8epSYmpgY+vwfBsuZ+FeWWIJJhKgc eRJsFwYdI9q7KM0oCwl51jqQ3RigxOhZJzexRfPwskh/Ga+bJloCNH/mJ69GTdMYy09i IYTJmPgy66NgexbCqSkY9LW1ay+7QIHvZmfopso3rdBwEW8csJZwqaJb7yaOotrLrb9U R2f9esphJejbG1zbBagi0UuQFLFWYT62oJ8qwYUGyASRcwLUzTRqSf6myiRK65+4UlYR Un4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=9ggfZg5m+e/SKbdKVaz+2EJBpB6gy314A1ofRgLtyC4=; b=absMNWJ6TFcald0EpWl3/qICXqpAPp0wBncmB0obERCjlwUmjmICW8nJZ8X1bbHneY /NmW9eK6WhXZoBKcSmt1vr7HtNY7wX7cShN5OBQ0UCFhYOtOLlccHbjnYT1k7RXIiNLF +IjN9Wqaf3+tpqUoLjY1JpbDk+XhpJt/uacdhpyHQMCQMVLdc8Jlv0fJNvTb9qV23vxA MGW9iCnjync+H5qxMFRmOjC+WYK8ha2YYcCFt1yelN6gq5b5Wo34OXciKbuk84wK7BAr t5FbvIAG1dLHs3gdqmkhUbnHkN19bX20VpseTCqX9Jhp3EuMZay118jeur3rFjHKfVsX XcaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sHOtziOe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c5si6019655edc.246.2019.10.21.11.59.06; Mon, 21 Oct 2019 11:59:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sHOtziOe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729918AbfJUS4i (ORCPT + 99 others); Mon, 21 Oct 2019 14:56:38 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:41842 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727767AbfJUS4h (ORCPT ); Mon, 21 Oct 2019 14:56:37 -0400 Received: by mail-qt1-f193.google.com with SMTP id c17so19676324qtn.8 for ; Mon, 21 Oct 2019 11:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=9ggfZg5m+e/SKbdKVaz+2EJBpB6gy314A1ofRgLtyC4=; b=sHOtziOe/uYeffiWLpBcm7UFdDSyJU2iROHk4d5TPT77JdZC6ulTQIEeVd0IDAK+Mj v6f/dPanvhHNVtVPC0wwBka+LfgPxGul2n/EBp3q1+IpRNizaC5YNYFQl0CYNDVtiKuP 78KsdtL9pi78NWPEnU8Yg7nbR9FLIjwCa3ufgb9ifVXVmXMDVRiMc5s3Iqqc/NHL+Num YF18eiS2QbMEJ21MPHyzw0ltO1k47Q7NZLSNbvd9N7ho71er69pIdAuA6ikOn0tIAEOi IGVTKRkA8vL1qYj5ODQJ80XjvifpSOtlWaHnsVN7QkB8/9cP7aPE/UgKlThYKm2EY3cF HPfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=9ggfZg5m+e/SKbdKVaz+2EJBpB6gy314A1ofRgLtyC4=; b=MvRTKgCesAldBhpwoIC3tQcqzLt0O5MV0QtZxz/7YEoexj8ryXXGHgPqr6sN2ykRfM eeX1tOCmw3PvTn3t/nK2PobXA4Fq1fNb05fcemWQl5U/XPuJ4ShPYeSIkmNnezwfLrW1 BPXJ105vvksmgS2yN46YOK+oaFfgg2GY5lFQ8wRmeuz4SKKtGu3tHYHgIWkw1mnoWp/i mfROTZAnG8vC+W6j9FhCxMW4LPJS00ylnulGgeZSNuQgPAa5p7SvE/V1Nxv5RwQ+Ii4m l2+Si1pIcz3AtcwsxmvK00J4GzGJN3y8FgnOcXZBgmr62Cf85n4PwrPPjG+sL2S3m871 OEGA== X-Gm-Message-State: APjAAAXELFEoiOYv5BkagooFJmQAZkbA2wzUvF3y6KRFCgHifELJRAnu mEAzr3gwekkKEH6yIAFXzoGNU0fJqpCcTC2xYjz9kQ== X-Received: by 2002:a0c:f702:: with SMTP id w2mr24375953qvn.111.1571684196628; Mon, 21 Oct 2019 11:56:36 -0700 (PDT) MIME-Version: 1.0 References: <20191008124254.2144-1-benjamin.gaignard@st.com> In-Reply-To: <20191008124254.2144-1-benjamin.gaignard@st.com> From: Benjamin Gaignard Date: Mon, 21 Oct 2019 20:56:25 +0200 Message-ID: Subject: Re: [PATCH v2] drm: atomic helper: fix W=1 warnings To: Benjamin Gaignard Cc: David Airlie , Daniel Vetter , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , Linux Kernel Mailing List , ML dri-devel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le mer. 9 oct. 2019 =C3=A0 09:13, Benjamin Gaignard a =C3=A9crit : > > Few for_each macro set variables that are never used later which led > to generate unused-but-set-variable warnings. > Add (void)(foo) inside the macros to remove these warnings > Gentle ping, Thanks, Benjamin > Signed-off-by: Benjamin Gaignard > --- > include/drm/drm_atomic.h | 17 ++++++++++++++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > > diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h > index 927e1205d7aa..b6c73fd9f55a 100644 > --- a/include/drm/drm_atomic.h > +++ b/include/drm/drm_atomic.h > @@ -693,6 +693,7 @@ void drm_state_dump(struct drm_device *dev, struct dr= m_printer *p); > (__i)++) = \ > for_each_if ((__state)->connectors[__i].ptr && = \ > ((connector) =3D (__state)->connectors[__i].= ptr, \ > + (void)(connector) /* Only to avoid unused-bu= t-set-variable warning */, \ > (old_connector_state) =3D (__state)->connect= ors[__i].old_state, \ > (new_connector_state) =3D (__state)->connect= ors[__i].new_state, 1)) > > @@ -714,6 +715,7 @@ void drm_state_dump(struct drm_device *dev, struct dr= m_printer *p); > (__i)++) = \ > for_each_if ((__state)->connectors[__i].ptr && = \ > ((connector) =3D (__state)->connectors[__i].= ptr, \ > + (void)(connector) /* Only to avoid unused-bu= t-set-variable warning */, \ > (old_connector_state) =3D (__state)->connect= ors[__i].old_state, 1)) > > /** > @@ -734,7 +736,9 @@ void drm_state_dump(struct drm_device *dev, struct dr= m_printer *p); > (__i)++) = \ > for_each_if ((__state)->connectors[__i].ptr && = \ > ((connector) =3D (__state)->connectors[__i].= ptr, \ > - (new_connector_state) =3D (__state)->connect= ors[__i].new_state, 1)) > + (void)(connector) /* Only to avoid unused-bu= t-set-variable warning */, \ > + (new_connector_state) =3D (__state)->connect= ors[__i].new_state, \ > + (void)(new_connector_state) /* Only to avoid= unused-but-set-variable warning */, 1)) > > /** > * for_each_oldnew_crtc_in_state - iterate over all CRTCs in an atomic u= pdate > @@ -754,7 +758,9 @@ void drm_state_dump(struct drm_device *dev, struct dr= m_printer *p); > (__i)++) \ > for_each_if ((__state)->crtcs[__i].ptr && \ > ((crtc) =3D (__state)->crtcs[__i].ptr, = \ > + (void)(crtc) /* Only to avoid unused-but-se= t-variable warning */, \ > (old_crtc_state) =3D (__state)->crtcs[__i].o= ld_state, \ > + (void)(old_crtc_state) /* Only to avoid unus= ed-but-set-variable warning */, \ > (new_crtc_state) =3D (__state)->crtcs[__i].n= ew_state, 1)) > > /** > @@ -793,7 +799,9 @@ void drm_state_dump(struct drm_device *dev, struct dr= m_printer *p); > (__i)++) \ > for_each_if ((__state)->crtcs[__i].ptr && \ > ((crtc) =3D (__state)->crtcs[__i].ptr, = \ > - (new_crtc_state) =3D (__state)->crtcs[__i].n= ew_state, 1)) > + (void)(crtc) /* Only to avoid unused-but-set= -variable warning */, \ > + (new_crtc_state) =3D (__state)->crtcs[__i].n= ew_state, \ > + (void)(new_crtc_state) /* Only to avoid unus= ed-but-set-variable warning */, 1)) > > /** > * for_each_oldnew_plane_in_state - iterate over all planes in an atomic= update > @@ -813,6 +821,7 @@ void drm_state_dump(struct drm_device *dev, struct dr= m_printer *p); > (__i)++) \ > for_each_if ((__state)->planes[__i].ptr && \ > ((plane) =3D (__state)->planes[__i].ptr, = \ > + (void)(plane) /* Only to avoid unused-but-s= et-variable warning */, \ > (old_plane_state) =3D (__state)->planes[__i= ].old_state,\ > (new_plane_state) =3D (__state)->planes[__i= ].new_state, 1)) > > @@ -873,7 +882,9 @@ void drm_state_dump(struct drm_device *dev, struct dr= m_printer *p); > (__i)++) \ > for_each_if ((__state)->planes[__i].ptr && \ > ((plane) =3D (__state)->planes[__i].ptr, = \ > - (new_plane_state) =3D (__state)->planes[__i= ].new_state, 1)) > + (void)(plane) /* Only to avoid unused-but-s= et-variable warning */, \ > + (new_plane_state) =3D (__state)->planes[__i= ].new_state, \ > + (void)(new_plane_state) /* Only to avoid un= used-but-set-variable warning */, 1)) > > /** > * for_each_oldnew_private_obj_in_state - iterate over all private objec= ts in an atomic update > -- > 2.15.0 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel