Skip to contentSkip to conversation

usemem: Remove the duplicate do_access

PATCH New Hui Zhu 1 participant 1 message Jan 19, 2021

lore
Share & tools
lore

Hui Zhu

author
#0 lore raw

PATCH 1/1 usemem: Remove the duplicate do_access

From: Hui Zhu <[email protected]>

Got following error when build usemem:
gcc -O -c -Wall -g usemem.c -o usemem.o
usemem.c:451:15: error: redefinition of ‘do_access’
unsigned long do_access(unsigned long *p, unsigned long idx, int read)

               ^~~~~~~~~
usemem.c:332:15: note: previous definition of ‘do_access’ was here
 unsigned long do_access(unsigned long *p, unsigned long idx, int read)
               ^~~~~~~~~

make: *** [usemem.o] Error 1

Remove the duplicate do_access to fix this error.

---
 usemem.c | 12 ------------
 1 file changed, 12 deletions(-)
usemem.c +0 -12
index 48c3d65..e2c46ec 100644
@@ -329,18 +329,6 @@ void detach(void)
 	}
 }
 
-unsigned long do_access(unsigned long *p, unsigned long idx, int read)
-{
-	volatile unsigned long *vp = p;
-
-	if (read)
-		return vp[idx];	/* read data */
-	else {
-		vp[idx] = idx;	/* write data */
-		return 0;
-	}
-}
-
 unsigned long * allocate(unsigned long bytes)
 {
 	unsigned long *p;
Signature · 1 line
1.8.3.1