2015-07-01 11:43:02

by Sudip Mukherjee

[permalink] [raw]
Subject: [PATCH 1/2] drm/mgag200: remove unused variables

These variables were assigned some values but they were never used.

Signed-off-by: Sudip Mukherjee <[email protected]>
---
drivers/gpu/drm/mgag200/mgag200_fb.c | 2 --
drivers/gpu/drm/mgag200/mgag200_mode.c | 9 +++------
2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c
index c36b830..958cf3c 100644
--- a/drivers/gpu/drm/mgag200/mgag200_fb.c
+++ b/drivers/gpu/drm/mgag200/mgag200_fb.c
@@ -167,7 +167,6 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
struct drm_framebuffer *fb;
struct drm_gem_object *gobj = NULL;
struct device *device = &dev->pdev->dev;
- struct mgag200_bo *bo;
int ret;
void *sysram;
int size;
@@ -185,7 +184,6 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
DRM_ERROR("failed to create fbcon backing object %d\n", ret);
return ret;
}
- bo = gem_to_mga_bo(gobj);

sysram = vmalloc(size);
if (!sysram)
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index ad4b901..cd75cff 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -158,7 +158,7 @@ static int mga_g200se_set_plls(struct mga_device *mdev, long clock)
static int mga_g200wb_set_plls(struct mga_device *mdev, long clock)
{
unsigned int vcomax, vcomin, pllreffreq;
- unsigned int delta, tmpdelta, permitteddelta;
+ unsigned int delta, tmpdelta;
unsigned int testp, testm, testn;
unsigned int p, m, n;
unsigned int computed;
@@ -172,7 +172,6 @@ static int mga_g200wb_set_plls(struct mga_device *mdev, long clock)
pllreffreq = 48000;

delta = 0xffffffff;
- permitteddelta = clock * 5 / 1000;

for (testp = 1; testp < 9; testp++) {
if (clock * testp > vcomax)
@@ -298,7 +297,7 @@ static int mga_g200wb_set_plls(struct mga_device *mdev, long clock)
static int mga_g200ev_set_plls(struct mga_device *mdev, long clock)
{
unsigned int vcomax, vcomin, pllreffreq;
- unsigned int delta, tmpdelta, permitteddelta;
+ unsigned int delta, tmpdelta;
unsigned int testp, testm, testn;
unsigned int p, m, n;
unsigned int computed;
@@ -310,7 +309,6 @@ static int mga_g200ev_set_plls(struct mga_device *mdev, long clock)
pllreffreq = 50000;

delta = 0xffffffff;
- permitteddelta = clock * 5 / 1000;

for (testp = 16; testp > 0; testp--) {
if (clock * testp > vcomax)
@@ -392,7 +390,7 @@ static int mga_g200ev_set_plls(struct mga_device *mdev, long clock)
static int mga_g200eh_set_plls(struct mga_device *mdev, long clock)
{
unsigned int vcomax, vcomin, pllreffreq;
- unsigned int delta, tmpdelta, permitteddelta;
+ unsigned int delta, tmpdelta;
unsigned int testp, testm, testn;
unsigned int p, m, n;
unsigned int computed;
@@ -406,7 +404,6 @@ static int mga_g200eh_set_plls(struct mga_device *mdev, long clock)
pllreffreq = 33333;

delta = 0xffffffff;
- permitteddelta = clock * 5 / 1000;

for (testp = 16; testp > 0; testp >>= 1) {
if (clock * testp > vcomax)
--
1.8.1.2


2015-07-01 11:43:17

by Sudip Mukherjee

[permalink] [raw]
Subject: [PATCH 2/2] drm/mgag200: remove unneeded variable

ttm_bo_validate() returns 0 or error. So we can return the value
directly and remove the variable 'ret'.

Signed-off-by: Sudip Mukherjee <[email protected]>
---
drivers/gpu/drm/mgag200/mgag200_ttm.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_ttm.c b/drivers/gpu/drm/mgag200/mgag200_ttm.c
index d16964e..05108b5 100644
--- a/drivers/gpu/drm/mgag200/mgag200_ttm.c
+++ b/drivers/gpu/drm/mgag200/mgag200_ttm.c
@@ -378,7 +378,7 @@ int mgag200_bo_pin(struct mgag200_bo *bo, u32 pl_flag, u64 *gpu_addr)

int mgag200_bo_unpin(struct mgag200_bo *bo)
{
- int i, ret;
+ int i;
if (!bo->pin_count) {
DRM_ERROR("unpin bad %p\n", bo);
return 0;
@@ -389,11 +389,7 @@ int mgag200_bo_unpin(struct mgag200_bo *bo)

for (i = 0; i < bo->placement.num_placement ; i++)
bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT;
- ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
- if (ret)
- return ret;
-
- return 0;
+ return ttm_bo_validate(&bo->bo, &bo->placement, false, false);
}

int mgag200_bo_push_sysram(struct mgag200_bo *bo)
--
1.8.1.2

2015-07-17 06:21:23

by Sudip Mukherjee

[permalink] [raw]
Subject: Re: [PATCH 1/2] drm/mgag200: remove unused variables

On Wed, Jul 01, 2015 at 05:12:45PM +0530, Sudip Mukherjee wrote:
> These variables were assigned some values but they were never used.
Gentle ping.

regards
sudip

2015-07-17 06:53:01

by Daniel Vetter

[permalink] [raw]
Subject: Re: [PATCH 1/2] drm/mgag200: remove unused variables

On Fri, Jul 17, 2015 at 11:51:03AM +0530, Sudip Mukherjee wrote:
> On Wed, Jul 01, 2015 at 05:12:45PM +0530, Sudip Mukherjee wrote:
> > These variables were assigned some values but they were never used.
> Gentle ping.

Both applied to drm-misc, thanks.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch