linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] usemem: Remove the duplicate do_access
@ 2021-01-22  6:12 wufengguang
  0 siblings, 0 replies; 2+ messages in thread
From: wufengguang @ 2021-01-22  6:12 UTC (permalink / raw)
  To: Hui Zhu, linux-kernel; +Cc: Hui Zhu, wfg

Applied, thanks!

Sorry the mistake should be caused by manually fixing up mangled outlook patch.

Regards,
Fengguang

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] usemem: Remove the duplicate do_access
@ 2021-01-19  6:43 Hui Zhu
  0 siblings, 0 replies; 2+ messages in thread
From: Hui Zhu @ 2021-01-19  6:43 UTC (permalink / raw)
  To: wufengguang, linux-kernel; +Cc: Hui Zhu

From: Hui Zhu <teawaterz@linux.alibaba.com>

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.

Signed-off-by: Hui Zhu <teawaterz@linux.alibaba.com>
---
 usemem.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/usemem.c b/usemem.c
index 48c3d65..e2c46ec 100644
--- a/usemem.c
+++ b/usemem.c
@@ -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;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-22  6:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-22  6:12 [PATCH] usemem: Remove the duplicate do_access wufengguang
  -- strict thread matches above, loose matches on Subject: below --
2021-01-19  6:43 Hui Zhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).