mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>,
	David Airlie <airlied@linux.ie>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>,
	Yakir Yang <ykk@rock-chips.com>, "Huang, Ray" <Ray.Huang@amd.com>,
	"Deucher, Alexander" <Alexander.Deucher@amd.com>,
	"Liu, Monk" <Monk.Liu@amd.com>,
	"Zhou, David(ChunMing)" <David1.Zhou@amd.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Heiko Stuebner <heiko@sntech.de>,
	"Huang, JinHuiEric" <JinHuiEric.Huang@amd.com>,
	"Cui, Flora" <Flora.Cui@amd.com>, Inki Dae <inki.dae@samsung.com>,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Dave Airlie <airlied@redhat.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	Frediano Ziglio <fziglio@redhat.com>,
	"Li, Samuel" <Samuel.Li@amd.com>,
	Tomasz Figa <tomasz.figa@chromium.com>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"StDenis, Tom" <Tom.StDenis@amd.com>,
	"Dan Carpenter" <dan.carpenter@oracle.com>
Subject: Re: [PATCH] drm: squash lines for simple wrapper functions
Date: Wed, 7 Sep 2016 09:16:35 +0200	[thread overview]
Message-ID: <ee687d41-1ca5-70f5-a5bd-c6b6a59cedc4@amd.com> (raw)
In-Reply-To: <1473203062-21731-1-git-send-email-yamada.masahiro@socionext.com>

Am 07.09.2016 um 01:04 schrieb Masahiro Yamada:
> Remove unneeded variables and assignments.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Tom StDenis was working on a similar patch for amdgpu as well, please 
make sure that your work doesn't conflict with his.

Apart from that looks good to me. But I would prefer this to be split up 
per driver, cause I can't really give my rb on this patch when it 
touches drivers all over the place.

On the other hand feel free to add my Acked-by and merge it as general 
cleanup through Dave directly.

Regards,
Christian.

