Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3595416pxu; Tue, 8 Dec 2020 16:48:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHrss9h6Q9cxI977Wpxu1pRxDIM0B/2Zx58MRHQtmrjxSHYZoUncsFXlDw9b+UFoTAZEPM X-Received: by 2002:a50:8b61:: with SMTP id l88mr548555edl.250.1607474893073; Tue, 08 Dec 2020 16:48:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607474893; cv=none; d=google.com; s=arc-20160816; b=K5Xw4L4P6xWhMRgQCkaS1FAZcdXiLnysyodWDpiQvKNNdk0B5IiLLe6cbQBARVFViy Fudt17j9f5D5/DphBKn9HR6J836IL5IE7GKhX/XZu/i1zA5JxU65HiQ9dYqYmwGiInJw 1CgBlzhtNn29Olq7MBA/XfL1+sZFLvOQnFgAcrIYOrlC1+4z15dnHFKCKtdH0zDWWS5b 9ysLae22BYhK6NqcWMvPNyhFQlNnFRbxv08a1ZrvqrpbVJw/rgyNBI2YFGHx2qgwCs8o neif4eIjFcjMUDOdIhTb5jupOE+moB0eRro2ug9Eqrg/XwsPnhGgbLQ81e/4aCrr1dgN Cc6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=WBbHO055TDdHkxOg7jOYFdPzCq3mNcsnhSnfew3Y1EY=; b=r9+lhUjLVsa2GQg48UTC/j/Al80GCN96F1lKjaSzDZxMlN+w2svEoluB+jKwVQ3rdV tD0jsB91Ea/YoxQ+DCNuy27u0IsRAzvKsvhoB1kjUv0v76sZuTIM3cF/Z6oeQtrj9E1M YSGBFBFiMZV8siHH7v2ZLoE+hyhxUYZMtlOos7rU3dgd7N91T6xY19OV755eUnRz2Pca MvQt24aw4qS7lI4RI2yAnaAXPHvGQq8oe/wCj+Oa+9QeiPziLPTOON1jjQYc9a3A8KDf Bes44PqQ3bwaj6usYVD4AODPWWBcpm8aKQul0OMdHOvj2t835AF4RPysHDtSnb2Jliee 2nhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=gkn9GnyQ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q12si94273edb.395.2020.12.08.16.47.47; Tue, 08 Dec 2020 16:48:13 -0800 (PST) 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=@ffwll.ch header.s=google header.b=gkn9GnyQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729887AbgLIApA (ORCPT + 99 others); Tue, 8 Dec 2020 19:45:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725940AbgLIAo7 (ORCPT ); Tue, 8 Dec 2020 19:44:59 -0500 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7152DC061794 for ; Tue, 8 Dec 2020 16:44:19 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id g25so29849wmh.1 for ; Tue, 08 Dec 2020 16:44:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=WBbHO055TDdHkxOg7jOYFdPzCq3mNcsnhSnfew3Y1EY=; b=gkn9GnyQglKnUhjGGYCXIKsVi5wfV6l/qEI1a2+K2hvW+PzEBba0WRfUqG5WqleEHH rYvJAfFHvVA1vSFpUDhC9St39gWYoj9oFpMSVof8etKlbdIgrXP/Fe/VJAoTRe1NW53r oINMGfzdvTBk2+JPfj2iGvrr651ssjNGtsJy4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=WBbHO055TDdHkxOg7jOYFdPzCq3mNcsnhSnfew3Y1EY=; b=kCFKGyQvQMJgrIQFqrkMQxnkYW98U1rE7GFmikf7ACMuKl8rACQMsiXNtNEpuWOPc+ EGBCXJ1K1oJs5pJoWRx4FVOMbFA4MQ7CdipTg7XtwW1GJLCf2SAq+YfEnEFgQtmUGADr eiB7GJRrdqaKbPe5+d97XsssJoLTG1xC7ktySy4vKuCqW36cGKY4LfBzTyi2gkz8I3bv SLH6ihwIpg58BpzhggZglA7TH0pby/FFIcZMaahoiqQtk9TnNzSQknoUIAmIiRMv9w9M oZ1Vw78ljCX5cJWLSBUTYMFCa1n60RAAscU3uNnXGbUba0JUt/w1+PRPv0kEXJMcX4qD WJcQ== X-Gm-Message-State: AOAM533pMvHoEQe9rXZA3IeuovfurUCakefi5nJgmMnCuYEeGZKn3KY9 rq0wh5QVdl/jtN+Qbs4MpXZOZYmvfA5JxQ== X-Received: by 2002:a7b:c308:: with SMTP id k8mr44691wmj.76.1607474658253; Tue, 08 Dec 2020 16:44:18 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id 138sm37368wma.41.2020.12.08.16.44.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Dec 2020 16:44:17 -0800 (PST) Date: Wed, 9 Dec 2020 01:44:15 +0100 From: Daniel Vetter To: Liu Ying Cc: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, p.zabel@pengutronix.de, airlied@linux.ie, daniel@ffwll.ch, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, robh+dt@kernel.org, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, laurentiu.palcu@oss.nxp.com Subject: Re: [PATCH v3 4/6] drm/atomic: Avoid unused-but-set-variable warning on for_each_old_plane_in_state Message-ID: <20201209004415.GM401619@phenom.ffwll.local> Mail-Followup-To: Liu Ying , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, p.zabel@pengutronix.de, airlied@linux.ie, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, robh+dt@kernel.org, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, laurentiu.palcu@oss.nxp.com References: <1607311260-13983-1-git-send-email-victor.liu@nxp.com> <1607311260-13983-5-git-send-email-victor.liu@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1607311260-13983-5-git-send-email-victor.liu@nxp.com> X-Operating-System: Linux phenom 5.7.0-1-amd64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 07, 2020 at 11:20:58AM +0800, Liu Ying wrote: > Artifically use 'plane' and 'old_plane_state' to avoid 'not used' warning. > The precedent has already been set by other macros in the same file. > > Signed-off-by: Liu Ying Acked-by: Daniel Vetter I'm assuming someone will push this to drm-misc or some other tree. Should probably land sooner than later. -Daniel > --- > v2->v3: > * Add a missing blank line. > > v1->v2: > * No change. > > include/drm/drm_atomic.h | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h > index 54e051a..2e087d7 100644 > --- a/include/drm/drm_atomic.h > +++ b/include/drm/drm_atomic.h > @@ -888,7 +888,10 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); > (__i)++) \ > for_each_if ((__state)->planes[__i].ptr && \ > ((plane) = (__state)->planes[__i].ptr, \ > - (old_plane_state) = (__state)->planes[__i].old_state, 1)) > + (void)(plane) /* Only to avoid unused-but-set-variable warning */, \ > + (old_plane_state) = (__state)->planes[__i].old_state, \ > + (void)(old_plane_state) /* Only to avoid unused-but-set-variable warning */, 1)) > + > /** > * for_each_new_plane_in_state - iterate over all planes in an atomic update > * @__state: &struct drm_atomic_state pointer > -- > 2.7.4 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch