From patchwork Thu Oct 18 19:58:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Crouse X-Patchwork-Id: 10647991 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99B37181D for ; Thu, 18 Oct 2018 19:58:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C1AD28D19 for ; Thu, 18 Oct 2018 19:58:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80E0B28E69; Thu, 18 Oct 2018 19:58:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E622F28E7A for ; Thu, 18 Oct 2018 19:58:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727141AbeJSEB3 (ORCPT ); Fri, 19 Oct 2018 00:01:29 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:33600 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727118AbeJSEB3 (ORCPT ); Fri, 19 Oct 2018 00:01:29 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C2E56613C2; Thu, 18 Oct 2018 19:58:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539892733; bh=eqp/RvLuQLgw06va7y2Ohpku4+W1Mhj0KhByC0D2SSM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HN9UZC2aBM3g/7+CaMLvNh7vY7Va53jYqGlhxBy7DIjmwKUAOWOYHVlfGIKsOGFSv v0j4gFeTwVyWr2lMEavuVqtLofZM9yafr5wvrE6RdLALroOyGbgW4xyQuvSYQtazwO jIUBt8P/g8UMH/+QTOF62ed4SJVGXGWBFBQNhCNs= Received: from jcrouse-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jcrouse@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9A15461314; Thu, 18 Oct 2018 19:58:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539892731; bh=eqp/RvLuQLgw06va7y2Ohpku4+W1Mhj0KhByC0D2SSM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VAvpROtmnaC0F5duki0kWSkqtZs3hPP0AZP1pZj/mPMhP9wqp3PxGUnEIiMpuOITu QTIoOtxBGixAzO1eM7JguOFEvXrSsSxoG+zWbigW0nluPo18UDYdjvhiyIso/wN/Pc PaLJ9ITBr4a1vQBdniiUvOgF223jeO5cEmz2ji5Y= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9A15461314 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jcrouse@codeaurora.org From: Jordan Crouse To: freedreno@lists.freedesktop.org Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, seanpaul@chromium.org, abhinavk@codeaurora.org Subject: [PATCH 05/11] drm/msm/dpu: Cleanup some container_of helper functions Date: Thu, 18 Oct 2018 13:58:30 -0600 Message-Id: <20181018195836.15885-6-jcrouse@codeaurora.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181018195836.15885-1-jcrouse@codeaurora.org> References: <20181018195836.15885-1-jcrouse@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Cleanup a number of static inline container_of() helper functions because they are either unused or only used in one file and can be performed inline or with a simple #define. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h | 10 ---------- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h | 10 ---------- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h | 10 ---------- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.h | 10 ---------- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h | 10 ---------- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h | 10 ---------- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 ++++- 7 files changed, 4 insertions(+), 61 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h index 6f313faca43e..f022c636e4bf 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h @@ -184,16 +184,6 @@ struct dpu_hw_ctl { struct dpu_hw_ctl_ops ops; }; -/** - * dpu_hw_ctl - convert base object dpu_hw_base to container - * @hw: Pointer to base hardware block - * return: Pointer to hardware block container - */ -static inline struct dpu_hw_ctl *to_dpu_hw_ctl(struct dpu_hw_blk *hw) -{ - return container_of(hw, struct dpu_hw_ctl, base); -} - /** * dpu_hw_ctl_init(): Initializes the ctl_path hw driver object. * should be called before accessing every ctl path registers. diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h index 3b77df460dea..a2b0dbc23058 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h @@ -91,16 +91,6 @@ struct dpu_hw_intf { struct dpu_hw_intf_ops ops; }; -/** - * to_dpu_hw_intf - convert base object dpu_hw_base to container - * @hw: Pointer to base hardware block - * return: Pointer to hardware block container - */ -static inline struct dpu_hw_intf *to_dpu_hw_intf(struct dpu_hw_blk *hw) -{ - return container_of(hw, struct dpu_hw_intf, base); -} - /** * dpu_hw_intf_init(): Initializes the intf driver for the passed * interface idx. diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h index 5b036aca8340..200cd874b683 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h @@ -85,16 +85,6 @@ struct dpu_hw_mixer { struct dpu_hw_mixer_cfg cfg; }; -/** - * to_dpu_hw_mixer - convert base object dpu_hw_base to container - * @hw: Pointer to base hardware block - * return: Pointer to hardware block container - */ -static inline struct dpu_hw_mixer *to_dpu_hw_mixer(struct dpu_hw_blk *hw) -{ - return container_of(hw, struct dpu_hw_mixer, base); -} - /** * dpu_hw_lm_init(): Initializes the mixer hw driver object. * should be called once before accessing every mixer. diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.h index 3caccd7d6a3e..0e02e43cee14 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.h @@ -104,16 +104,6 @@ struct dpu_hw_pingpong { struct dpu_hw_pingpong_ops ops; }; -/** - * dpu_hw_pingpong - convert base object dpu_hw_base to container - * @hw: Pointer to base hardware block - * return: Pointer to hardware block container - */ -static inline struct dpu_hw_pingpong *to_dpu_hw_pingpong(struct dpu_hw_blk *hw) -{ - return container_of(hw, struct dpu_hw_pingpong, base); -} - /** * dpu_hw_pingpong_init - initializes the pingpong driver for the passed * pingpong idx. diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h index 4d81e5f5ce1b..119b4e1c16be 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h @@ -391,16 +391,6 @@ struct dpu_hw_pipe { struct dpu_hw_sspp_ops ops; }; -/** - * dpu_hw_pipe - convert base object dpu_hw_base to container - * @hw: Pointer to base hardware block - * return: Pointer to hardware block container - */ -static inline struct dpu_hw_pipe *to_dpu_hw_pipe(struct dpu_hw_blk *hw) -{ - return container_of(hw, struct dpu_hw_pipe, base); -} - /** * dpu_hw_sspp_init - initializes the sspp hw driver object. * Should be called once before accessing every pipe. diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h index 192e338f20bb..aa21fd834398 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h @@ -160,16 +160,6 @@ struct dpu_hw_mdp { struct dpu_hw_mdp_ops ops; }; -/** - * to_dpu_hw_mdp - convert base object dpu_hw_base to container - * @hw: Pointer to base hardware block - * return: Pointer to hardware block container - */ -static inline struct dpu_hw_mdp *to_dpu_hw_mdp(struct dpu_hw_blk *hw) -{ - return container_of(hw, struct dpu_hw_mdp, base); -} - /** * dpu_hw_mdptop_init - initializes the top driver for the passed idx * @idx: Interface index for which driver object is required diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c index bdb117709674..3e0e493ae0ce 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c @@ -405,6 +405,8 @@ static bool _dpu_rm_needs_split_display(const struct msm_display_topology *top) return top->num_intf > 1; } +#define to_dpu_hw_mixer(hw) container_of((hw), struct dpu_hw_mixer, base) + /** * _dpu_rm_check_lm_and_get_connected_blks - check if proposed layer mixer meets * proposed use case requirements, incl. hardwired dependent blocks like @@ -566,7 +568,8 @@ static int _dpu_rm_reserve_ctls( dpu_rm_init_hw_iter(&iter, 0, DPU_HW_BLK_CTL); while (_dpu_rm_get_hw_locked(rm, &iter)) { - const struct dpu_hw_ctl *ctl = to_dpu_hw_ctl(iter.blk->hw); + const struct dpu_hw_ctl *ctl = + container_of(iter.blk->hw, struct dpu_hw_ctl, base); unsigned long features = ctl->caps->features; bool has_split_display;