Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp756533ybx; Thu, 7 Nov 2019 02:13:23 -0800 (PST) X-Google-Smtp-Source: APXvYqwb1Wih6bHg1O4BtSLt4YiWtJBUCCaX88uUGQY7dF7jGTh5hvKeMsH3O+VsjVSmVmlGQtww X-Received: by 2002:a17:906:5502:: with SMTP id r2mr2217530ejp.3.1573121603314; Thu, 07 Nov 2019 02:13:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573121603; cv=none; d=google.com; s=arc-20160816; b=WN4LOkd1lbHHUo1rcut832wrvFxJW68FUrNDrBP6JrotYXZNqoCuEbZUpa0vdRdyz3 TKgM/QiCjBM/fyvBqOinzPJO0E52zufIPslDu1DGjAfUP7CMWeiDs6tKFh6/yse1CQnL L+EPzFrJppyTFhQxG7spFn/0ysJKKBq2ICIK+SxUcFia1Q3AjfMZWazy/eapIWOdF3BJ gpNmdwaA12RPCsV09dmrAT2OTGXz2cXyiqqYKiz5+p3ku4f4oaWq2to+blkuCk6Brf+8 mBmmwlo+yDVkBD5bYrCDsMdhgP+zHywCXsNji7IK5jq71w0a9d2bj0IJzhyx7WSkWPsk Of2w== 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:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Ns688Up2hd4d1aAqhD9KmzeBd9oma7gtdEecIkU5Nlw=; b=C7l++2qJYMs3F+UYI2t0Nna2oLzJQg/F7rMbOrYZBzzhJ9qdqbsCX7TsnKUn5R7O+2 SfbMt0qqn31W68IgTxLKhLxyGTyQlp8g4mLI/l5p0DhcamsDnyrZwW8aXscRFCRT5ias tCcK6XbKi9qMKlKKgrnStZnCKlKbWDfDpj2bAvUC3S7oTo7Au0rCV0ezU3uXmjRwWCpb XaoEvBUD+qELmQ4iwptgyjtGCHPK+NcbEt2CoEEVDn5jTGxlxwpMGxIcvPfmUniOKy5n gt+gr4pzev+gdPKU7PqaSNktz0bDWx/UctfE/hD1blT7pZM/3MKPdgmVg7D8OpsrVavM C3Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U80+8TTY; 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 i39si1229688eda.88.2019.11.07.02.12.59; Thu, 07 Nov 2019 02:13:23 -0800 (PST) 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=U80+8TTY; 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 S2387831AbfKGKK6 (ORCPT + 99 others); Thu, 7 Nov 2019 05:10:58 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:46198 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727562AbfKGKK6 (ORCPT ); Thu, 7 Nov 2019 05:10:58 -0500 Received: by mail-qk1-f194.google.com with SMTP id h15so1408393qka.13 for ; Thu, 07 Nov 2019 02:10:56 -0800 (PST) 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 :content-transfer-encoding; bh=Ns688Up2hd4d1aAqhD9KmzeBd9oma7gtdEecIkU5Nlw=; b=U80+8TTY38GfaDf+u89n1ZYcfmrIt2g/pyRBOjOpWfoAArS63FnYbhCvQeCAC5b3HN 7UN6OPk6fng+hxcfD6fZJrSbdWe7kQ6JSogqIMd0lJ3ofOU67tBKdSpnBOKyxtxXugrx hGaUZCJjT8xsehhpTm5n48vohWN1G/uttUvg5W9VHv8+HlD0A6xm4RX35Idxfr9uC3gB SqtoK+2aZBChATeOA8f4ZV9FzxAkS11Aw/369P8HfUMUHuioSxvxQlDX/6VIcsndoG/p E9mk7y8uPNBms02whwzWtU+BZs0Y311n3ZyvlXqykXbT4iCxGw56npbrmZwrnSeZ553O Hdmw== 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:content-transfer-encoding; bh=Ns688Up2hd4d1aAqhD9KmzeBd9oma7gtdEecIkU5Nlw=; b=Hor1Ppr76W0ch46wp1dr7uEsrn77+EmBhJ+T/KHFzlBf0ghq/7IeEpqDkqwF/2lnHe Zjp0vIJcZXL9S0ZyxZW7mruXjUzdKiRRXUOmHboANGLYiFII6tlUm2PNX+Hg2FzOXsE2 ap3vGSGS9OfrY2o2zd3paW+bLMQONtOq0vAdcrR4PBc5KCF8tpmEvEx67zbxKRGmj5y5 0D5h9uBY1UREer7Ox427GmW/QrdD6/R6pEiZUXbqr32ZNrpQy521z8ZNNnvubNRu9w+/ C9vn34bzu9W44fRs5dVsDI6f6PpIM6sPIcuKwgrxivWXM6uiUR7dIJzbsJqIGYcwRziE q3UA== X-Gm-Message-State: APjAAAV1i5MuVpI2/bMPKxEmXiWwppOp6ezq2Hd/4+x3Hr57zCKTgSy2 svYz/f7ztrdtXzmGlremaC4V1Dp3+JvvBYcsh1/t7w== X-Received: by 2002:a37:6087:: with SMTP id u129mr1912331qkb.219.1573121455541; Thu, 07 Nov 2019 02:10:55 -0800 (PST) MIME-Version: 1.0 References: <20191008124254.2144-1-benjamin.gaignard@st.com> <20191022083725.GW11828@phenom.ffwll.local> In-Reply-To: <20191022083725.GW11828@phenom.ffwll.local> From: Benjamin Gaignard Date: Thu, 7 Nov 2019 11:10:44 +0100 Message-ID: Subject: Re: [PATCH v2] drm: atomic helper: fix W=1 warnings To: Benjamin Gaignard , David Airlie , =?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 mar. 22 oct. 2019 =C3=A0 10:37, Daniel Vetter a =C3=A9= crit : > > On Tue, Oct 08, 2019 at 02:42:54PM +0200, Benjamin Gaignard wrote: > > 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 > > > > Signed-off-by: Benjamin Gaignard > > OCD in me would lean towards annotating all of them, unconditionally, and > be done. But I guess this works too. Either way: > > Reviewed-by: Daniel Vetter Thanks, Applied to drm-misc-next Benjamin > > --- > > 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 = drm_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 = drm_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 = drm_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= update > > @@ -754,7 +758,9 @@ void drm_state_dump(struct drm_device *dev, struct = drm_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 = drm_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 atom= ic update > > @@ -813,6 +821,7 @@ void drm_state_dump(struct drm_device *dev, struct = drm_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 = drm_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 obj= ects in an atomic update > > -- > > 2.15.0 > > > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel