Skip to contentSkip to conversation

agp: Misc fix

PATCH In review Corentin Labbe 1 participant 5 messages Sep 1, 2017 – Apr 20, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover agp: Misc fix

Hello

The first patch goal is to regroup all miscdevice number in the same place. The two subsequent patch are build warning fix found when working on the first.

Corentin Labbe (3):
agp: move AGPGART_MINOR to include/linux/miscdevice.h
agp: add compat_ioctl.h to frontend.c
agp: remove unused variable num_segments

 drivers/char/agp/frontend.c | 4 ++--
 include/linux/agpgart.h     | 2 --
 include/linux/miscdevice.h  | 1 +
 3 files changed, 3 insertions(+), 4 deletions(-)
Signature · 1 line
2.13.5
#1 lore raw

PATCH 1/3 agp: move AGPGART_MINOR to include/linux/miscdevice.h

This patch move the define for AGPGART_MINOR to include/linux/miscdevice.h. It is better that all minor number definitions are in the same place.

---
 include/linux/agpgart.h    | 2 --
 include/linux/miscdevice.h | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)
include/linux/agpgart.h +0 -2
index c6b61ca97053..21b34a96cfd8 100644
@@ -30,8 +30,6 @@
 #include <linux/agp_backend.h>
 #include <uapi/linux/agpgart.h>
 
-#define AGPGART_MINOR 175
-
 struct agp_info {
 	struct agp_version version;	/* version of the driver        */
 	u32 bridge_id;		/* bridge vendor/device         */
include/linux/miscdevice.h +1 -0
index 05c3892b3e92..c6936d1546bd 100644
@@ -32,6 +32,7 @@
 #define SGI_MMTIMER		153
 #define STORE_QUEUE_MINOR	155	/* unused */
 #define I2O_MINOR		166
+#define AGPGART_MINOR		175
 #define HWRNG_MINOR		183
 #define MICROCODE_MINOR		184
 #define IRNET_MINOR		187
Signature · 1 line
2.13.5
#2 lore raw

PATCH 2/3 agp: add compat_ioctl.h to frontend.c

In reply to Corentin Labbe

When building I got the following warnings:
drivers/char/agp/frontend.c:163:5: warning: no previous prototype for 'agp_create_segment' [-Wmissing-prototypes] drivers/char/agp/frontend.c:215:26: warning: no previous prototype for 'agp_find_private' [-Wmissing-prototypes] drivers/char/agp/frontend.c:270:6: warning: no previous prototype for 'agp_free_memory_wrap' [-Wmissing-prototypes] drivers/char/agp/frontend.c:276:20: warning: no previous prototype for 'agp_allocate_memory_wrap' [-Wmissing-prototypes] drivers/char/agp/frontend.c:488:20: warning: no previous prototype for 'agp_find_client_by_pid' [-Wmissing-prototypes] drivers/char/agp/frontend.c:513:20: warning: no previous prototype for 'agp_create_client' [-Wmissing-prototypes] drivers/char/agp/frontend.c:526:5: warning: no previous prototype for 'agp_remove_client' [-Wmissing-prototypes] drivers/char/agp/frontend.c:737:5: warning: no previous prototype for 'agpioc_acquire_wrap' [-Wmissing-prototypes] drivers/char/agp/frontend.c:780:5: warning: no previous prototype for 'agpioc_release_wrap' [-Wmissing-prototypes] drivers/char/agp/frontend.c:787:5: warning: no previous prototype for 'agpioc_setup_wrap' [-Wmissing-prototypes] drivers/char/agp/frontend.c:867:5: warning: no previous prototype for 'agpioc_protect_wrap' [-Wmissing-prototypes] drivers/char/agp/frontend.c:901:5: warning: no previous prototype for 'agpioc_deallocate_wrap' [-Wmissing-prototypes]

Since theses functions prototypes are in compat_ioctl.h and "users" of compat_ioctl.h use them, frontend.c need to include compat_ioctl.h.

---
 drivers/char/agp/frontend.c | 1 +
 1 file changed, 1 insertion(+)
drivers/char/agp/frontend.c +1 -0
index f6955888e676..68376eb54af4 100644
@@ -41,6 +41,7 @@
 #include <linux/uaccess.h>
 #include <asm/pgtable.h>
 #include "agp.h"
+#include "compat_ioctl.h"
 
 struct agp_front_data agp_fe;
 
Signature · 1 line
2.13.5
#3 lore raw

PATCH 3/3 agp: remove unused variable num_segments

In reply to Corentin Labbe

This patch fix the following build warning:
warning: variable 'num_segments' set but not used [-Wunused-but-set-variable]

---
 drivers/char/agp/frontend.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/char/agp/frontend.c +1 -2
index 68376eb54af4..f91975cee665 100644
@@ -103,14 +103,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) &&
Signature · 1 line
2.13.5
#4 lore raw
In reply to Corentin Labbe
Quoted 10 lines · Corentin Labbe

Hello

The first patch goal is to regroup all miscdevice number in the same place. The two subsequent patch are build warning fix found when working on the first.

Corentin Labbe (3):
agp: move AGPGART_MINOR to include/linux/miscdevice.h
agp: add compat_ioctl.h to frontend.c
agp: remove unused variable num_segments

Quoted 8 lines
 drivers/char/agp/frontend.c | 4 ++--
 include/linux/agpgart.h     | 2 --
 include/linux/miscdevice.h  | 1 +
 3 files changed, 3 insertions(+), 4 deletions(-)
Signature · 1 line
2.13.5

Hello

Gentle ping

Regards