> ---
>
>   drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c             |  6 +-----
>   drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c            |  6 +-----
>   drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c            |  6 +-----
>   drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c | 20 ++++----------------
>   drivers/gpu/drm/drm_dp_mst_topology.c             |  7 ++-----
>   drivers/gpu/drm/i915/i915_drv.c                   |  8 +-------
>   drivers/gpu/drm/qxl/qxl_draw.c                    |  7 ++-----
>   drivers/gpu/drm/qxl/qxl_release.c                 |  7 ++-----
>   drivers/gpu/drm/radeon/cik.c                      |  6 +-----
>   drivers/gpu/drm/radeon/r100.c                     |  6 +-----
>   drivers/gpu/drm/radeon/r600.c                     |  6 +-----
>   11 files changed, 17 insertions(+), 68 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> index b818461..0d5307a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -5854,11 +5854,7 @@ static int gfx_v8_0_set_clockgating_state(void *handle,
>   
>   static u32 gfx_v8_0_ring_get_rptr_gfx(struct amdgpu_ring *ring)
>   {
> -	u32 rptr;
> -
> -	rptr = ring->adev->wb.wb[ring->rptr_offs];
> -
> -	return rptr;
> +	return ring->adev->wb.wb[ring->rptr_offs];
>   }
>   
>   static u32 gfx_v8_0_ring_get_wptr_gfx(struct amdgpu_ring *ring)
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> index a64715d..b165c78 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> @@ -190,12 +190,8 @@ out:
>    */
>   static uint32_t sdma_v2_4_ring_get_rptr(struct amdgpu_ring *ring)
>   {
> -	u32 rptr;
> -
>   	/* XXX check if swapping is necessary on BE */
> -	rptr = ring->adev->wb.wb[ring->rptr_offs] >> 2;
> -
> -	return rptr;
> +	return ring->adev->wb.wb[ring->rptr_offs] >> 2;
>   }
>   
>   /**
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> index 653ce5e..cf253b9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> @@ -335,12 +335,8 @@ out:
>    */
>   static uint32_t sdma_v3_0_ring_get_rptr(struct amdgpu_ring *ring)
>   {
> -	u32 rptr;
> -
>   	/* XXX check if swapping is necessary on BE */
> -	rptr = ring->adev->wb.wb[ring->rptr_offs] >> 2;
> -
> -	return rptr;
> +	return ring->adev->wb.wb[ring->rptr_offs] >> 2;
>   }
>   
>   /**
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> index 48030f0..d37d112 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> @@ -1073,34 +1073,22 @@ void analogix_dp_set_lane3_link_training(struct analogix_dp_device *dp,
>   
>   u32 analogix_dp_get_lane0_link_training(struct analogix_dp_device *dp)
>   {
> -	u32 reg;
> -
> -	reg = readl(dp->reg_base + ANALOGIX_DP_LN0_LINK_TRAINING_CTL);
> -	return reg;
> +	return readl(dp->reg_base + ANALOGIX_DP_LN0_LINK_TRAINING_CTL);
>   }
>   
>   u32 analogix_dp_get_lane1_link_training(struct analogix_dp_device *dp)
>   {
> -	u32 reg;
> -
> -	reg = readl(dp->reg_base + ANALOGIX_DP_LN1_LINK_TRAINING_CTL);
> -	return reg;
> +	return readl(dp->reg_base + ANALOGIX_DP_LN1_LINK_TRAINING_CTL);
>   }
>   
>   u32 analogix_dp_get_lane2_link_training(struct analogix_dp_device *dp)
>   {
> -	u32 reg;
> -
> -	reg = readl(dp->reg_base + ANALOGIX_DP_LN2_LINK_TRAINING_CTL);
> -	return reg;
> +	return readl(dp->reg_base + ANALOGIX_DP_LN2_LINK_TRAINING_CTL);
>   }
>   
>   u32 analogix_dp_get_lane3_link_training(struct analogix_dp_device *dp)
>   {
> -	u32 reg;
> -
> -	reg = readl(dp->reg_base + ANALOGIX_DP_LN3_LINK_TRAINING_CTL);
> -	return reg;
> +	return readl(dp->reg_base + ANALOGIX_DP_LN3_LINK_TRAINING_CTL);
>   }
>   
>   void analogix_dp_reset_macro(struct analogix_dp_device *dp)
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 04e4571..302bdcb 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -737,16 +737,13 @@ static void drm_dp_mst_put_payload_id(struct drm_dp_mst_topology_mgr *mgr,
>   static bool check_txmsg_state(struct drm_dp_mst_topology_mgr *mgr,
>   			      struct drm_dp_sideband_msg_tx *txmsg)
>   {
> -	bool ret;
> -
>   	/*
>   	 * All updates to txmsg->state are protected by mgr->qlock, and the two
>   	 * cases we check here are terminal states. For those the barriers
>   	 * provided by the wake_up/wait_event pair are enough.
>   	 */
> -	ret = (txmsg->state == DRM_DP_SIDEBAND_TX_RX ||
> -	       txmsg->state == DRM_DP_SIDEBAND_TX_TIMEOUT);
> -	return ret;
> +	return txmsg->state == DRM_DP_SIDEBAND_TX_RX ||
> +	       txmsg->state == DRM_DP_SIDEBAND_TX_TIMEOUT;
>   }
>   
>   static int drm_dp_mst_wait_tx_reply(struct drm_dp_mst_branch *mstb,
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 95ddd56..59d029d 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -1361,13 +1361,7 @@ void i915_driver_unload(struct drm_device *dev)
>   
>   static int i915_driver_open(struct drm_device *dev, struct drm_file *file)
>   {
> -	int ret;
> -
> -	ret = i915_gem_open(dev, file);
> -	if (ret)
> -		return ret;
> -
> -	return 0;
> +	return i915_gem_open(dev, file);
>   }
>   
>   /**
> diff --git a/drivers/gpu/drm/qxl/qxl_draw.c b/drivers/gpu/drm/qxl/qxl_draw.c
> index ffe8853..9b728ed 100644
> --- a/drivers/gpu/drm/qxl/qxl_draw.c
> +++ b/drivers/gpu/drm/qxl/qxl_draw.c
> @@ -57,11 +57,8 @@ static struct qxl_rect *drawable_set_clipping(struct qxl_device *qdev,
>   static int
>   alloc_drawable(struct qxl_device *qdev, struct qxl_release **release)
>   {
> -	int ret;
> -	ret = qxl_alloc_release_reserved(qdev, sizeof(struct qxl_drawable),
> -					 QXL_RELEASE_DRAWABLE, release,
> -					 NULL);
> -	return ret;
> +	return qxl_alloc_release_reserved(qdev, sizeof(struct qxl_drawable),
> +					  QXL_RELEASE_DRAWABLE, release, NULL);
>   }
>   
>   static void
> diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c
> index f599cd0..cd83f05 100644
> --- a/drivers/gpu/drm/qxl/qxl_release.c
> +++ b/drivers/gpu/drm/qxl/qxl_release.c
> @@ -203,12 +203,9 @@ qxl_release_free(struct qxl_device *qdev,
>   static int qxl_release_bo_alloc(struct qxl_device *qdev,
>   				struct qxl_bo **bo)
>   {
> -	int ret;
>   	/* pin releases bo's they are too messy to evict */
> -	ret = qxl_bo_create(qdev, PAGE_SIZE, false, true,
> -			    QXL_GEM_DOMAIN_VRAM, NULL,
> -			    bo);
> -	return ret;
> +	return qxl_bo_create(qdev, PAGE_SIZE, false, true,
> +			     QXL_GEM_DOMAIN_VRAM, NULL, bo);
>   }
>   
>   int qxl_release_list_add(struct qxl_release *release, struct qxl_bo *bo)
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index 0c1b9ff..4da1140 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -4201,11 +4201,7 @@ u32 cik_gfx_get_rptr(struct radeon_device *rdev,
>   u32 cik_gfx_get_wptr(struct radeon_device *rdev,
>   		     struct radeon_ring *ring)
>   {
> -	u32 wptr;
> -
> -	wptr = RREG32(CP_RB0_WPTR);
> -
> -	return wptr;
> +	return RREG32(CP_RB0_WPTR);
>   }
>   
>   void cik_gfx_set_wptr(struct radeon_device *rdev,
> diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
> index f25994b..f5e84f4 100644
> --- a/drivers/gpu/drm/radeon/r100.c
> +++ b/drivers/gpu/drm/radeon/r100.c
> @@ -1071,11 +1071,7 @@ u32 r100_gfx_get_rptr(struct radeon_device *rdev,
>   u32 r100_gfx_get_wptr(struct radeon_device *rdev,
>   		      struct radeon_ring *ring)
>   {
> -	u32 wptr;
> -
> -	wptr = RREG32(RADEON_CP_RB_WPTR);
> -
> -	return wptr;
> +	return RREG32(RADEON_CP_RB_WPTR);
>   }
>   
>   void r100_gfx_set_wptr(struct radeon_device *rdev,
> diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
> index 9247e7d..f034687 100644
> --- a/drivers/gpu/drm/radeon/r600.c
> +++ b/drivers/gpu/drm/radeon/r600.c
> @@ -2631,11 +2631,7 @@ u32 r600_gfx_get_rptr(struct radeon_device *rdev,
>   u32 r600_gfx_get_wptr(struct radeon_device *rdev,
>   		      struct radeon_ring *ring)
>   {
> -	u32 wptr;
> -
> -	wptr = RREG32(R600_CP_RB_WPTR);
> -
> -	return wptr;
> +	return RREG32(R600_CP_RB_WPTR);
>   }
>   
>   void r600_gfx_set_wptr(struct radeon_device *rdev,

  reply	other threads:[~2016-09-07  7:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06 23:04 Masahiro Yamada
2016-09-07  7:16 ` Christian König [this message]
2016-09-07  8:34 ` Jani Nikula
2016-09-07 15:09   ` Masahiro Yamada
2016-09-07 14:58 ` Deucher, Alexander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee687d41-1ca5-70f5-a5bd-c6b6a59cedc4@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=David1.Zhou@amd.com \
    --cc=Flora.Cui@amd.com \
    --cc=JinHuiEric.Huang@amd.com \
    --cc=Monk.Liu@amd.com \
    --cc=Ray.Huang@amd.com \
    --cc=Samuel.Li@amd.com \
    --cc=Tom.StDenis@amd.com \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=dan.carpenter@oracle.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fziglio@redhat.com \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=heiko@sntech.de \
    --cc=inki.dae@samsung.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=tomasz.figa@chromium.com \
    --cc=yamada.masahiro@socionext.com \
    --cc=ykk@rock-chips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®