From patchwork Thu Aug 13 08:39:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 11712421 X-Patchwork-Delegate: pavel@denx.de Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BEAE1739 for ; Thu, 13 Aug 2020 11:43:24 +0000 (UTC) Received: from web01.groups.io (unknown [66.175.222.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 98F44208B3 for ; Thu, 13 Aug 2020 11:43:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.cip-project.org header.i=@lists.cip-project.org header.b="ElefC5zC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98F44208B3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bp.renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+64572+5119+4520428+8129116@lists.cip-project.org X-Received: by 127.0.0.2 with SMTP id rH64YY4521763xheDNNatWXd; Thu, 13 Aug 2020 04:43:16 -0700 X-Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web12.6052.1597307971727151403 for ; Thu, 13 Aug 2020 01:39:32 -0700 X-IronPort-AV: E=Sophos;i="5.76,307,1592838000"; d="scan'208";a="54503598" X-Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 13 Aug 2020 17:39:28 +0900 X-Received: from localhost.localdomain (unknown [172.29.52.189]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id C4DD541F86D1; Thu, 13 Aug 2020 17:39:26 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Chris Paterson , Biju Das , Prabhakar Mahadev Lad Subject: [cip-dev] [PATCH 4.19.y-cip 1/2] drm: Add drm_atomic_get_old/new_private_obj_state Date: Thu, 13 Aug 2020 09:39:24 +0100 Message-Id: <20200813083925.7830-1-biju.das.jz@bp.renesas.com> Precedence: Bulk List-Unsubscribe: Sender: cip-dev@lists.cip-project.org List-Id: Mailing-List: list cip-dev@lists.cip-project.org; contact cip-dev+owner@lists.cip-project.org Delivered-To: mailing list cip-dev@lists.cip-project.org Reply-To: cip-dev@lists.cip-project.org X-Gm-Message-State: 0uobNM3CkZvNSYQMvUQPRUK4x4520428AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.cip-project.org; q=dns/txt; s=20140610; t=1597318996; bh=yAj3vMfGiMvVWvsUk37QcQnlyh5k5oUJycd5Ukn97+g=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=ElefC5zC3ZgqxaJFg4f0Xg9Rataz8V/AvQcs8rSYhedU286xXDOod/SzAQC++kGFYU4 OoV3wYcUgq2Mh89zunLgxREaTceYb4ZHfj0lNs1GfBixnDzn6uomZu7CvzquCc8OGy3e5 BFxuW2JkhbHjibvmHNRMLoEq4CqEXx0sZOo= From: "james qian wang (Arm Technology China)" commit 9801a7eadf4cc29cdc90583a49f12decbb832ced upstream. This pair of functions return the old/new private object state for the given private_obj, or NULL if the private_obj is not part of the global atomic state. Reviewed-by: Alexandru Gheorghe Signed-off-by: James Qian Wang (Arm Technology China) Signed-off-by: Liviu Dudau Signed-off-by: Biju Das [removed changes in drivers/gpu/drm/drm_atomic.c, since the same changes are already present as part of the commit 60b4667275b6] --- include/drm/drm_atomic.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index c0b48e25a620..6329ed4af310 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -402,6 +402,12 @@ void drm_atomic_private_obj_fini(struct drm_private_obj *obj); struct drm_private_state * __must_check drm_atomic_get_private_obj_state(struct drm_atomic_state *state, struct drm_private_obj *obj); +struct drm_private_state * +drm_atomic_get_old_private_obj_state(struct drm_atomic_state *state, + struct drm_private_obj *obj); +struct drm_private_state * +drm_atomic_get_new_private_obj_state(struct drm_atomic_state *state, + struct drm_private_obj *obj); struct drm_connector * drm_atomic_get_old_connector_for_encoder(struct drm_atomic_state *state, From patchwork Thu Aug 13 08:39:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 11712417 X-Patchwork-Delegate: pavel@denx.de Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 18024739 for ; Thu, 13 Aug 2020 11:43:08 +0000 (UTC) Received: from web01.groups.io (unknown [66.175.222.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7591E20885 for ; Thu, 13 Aug 2020 11:43:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.cip-project.org header.i=@lists.cip-project.org header.b="sQADuEpL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7591E20885 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bp.renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+64572+5120+4520428+8129116@lists.cip-project.org X-Received: by 127.0.0.2 with SMTP id AbF5YY4521763x8JzEHEFp0O; Thu, 13 Aug 2020 04:42:59 -0700 X-Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web12.6054.1597307972834019613 for ; Thu, 13 Aug 2020 01:39:33 -0700 X-IronPort-AV: E=Sophos;i="5.76,307,1592838000"; d="scan'208";a="54503603" X-Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 13 Aug 2020 17:39:30 +0900 X-Received: from localhost.localdomain (unknown [172.29.52.189]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 9521741F86D1; Thu, 13 Aug 2020 17:39:28 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Cc: Chris Paterson , Biju Das , Prabhakar Mahadev Lad Subject: [cip-dev] [PATCH 4.19.y-cip 2/2] drm: atomic helper: fix W=1 warnings Date: Thu, 13 Aug 2020 09:39:25 +0100 Message-Id: <20200813083925.7830-2-biju.das.jz@bp.renesas.com> In-Reply-To: <20200813083925.7830-1-biju.das.jz@bp.renesas.com> References: <20200813083925.7830-1-biju.das.jz@bp.renesas.com> Precedence: Bulk List-Unsubscribe: Sender: cip-dev@lists.cip-project.org List-Id: Mailing-List: list cip-dev@lists.cip-project.org; contact cip-dev+owner@lists.cip-project.org Delivered-To: mailing list cip-dev@lists.cip-project.org Reply-To: cip-dev@lists.cip-project.org X-Gm-Message-State: yEQgWknb2tY88QxJik4KvD3Rx4520428AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.cip-project.org; q=dns/txt; s=20140610; t=1597318979; bh=w8JcCzFIf1KOEB1leVUrvoHUD83DpZemBh5hzGIniv0=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=sQADuEpLjK6QbeZHlxrfeH+ym/duFS3MRwYm2F5dGC8qzvBYUDhTHFSvZ155K2mA2E6 XcidWWFccISynjN/+/Rnmb5Vn6rwA3FDe5XNBi47ok/WxEwdhF9ApKA2WmcOjEUcB9hO0 DzVyFF9ez67IrzBePJLkvudf0g/SsSj554U= From: Benjamin Gaignard commit bf5d837a0a4ced7cc223befc9e76d4ad30697d27 upstream. 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 Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20191008124254.2144-1-benjamin.gaignard@st.com Signed-off-by: Biju Das --- 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 6329ed4af310..9042fdae9211 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -662,6 +662,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); (__i)++) \ for_each_if ((__state)->connectors[__i].ptr && \ ((connector) = (__state)->connectors[__i].ptr, \ + (void)(connector) /* Only to avoid unused-but-set-variable warning */, \ (old_connector_state) = (__state)->connectors[__i].old_state, \ (new_connector_state) = (__state)->connectors[__i].new_state, 1)) @@ -683,6 +684,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); (__i)++) \ for_each_if ((__state)->connectors[__i].ptr && \ ((connector) = (__state)->connectors[__i].ptr, \ + (void)(connector) /* Only to avoid unused-but-set-variable warning */, \ (old_connector_state) = (__state)->connectors[__i].old_state, 1)) /** @@ -703,7 +705,9 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); (__i)++) \ for_each_if ((__state)->connectors[__i].ptr && \ ((connector) = (__state)->connectors[__i].ptr, \ - (new_connector_state) = (__state)->connectors[__i].new_state, 1)) + (void)(connector) /* Only to avoid unused-but-set-variable warning */, \ + (new_connector_state) = (__state)->connectors[__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 @@ -723,7 +727,9 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); (__i)++) \ for_each_if ((__state)->crtcs[__i].ptr && \ ((crtc) = (__state)->crtcs[__i].ptr, \ + (void)(crtc) /* Only to avoid unused-but-set-variable warning */, \ (old_crtc_state) = (__state)->crtcs[__i].old_state, \ + (void)(old_crtc_state) /* Only to avoid unused-but-set-variable warning */, \ (new_crtc_state) = (__state)->crtcs[__i].new_state, 1)) /** @@ -762,7 +768,9 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); (__i)++) \ for_each_if ((__state)->crtcs[__i].ptr && \ ((crtc) = (__state)->crtcs[__i].ptr, \ - (new_crtc_state) = (__state)->crtcs[__i].new_state, 1)) + (void)(crtc) /* Only to avoid unused-but-set-variable warning */, \ + (new_crtc_state) = (__state)->crtcs[__i].new_state, \ + (void)(new_crtc_state) /* Only to avoid unused-but-set-variable warning */, 1)) /** * for_each_oldnew_plane_in_state - iterate over all planes in an atomic update @@ -782,6 +790,7 @@ 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, \ + (void)(plane) /* Only to avoid unused-but-set-variable warning */, \ (old_plane_state) = (__state)->planes[__i].old_state,\ (new_plane_state) = (__state)->planes[__i].new_state, 1)) @@ -842,7 +851,9 @@ 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, \ - (new_plane_state) = (__state)->planes[__i].new_state, 1)) + (void)(plane) /* Only to avoid unused-but-set-variable warning */, \ + (new_plane_state) = (__state)->planes[__i].new_state, \ + (void)(new_plane_state) /* Only to avoid unused-but-set-variable warning */, 1)) /** * for_each_oldnew_private_obj_in_state - iterate over all private objects in an atomic update