All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH]Fix two functions of the same name
@ 2014-06-13 11:49 Lb peace
  2014-06-13 17:05 ` Stefan Weil
  0 siblings, 1 reply; 2+ messages in thread
From: Lb peace @ 2014-06-13 11:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: afaerber

[-- Attachment #1: Type: text/plain, Size: 1019 bytes --]

It is funny that we have two sigbus_handler in our QEMU.(exec.c &
cpus.c)Change one's name.

Signed-off-by: Peace <peacelb@gmail.com)>
---
 cpus.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpus.c b/cpus.c
index dd7ac13..2a429e5 100644
--- a/cpus.c
+++ b/cpus.c
@@ -583,7 +583,7 @@ static void sigbus_reraise(void)
     abort();
 }

-static void sigbus_handler(int n, struct qemu_signalfd_siginfo *siginfo,
+static void default_sigbus_handler(int n, struct qemu_signalfd_siginfo
*siginfo,
                            void *ctx)
 {
     if (kvm_on_sigbus(siginfo->ssi_code,
@@ -598,7 +598,7 @@ static void qemu_init_sigbus(void)

     memset(&action, 0, sizeof(action));
     action.sa_flags = SA_SIGINFO;
-    action.sa_sigaction = (void (*)(int, siginfo_t*, void*))sigbus_handler;
+    action.sa_sigaction = (void (*)(int, siginfo_t*,
void*))default_sigbus_handler;
     sigaction(SIGBUS, &action, NULL);

     prctl(PR_MCE_KILL, PR_MCE_KILL_SET, PR_MCE_KILL_EARLY, 0, 0);
-- 
1.7.2.5

[-- Attachment #2: Type: text/html, Size: 1501 bytes --]

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

* Re: [Qemu-devel] [PATCH]Fix two functions of the same name
  2014-06-13 11:49 [Qemu-devel] [PATCH]Fix two functions of the same name Lb peace
@ 2014-06-13 17:05 ` Stefan Weil
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Weil @ 2014-06-13 17:05 UTC (permalink / raw)
  To: Lb peace, qemu-devel; +Cc: afaerber

Am 13.06.2014 13:49, schrieb Lb peace:
> It is funny that we have two sigbus_handler in our QEMU.(exec.c &
> cpus.c)Change one's name.
> 
> Signed-off-by: Peace <peacelb@gmail.com)>
> ---
>  cpus.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 

Technically it does not matter whether two functions have the same name
as long as both are in different compilation units (*.c files) and have
only a local scope (that's what the 'static' keyword does).

There are even function names in QEMU code which occur three or more
times. Look for register_types, for example.

They do you think this should be changed? The only reason I see is that
setting breakpoints while debugging is a little bit more difficult.

Regards
Stefan

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

end of thread, other threads:[~2014-06-13 17:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-13 11:49 [Qemu-devel] [PATCH]Fix two functions of the same name Lb peace
2014-06-13 17:05 ` Stefan Weil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.