From: Hui Zhu <teawater@gmail.com>
To: wufengguang@huawei.com, linux-kernel@vger.kernel.org
Cc: Hui Zhu <teawaterz@linux.alibaba.com>
Subject: [PATCH] usemem: Remove the duplicate do_access
Date: Tue, 19 Jan 2021 14:43:13 +0800 [thread overview]
Message-ID: <20210119064313.21627-1-teawater@gmail.com> (raw)
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
next reply other threads:[~2021-01-19 6:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-19 6:43 Hui Zhu [this message]
2021-01-22 6:12 [PATCH] usemem: Remove the duplicate do_access wufengguang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210119064313.21627-1-teawater@gmail.com \
--to=teawater@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=teawaterz@linux.alibaba.com \
--cc=wufengguang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).