[PATCH -next] agp/uninorth: remove set but not used variable 'size'

From: Yue Haibing
Date: Tue Apr 23 2019 - 10:38:46 EST


From: YueHaibing <yuehaibing@xxxxxxxxxx>

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/char/agp/uninorth-agp.c: In function 'uninorth_create_gatt_tablei':
drivers/char/agp/uninorth-agp.c:371:6: warning: variable 'size' set but not used [-Wunused-but-set-variable]
drivers/char/agp/frontend.c: In function 'agp_find_seg_in_client':
drivers/char/agp/frontend.c:105:6: warning: variable 'num_segments' set but not used [-Wunused-but-set-variable]

It's never used since introduction.

Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
---
drivers/char/agp/frontend.c | 3 +--
drivers/char/agp/uninorth-agp.c | 4 +---
2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c
index f695588..4709864 100644
--- a/drivers/char/agp/frontend.c
+++ b/drivers/char/agp/frontend.c
@@ -102,14 +102,13 @@ agp_segment_priv *agp_find_seg_in_client(const struct agp_client *client,
int size, pgprot_t page_prot)
{
struct agp_segment_priv *seg;
- int num_segments, i;
+ int i;
off_t pg_start;
size_t pg_count;

pg_start = offset / 4096;
pg_count = size / 4096;
seg = *(client->segments);
- num_segments = client->num_segments;

for (i = 0; i < client->num_segments; i++) {
if ((seg[i].pg_start == pg_start) &&
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
index 31fcd043..91ead0ea 100644
--- a/drivers/char/agp/uninorth-agp.c
+++ b/drivers/char/agp/uninorth-agp.c
@@ -368,7 +368,6 @@ static int uninorth_create_gatt_table(struct agp_bridge_data *bridge)
{
char *table;
char *table_end;
- int size;
int page_order;
int num_entries;
int i;
@@ -382,10 +381,9 @@ static int uninorth_create_gatt_table(struct agp_bridge_data *bridge)
table = NULL;
i = bridge->aperture_size_idx;
temp = bridge->current_size;
- size = page_order = num_entries = 0;
+ page_order = num_entries = 0;

do {
- size = A_SIZE_32(temp)->size;
page_order = A_SIZE_32(temp)->page_order;
num_entries = A_SIZE_32(temp)->num_entries;

--
2.7.0