* [Qemu-devel] [PATCH 00/11] static patches
@ 2012-10-14 19:58 Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 01/11] target-sparc: make do_unaligned_access static Blue Swirl
` (12 more replies)
0 siblings, 13 replies; 25+ messages in thread
From: Blue Swirl @ 2012-10-14 19:58 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, blauwirbel
I made a small tool to detect unused functions and
variables. Here's some fixes.
Blue Swirl (11):
target-sparc: make do_unaligned_access static
vl.c: add missing static
vnc: add missing static and remove unused functions
tap-win32: avoid a warning
m48t59: remove unused m48t59_set_addr
sun4c: remove unused functions
slirp: remove unused function u_sleep
ppc: add missing static and remove unused functions
target-ppc: make some functions static
arm: add missing static and remove unused functions
exec: make some functions static
console.h | 2 -
cpu-common.h | 5 -
exec-all.h | 2 -
exec-obsolete.h | 4 -
exec.c | 19 ++-
hw/adb.c | 8 +-
hw/adb.h | 4 -
hw/devices.h | 3 -
hw/i2c.h | 3 -
hw/m48t59.c | 7 -
hw/mac_nvram.c | 24 ---
hw/nvram.h | 12 --
hw/omap.h | 1 -
hw/omap_gpmc.c | 21 ---
hw/pcmcia.h | 1 -
hw/ppc.c | 54 +-----
hw/ppc405.h | 6 -
hw/ppc405_uc.c | 342 -------------------------------------
hw/ppc_mac.h | 2 -
hw/pxa.h | 3 -
hw/pxa2xx.c | 4 +-
hw/pxa2xx_pcmcia.c | 21 ---
hw/soc_dma.c | 52 ------
hw/soc_dma.h | 16 +--
hw/sun4c_intctl.c | 23 ---
hw/sun4m.h | 4 -
hw/tc6393xb.c | 16 --
hw/tmp105.c | 16 --
linux-user/arm/nwfpe/fpa11.c | 4 +-
linux-user/arm/nwfpe/fpa11.h | 2 -
linux-user/arm/nwfpe/fpa11_cprt.c | 8 +-
net/tap-win32.c | 1 +
slirp/misc.c | 14 --
slirp/misc.h | 1 -
sysemu.h | 5 -
target-ppc/cpu.h | 9 -
target-ppc/mmu_helper.c | 11 +-
target-sparc/cpu.h | 3 -
target-sparc/ldst_helper.c | 8 +-
ui/vnc-jobs.c | 46 +-----
ui/vnc-jobs.h | 4 -
ui/vnc.c | 14 +-
ui/vnc.h | 5 -
vl.c | 33 ++---
44 files changed, 69 insertions(+), 774 deletions(-)
--
1.7.2.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [Qemu-devel] [PATCH 01/11] target-sparc: make do_unaligned_access static
2012-10-14 19:58 [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
@ 2012-10-14 19:58 ` Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 02/11] vl.c: add missing static Blue Swirl
` (11 subsequent siblings)
12 siblings, 0 replies; 25+ messages in thread
From: Blue Swirl @ 2012-10-14 19:58 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, blauwirbel
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
target-sparc/cpu.h | 3 ---
target-sparc/ldst_helper.c | 8 ++++++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h
index 214d01d..b4eda18 100644
--- a/target-sparc/cpu.h
+++ b/target-sparc/cpu.h
@@ -711,9 +711,6 @@ uint64_t cpu_tick_get_count(CPUTimer *timer);
void cpu_tick_set_limit(CPUTimer *timer, uint64_t limit);
trap_state* cpu_tsptr(CPUSPARCState* env);
#endif
-void QEMU_NORETURN do_unaligned_access(CPUSPARCState *env, target_ulong addr,
- int is_write, int is_user,
- uintptr_t retaddr);
void cpu_restore_state2(CPUSPARCState *env, uintptr_t retaddr);
#define TB_FLAG_FPU_ENABLED (1 << 4)
diff --git a/target-sparc/ldst_helper.c b/target-sparc/ldst_helper.c
index 2ca9a5c..795b0bd 100644
--- a/target-sparc/ldst_helper.c
+++ b/target-sparc/ldst_helper.c
@@ -65,6 +65,9 @@
#define QT1 (env->qt1)
#if !defined(CONFIG_USER_ONLY)
+static void QEMU_NORETURN do_unaligned_access(CPUSPARCState *env,
+ target_ulong addr, int is_write,
+ int is_user, uintptr_t retaddr);
#include "softmmu_exec.h"
#define MMUSUFFIX _mmu
#define ALIGNED_ONLY
@@ -2407,8 +2410,9 @@ void cpu_restore_state2(CPUSPARCState *env, uintptr_t retaddr)
}
#if !defined(CONFIG_USER_ONLY)
-void do_unaligned_access(CPUSPARCState *env, target_ulong addr, int is_write,
- int is_user, uintptr_t retaddr)
+static void QEMU_NORETURN do_unaligned_access(CPUSPARCState *env,
+ target_ulong addr, int is_write,
+ int is_user, uintptr_t retaddr)
{
#ifdef DEBUG_UNALIGNED
printf("Unaligned access to 0x" TARGET_FMT_lx " from 0x" TARGET_FMT_lx
--
1.7.2.5
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PATCH 02/11] vl.c: add missing static
2012-10-14 19:58 [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 01/11] target-sparc: make do_unaligned_access static Blue Swirl
@ 2012-10-14 19:58 ` Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 03/11] vnc: add missing static and remove unused functions Blue Swirl
` (10 subsequent siblings)
12 siblings, 0 replies; 25+ messages in thread
From: Blue Swirl @ 2012-10-14 19:58 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, blauwirbel, Anthony Liguori
Add missing 'static' qualifiers and remove unused
pcmcia_socket_unregister().
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
hw/pcmcia.h | 1 -
sysemu.h | 5 -----
vl.c | 33 ++++++++++++---------------------
3 files changed, 12 insertions(+), 27 deletions(-)
diff --git a/hw/pcmcia.h b/hw/pcmcia.h
index 50648c9..6b7aee5 100644
--- a/hw/pcmcia.h
+++ b/hw/pcmcia.h
@@ -10,7 +10,6 @@ typedef struct {
} PCMCIASocket;
void pcmcia_socket_register(PCMCIASocket *socket);
-void pcmcia_socket_unregister(PCMCIASocket *socket);
void pcmcia_info(Monitor *mon);
struct PCMCIACardState {
diff --git a/sysemu.h b/sysemu.h
index 0c39a3a..1683448 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -19,7 +19,6 @@ extern uint8_t qemu_uuid[];
int qemu_uuid_parse(const char *str, uint8_t *uuid);
#define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
-void runstate_init(void);
bool runstate_check(RunState state);
void runstate_set(RunState new_state);
int runstate_is_running(void);
@@ -57,11 +56,7 @@ void qemu_system_debug_request(void);
void qemu_system_vmstop_request(RunState reason);
int qemu_shutdown_requested_get(void);
int qemu_reset_requested_get(void);
-int qemu_shutdown_requested(void);
-int qemu_reset_requested(void);
-int qemu_powerdown_requested(void);
void qemu_system_killed(int signal, pid_t pid);
-void qemu_kill_report(void);
void qemu_devices_reset(void);
void qemu_system_reset(bool report);
diff --git a/vl.c b/vl.c
index 5b357a3..6cb87ac 100644
--- a/vl.c
+++ b/vl.c
@@ -180,7 +180,7 @@ static const char *data_dir;
const char *bios_name = NULL;
enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;
DisplayType display_type = DT_DEFAULT;
-int display_remote = 0;
+static int display_remote;
const char* keyboard_layout = NULL;
ram_addr_t ram_size;
const char *mem_path = NULL;
@@ -215,7 +215,7 @@ const char *vnc_display;
int acpi_enabled = 1;
int no_hpet = 0;
int fd_bootchk = 1;
-int no_reboot = 0;
+static int no_reboot;
int no_shutdown = 0;
int cursor_hide = 1;
int graphic_rotate = 0;
@@ -243,7 +243,8 @@ struct FWBootEntry {
char *suffix;
};
-QTAILQ_HEAD(, FWBootEntry) fw_boot_order = QTAILQ_HEAD_INITIALIZER(fw_boot_order);
+static QTAILQ_HEAD(, FWBootEntry) fw_boot_order =
+ QTAILQ_HEAD_INITIALIZER(fw_boot_order);
int nb_numa_nodes;
uint64_t node_mem[MAX_NODES];
@@ -397,7 +398,7 @@ bool runstate_check(RunState state)
return current_run_state == state;
}
-void runstate_init(void)
+static void runstate_init(void)
{
const RunStateTransition *p;
@@ -1170,18 +1171,6 @@ void pcmcia_socket_register(PCMCIASocket *socket)
pcmcia_sockets = entry;
}
-void pcmcia_socket_unregister(PCMCIASocket *socket)
-{
- struct pcmcia_socket_entry_s *entry, **ptr;
-
- ptr = &pcmcia_sockets;
- for (entry = *ptr; entry; ptr = &entry->next, entry = *ptr)
- if (entry->socket == socket) {
- *ptr = entry->next;
- g_free(entry);
- }
-}
-
void pcmcia_info(Monitor *mon)
{
struct pcmcia_socket_entry_s *iter;
@@ -1373,14 +1362,14 @@ int qemu_reset_requested_get(void)
return reset_requested;
}
-int qemu_shutdown_requested(void)
+static int qemu_shutdown_requested(void)
{
int r = shutdown_requested;
shutdown_requested = 0;
return r;
}
-void qemu_kill_report(void)
+static void qemu_kill_report(void)
{
if (!qtest_enabled() && shutdown_signal != -1) {
fprintf(stderr, "qemu: terminating on signal %d", shutdown_signal);
@@ -1396,7 +1385,7 @@ void qemu_kill_report(void)
}
}
-int qemu_reset_requested(void)
+static int qemu_reset_requested(void)
{
int r = reset_requested;
reset_requested = 0;
@@ -1417,7 +1406,7 @@ static int qemu_wakeup_requested(void)
return r;
}
-int qemu_powerdown_requested(void)
+static int qemu_powerdown_requested(void)
{
int r = powerdown_requested;
powerdown_requested = 0;
@@ -2043,7 +2032,9 @@ struct device_config {
Location loc;
QTAILQ_ENTRY(device_config) next;
};
-QTAILQ_HEAD(, device_config) device_configs = QTAILQ_HEAD_INITIALIZER(device_configs);
+
+static QTAILQ_HEAD(, device_config) device_configs =
+ QTAILQ_HEAD_INITIALIZER(device_configs);
static void add_device_config(int type, const char *cmdline)
{
--
1.7.2.5
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PATCH 03/11] vnc: add missing static and remove unused functions
2012-10-14 19:58 [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 01/11] target-sparc: make do_unaligned_access static Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 02/11] vl.c: add missing static Blue Swirl
@ 2012-10-14 19:58 ` Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 04/11] tap-win32: avoid a warning Blue Swirl
` (9 subsequent siblings)
12 siblings, 0 replies; 25+ messages in thread
From: Blue Swirl @ 2012-10-14 19:58 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, blauwirbel, Anthony Liguori
Add missing 'static' qualifiers. Remove unused functions
vnc_stop_worker_thread(), vnc_has_job() and vnc_jobs_clear().
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
console.h | 2 --
ui/vnc-jobs.c | 46 +++++-----------------------------------------
ui/vnc-jobs.h | 4 ----
ui/vnc.c | 14 +++++++-------
ui/vnc.h | 5 -----
5 files changed, 12 insertions(+), 59 deletions(-)
diff --git a/console.h b/console.h
index f990684..b848e20 100644
--- a/console.h
+++ b/console.h
@@ -377,10 +377,8 @@ void cocoa_display_init(DisplayState *ds, int full_screen);
/* vnc.c */
void vnc_display_init(DisplayState *ds);
-void vnc_display_close(DisplayState *ds);
int vnc_display_open(DisplayState *ds, const char *display);
void vnc_display_add_client(DisplayState *ds, int csock, int skipauth);
-int vnc_display_disable_login(DisplayState *ds);
char *vnc_display_local_addr(DisplayState *ds);
#ifdef CONFIG_VNC
int vnc_display_password(DisplayState *ds, const char *password);
diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c
index 087b84d..c779796 100644
--- a/ui/vnc-jobs.c
+++ b/ui/vnc-jobs.c
@@ -126,29 +126,6 @@ static bool vnc_has_job_locked(VncState *vs)
return false;
}
-bool vnc_has_job(VncState *vs)
-{
- bool ret;
-
- vnc_lock_queue(queue);
- ret = vnc_has_job_locked(vs);
- vnc_unlock_queue(queue);
- return ret;
-}
-
-void vnc_jobs_clear(VncState *vs)
-{
- VncJob *job, *tmp;
-
- vnc_lock_queue(queue);
- QTAILQ_FOREACH_SAFE(job, &queue->jobs, next, tmp) {
- if (job->vs == vs || !vs) {
- QTAILQ_REMOVE(&queue->jobs, job, next);
- }
- }
- vnc_unlock_queue(queue);
-}
-
void vnc_jobs_join(VncState *vs)
{
vnc_lock_queue(queue);
@@ -320,6 +297,11 @@ static void *vnc_worker_thread(void *arg)
return NULL;
}
+static bool vnc_worker_thread_running(void)
+{
+ return queue; /* Check global queue */
+}
+
void vnc_start_worker_thread(void)
{
VncJobQueue *q;
@@ -331,21 +313,3 @@ void vnc_start_worker_thread(void)
qemu_thread_create(&q->thread, vnc_worker_thread, q, QEMU_THREAD_DETACHED);
queue = q; /* Set global queue */
}
-
-bool vnc_worker_thread_running(void)
-{
- return queue; /* Check global queue */
-}
-
-void vnc_stop_worker_thread(void)
-{
- if (!vnc_worker_thread_running())
- return ;
-
- /* Remove all jobs and wake up the thread */
- vnc_lock_queue(queue);
- queue->exit = true;
- vnc_unlock_queue(queue);
- vnc_jobs_clear(NULL);
- qemu_cond_broadcast(&queue->cond);
-}
diff --git a/ui/vnc-jobs.h b/ui/vnc-jobs.h
index 86e6d88..59f66bc 100644
--- a/ui/vnc-jobs.h
+++ b/ui/vnc-jobs.h
@@ -34,14 +34,10 @@
VncJob *vnc_job_new(VncState *vs);
int vnc_job_add_rect(VncJob *job, int x, int y, int w, int h);
void vnc_job_push(VncJob *job);
-bool vnc_has_job(VncState *vs);
-void vnc_jobs_clear(VncState *vs);
void vnc_jobs_join(VncState *vs);
void vnc_jobs_consume_buffer(VncState *vs);
void vnc_start_worker_thread(void);
-bool vnc_worker_thread_running(void);
-void vnc_stop_worker_thread(void);
/* Locks */
static inline int vnc_trylock_display(VncDisplay *vd)
diff --git a/ui/vnc.c b/ui/vnc.c
index 33e6386..bde896b 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -479,12 +479,12 @@ void buffer_reserve(Buffer *buffer, size_t len)
}
}
-int buffer_empty(Buffer *buffer)
+static int buffer_empty(Buffer *buffer)
{
return buffer->offset == 0;
}
-uint8_t *buffer_end(Buffer *buffer)
+static uint8_t *buffer_end(Buffer *buffer)
{
return buffer->buffer + buffer->offset;
}
@@ -1376,17 +1376,17 @@ void vnc_flush(VncState *vs)
vnc_unlock_output(vs);
}
-uint8_t read_u8(uint8_t *data, size_t offset)
+static uint8_t read_u8(uint8_t *data, size_t offset)
{
return data[offset];
}
-uint16_t read_u16(uint8_t *data, size_t offset)
+static uint16_t read_u16(uint8_t *data, size_t offset)
{
return ((data[offset] & 0xFF) << 8) | (data[offset + 1] & 0xFF);
}
-int32_t read_s32(uint8_t *data, size_t offset)
+static int32_t read_s32(uint8_t *data, size_t offset)
{
return (int32_t)((data[offset] << 24) | (data[offset + 1] << 16) |
(data[offset + 2] << 8) | data[offset + 3]);
@@ -2761,7 +2761,7 @@ void vnc_display_init(DisplayState *ds)
}
-void vnc_display_close(DisplayState *ds)
+static void vnc_display_close(DisplayState *ds)
{
VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
@@ -2783,7 +2783,7 @@ void vnc_display_close(DisplayState *ds)
#endif
}
-int vnc_display_disable_login(DisplayState *ds)
+static int vnc_display_disable_login(DisplayState *ds)
{
VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
diff --git a/ui/vnc.h b/ui/vnc.h
index 068c2fc..c89f693 100644
--- a/ui/vnc.h
+++ b/ui/vnc.h
@@ -493,9 +493,6 @@ void vnc_read_when(VncState *vs, VncReadEvent *func, size_t expecting);
/* Buffer I/O functions */
-uint8_t read_u8(uint8_t *data, size_t offset);
-uint16_t read_u16(uint8_t *data, size_t offset);
-int32_t read_s32(uint8_t *data, size_t offset);
uint32_t read_u32(uint8_t *data, size_t offset);
/* Protocol stage functions */
@@ -507,8 +504,6 @@ void start_auth_vnc(VncState *vs);
/* Buffer management */
void buffer_reserve(Buffer *buffer, size_t len);
-int buffer_empty(Buffer *buffer);
-uint8_t *buffer_end(Buffer *buffer);
void buffer_reset(Buffer *buffer);
void buffer_free(Buffer *buffer);
void buffer_append(Buffer *buffer, const void *data, size_t len);
--
1.7.2.5
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PATCH 04/11] tap-win32: avoid a warning
2012-10-14 19:58 [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
` (2 preceding siblings ...)
2012-10-14 19:58 ` [Qemu-devel] [PATCH 03/11] vnc: add missing static and remove unused functions Blue Swirl
@ 2012-10-14 19:58 ` Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 05/11] m48t59: remove unused m48t59_set_addr Blue Swirl
` (8 subsequent siblings)
12 siblings, 0 replies; 25+ messages in thread
From: Blue Swirl @ 2012-10-14 19:58 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, blauwirbel, Anthony Liguori, Stefan Hajnoczi
Avoid a warning about missing declaration.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
net/tap-win32.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/tap-win32.c b/net/tap-win32.c
index f1801e2..7964b45 100644
--- a/net/tap-win32.c
+++ b/net/tap-win32.c
@@ -30,6 +30,7 @@
#include "qemu-common.h"
#include "net.h"
+#include "net/clients.h"
#include "sysemu.h"
#include "qemu-error.h"
#include <stdio.h>
--
1.7.2.5
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PATCH 05/11] m48t59: remove unused m48t59_set_addr
2012-10-14 19:58 [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
` (3 preceding siblings ...)
2012-10-14 19:58 ` [Qemu-devel] [PATCH 04/11] tap-win32: avoid a warning Blue Swirl
@ 2012-10-14 19:58 ` Blue Swirl
2012-10-15 0:04 ` Andreas Färber
2012-10-14 19:58 ` [Qemu-devel] [PATCH 06/11] sun4c: remove unused functions Blue Swirl
` (7 subsequent siblings)
12 siblings, 1 reply; 25+ messages in thread
From: Blue Swirl @ 2012-10-14 19:58 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, blauwirbel
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
hw/m48t59.c | 7 -------
hw/nvram.h | 1 -
2 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/hw/m48t59.c b/hw/m48t59.c
index dd6cb37..867bbda 100644
--- a/hw/m48t59.c
+++ b/hw/m48t59.c
@@ -466,13 +466,6 @@ uint32_t m48t59_read (void *opaque, uint32_t addr)
return retval;
}
-void m48t59_set_addr (void *opaque, uint32_t addr)
-{
- M48t59State *NVRAM = opaque;
-
- NVRAM->addr = addr;
-}
-
void m48t59_toggle_lock (void *opaque, int lock)
{
M48t59State *NVRAM = opaque;
diff --git a/hw/nvram.h b/hw/nvram.h
index 8924da4..b6953d5 100644
--- a/hw/nvram.h
+++ b/hw/nvram.h
@@ -38,6 +38,5 @@ M48t59State *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
int type);
M48t59State *m48t59_init(qemu_irq IRQ, target_phys_addr_t mem_base,
uint32_t io_base, uint16_t size, int type);
-void m48t59_set_addr (void *opaque, uint32_t addr);
#endif /* !NVRAM_H */
--
1.7.2.5
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PATCH 06/11] sun4c: remove unused functions
2012-10-14 19:58 [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
` (4 preceding siblings ...)
2012-10-14 19:58 ` [Qemu-devel] [PATCH 05/11] m48t59: remove unused m48t59_set_addr Blue Swirl
@ 2012-10-14 19:58 ` Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 07/11] slirp: remove unused function u_sleep Blue Swirl
` (6 subsequent siblings)
12 siblings, 0 replies; 25+ messages in thread
From: Blue Swirl @ 2012-10-14 19:58 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, blauwirbel
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
hw/sun4c_intctl.c | 23 -----------------------
hw/sun4m.h | 4 ----
2 files changed, 0 insertions(+), 27 deletions(-)
diff --git a/hw/sun4c_intctl.c b/hw/sun4c_intctl.c
index 8dfa5ec..09ef937 100644
--- a/hw/sun4c_intctl.c
+++ b/hw/sun4c_intctl.c
@@ -94,29 +94,6 @@ static const MemoryRegionOps sun4c_intctl_mem_ops = {
},
};
-void sun4c_pic_info(Monitor *mon, void *opaque)
-{
- Sun4c_INTCTLState *s = opaque;
-
- monitor_printf(mon, "master: pending 0x%2.2x, enabled 0x%2.2x\n",
- s->pending, s->reg);
-}
-
-void sun4c_irq_info(Monitor *mon, void *opaque)
-{
-#ifndef DEBUG_IRQ_COUNT
- monitor_printf(mon, "irq statistic code not compiled.\n");
-#else
- Sun4c_INTCTLState *s = opaque;
- int64_t count;
-
- monitor_printf(mon, "IRQ statistics:\n");
- count = s->irq_count;
- if (count > 0)
- monitor_printf(mon, " %" PRId64 "\n", count);
-#endif
-}
-
static const uint32_t intbit_to_level[] = { 0, 1, 4, 6, 8, 10, 0, 14, };
static void sun4c_check_interrupts(void *opaque)
diff --git a/hw/sun4m.h b/hw/sun4m.h
index 504c3af..a7b7ac7 100644
--- a/hw/sun4m.h
+++ b/hw/sun4m.h
@@ -26,10 +26,6 @@ static inline void sparc_iommu_memory_write(void *opaque,
void slavio_pic_info(Monitor *mon, DeviceState *dev);
void slavio_irq_info(Monitor *mon, DeviceState *dev);
-/* sun4c_intctl.c */
-void sun4c_pic_info(Monitor *mon, void *opaque);
-void sun4c_irq_info(Monitor *mon, void *opaque);
-
/* sun4m.c */
void sun4m_pic_info(Monitor *mon);
void sun4m_irq_info(Monitor *mon);
--
1.7.2.5
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PATCH 07/11] slirp: remove unused function u_sleep
2012-10-14 19:58 [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
` (5 preceding siblings ...)
2012-10-14 19:58 ` [Qemu-devel] [PATCH 06/11] sun4c: remove unused functions Blue Swirl
@ 2012-10-14 19:58 ` Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 08/11] ppc: add missing static and remove unused functions Blue Swirl
` (5 subsequent siblings)
12 siblings, 0 replies; 25+ messages in thread
From: Blue Swirl @ 2012-10-14 19:58 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, blauwirbel, Jan Kiszka
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
slirp/misc.c | 14 --------------
slirp/misc.h | 1 -
2 files changed, 0 insertions(+), 15 deletions(-)
diff --git a/slirp/misc.c b/slirp/misc.c
index 0bee864..664532a 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -253,20 +253,6 @@ void lprint(const char *format, ...)
va_end(args);
}
-void
-u_sleep(int usec)
-{
- struct timeval t;
- fd_set fdset;
-
- FD_ZERO(&fdset);
-
- t.tv_sec = 0;
- t.tv_usec = usec * 1000;
-
- select(0, &fdset, &fdset, &fdset, &t);
-}
-
void slirp_connection_info(Slirp *slirp, Monitor *mon)
{
const char * const tcpstates[] = {
diff --git a/slirp/misc.h b/slirp/misc.h
index ed40a10..cc36aeb 100644
--- a/slirp/misc.h
+++ b/slirp/misc.h
@@ -64,7 +64,6 @@ void snooze_hup(int);
void snooze(void);
void relay(int);
void add_emu(char *);
-void u_sleep(int);
void fd_nonblock(int);
void fd_block(int);
int rsh_exec(struct socket *, struct socket *, char *, char *, char *);
--
1.7.2.5
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PATCH 08/11] ppc: add missing static and remove unused functions
2012-10-14 19:58 [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
` (6 preceding siblings ...)
2012-10-14 19:58 ` [Qemu-devel] [PATCH 07/11] slirp: remove unused function u_sleep Blue Swirl
@ 2012-10-14 19:58 ` Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 09/11] target-ppc: make some functions static Blue Swirl
` (4 subsequent siblings)
12 siblings, 0 replies; 25+ messages in thread
From: Blue Swirl @ 2012-10-14 19:58 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, blauwirbel, qemu-ppc, Alexander Graf
Add missing 'static' qualifiers and remove unused functions.
This removes 405cr model entirely but it was not accessible
before.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
hw/adb.c | 8 +-
hw/adb.h | 4 -
hw/mac_nvram.c | 24 ----
hw/nvram.h | 11 --
hw/ppc.c | 54 ++-------
hw/ppc405.h | 6 -
hw/ppc405_uc.c | 342 ------------------------------------------------------
hw/ppc_mac.h | 2 -
target-ppc/cpu.h | 3 -
9 files changed, 12 insertions(+), 442 deletions(-)
diff --git a/hw/adb.c b/hw/adb.c
index aa15f55..3b547f0 100644
--- a/hw/adb.c
+++ b/hw/adb.c
@@ -108,10 +108,10 @@ int adb_poll(ADBBusState *s, uint8_t *obuf)
return olen;
}
-ADBDevice *adb_register_device(ADBBusState *s, int devaddr,
- ADBDeviceRequest *devreq,
- ADBDeviceReset *devreset,
- void *opaque)
+static ADBDevice *adb_register_device(ADBBusState *s, int devaddr,
+ ADBDeviceRequest *devreq,
+ ADBDeviceReset *devreset,
+ void *opaque)
{
ADBDevice *d;
if (s->nb_devices >= MAX_ADB_DEVICES)
diff --git a/hw/adb.h b/hw/adb.h
index b2a591c..5b27da2 100644
--- a/hw/adb.h
+++ b/hw/adb.h
@@ -56,10 +56,6 @@ int adb_request(ADBBusState *s, uint8_t *buf_out,
const uint8_t *buf, int len);
int adb_poll(ADBBusState *s, uint8_t *buf_out);
-ADBDevice *adb_register_device(ADBBusState *s, int devaddr,
- ADBDeviceRequest *devreq,
- ADBDeviceReset *devreset,
- void *opaque);
void adb_kbd_init(ADBBusState *bus);
void adb_mouse_init(ADBBusState *bus);
diff --git a/hw/mac_nvram.c b/hw/mac_nvram.c
index ed0a2b7..75f8162 100644
--- a/hw/mac_nvram.c
+++ b/hw/mac_nvram.c
@@ -46,30 +46,6 @@ struct MacIONVRAMState {
#define DEF_SYSTEM_SIZE 0xc10
-/* Direct access to NVRAM */
-uint32_t macio_nvram_read (void *opaque, uint32_t addr)
-{
- MacIONVRAMState *s = opaque;
- uint32_t ret;
-
- if (addr < s->size)
- ret = s->data[addr];
- else
- ret = -1;
- NVR_DPRINTF("read addr %04x val %x\n", addr, ret);
-
- return ret;
-}
-
-void macio_nvram_write (void *opaque, uint32_t addr, uint32_t val)
-{
- MacIONVRAMState *s = opaque;
-
- NVR_DPRINTF("write addr %04x val %x\n", addr, val);
- if (addr < s->size)
- s->data[addr] = val;
-}
-
/* macio style NVRAM device */
static void macio_nvram_writeb(void *opaque, target_phys_addr_t addr,
uint64_t value, unsigned size)
diff --git a/hw/nvram.h b/hw/nvram.h
index b6953d5..67c464d 100644
--- a/hw/nvram.h
+++ b/hw/nvram.h
@@ -10,17 +10,6 @@ typedef struct nvram_t {
nvram_write_t write_fn;
} nvram_t;
-void NVRAM_set_byte (nvram_t *nvram, uint32_t addr, uint8_t value);
-uint8_t NVRAM_get_byte (nvram_t *nvram, uint32_t addr);
-void NVRAM_set_word (nvram_t *nvram, uint32_t addr, uint16_t value);
-uint16_t NVRAM_get_word (nvram_t *nvram, uint32_t addr);
-void NVRAM_set_lword (nvram_t *nvram, uint32_t addr, uint32_t value);
-uint32_t NVRAM_get_lword (nvram_t *nvram, uint32_t addr);
-void NVRAM_set_string (nvram_t *nvram, uint32_t addr,
- const char *str, uint32_t max);
-int NVRAM_get_string (nvram_t *nvram, uint8_t *dst, uint16_t addr, int max);
-void NVRAM_set_crc (nvram_t *nvram, uint32_t addr,
- uint32_t start, uint32_t count);
int PPC_NVRAM_set_params (nvram_t *nvram, uint16_t NVRAM_size,
const char *arch,
uint32_t RAM_size, int boot_device,
diff --git a/hw/ppc.c b/hw/ppc.c
index 98546de..dd4949e 100644
--- a/hw/ppc.c
+++ b/hw/ppc.c
@@ -608,13 +608,6 @@ uint32_t cpu_ppc_load_decr (CPUPPCState *env)
return _cpu_ppc_load_decr(env, tb_env->decr_next);
}
-uint32_t cpu_ppc_load_hdecr (CPUPPCState *env)
-{
- ppc_tb_t *tb_env = env->tb_env;
-
- return _cpu_ppc_load_decr(env, tb_env->hdecr_next);
-}
-
uint64_t cpu_ppc_load_purr (CPUPPCState *env)
{
ppc_tb_t *tb_env = env->tb_env;
@@ -711,17 +704,12 @@ static inline void _cpu_ppc_store_hdecr(CPUPPCState *env, uint32_t hdecr,
}
}
-void cpu_ppc_store_hdecr (CPUPPCState *env, uint32_t value)
-{
- _cpu_ppc_store_hdecr(env, cpu_ppc_load_hdecr(env), value, 0);
-}
-
static void cpu_ppc_hdecr_cb (void *opaque)
{
_cpu_ppc_store_hdecr(opaque, 0x00000000, 0xFFFFFFFF, 1);
}
-void cpu_ppc_store_purr (CPUPPCState *env, uint64_t value)
+static void cpu_ppc_store_purr(CPUPPCState *env, uint64_t value)
{
ppc_tb_t *tb_env = env->tb_env;
@@ -1152,23 +1140,23 @@ static inline void nvram_write (nvram_t *nvram, uint32_t addr, uint32_t val)
(*nvram->write_fn)(nvram->opaque, addr, val);
}
-void NVRAM_set_byte (nvram_t *nvram, uint32_t addr, uint8_t value)
+static void NVRAM_set_byte(nvram_t *nvram, uint32_t addr, uint8_t value)
{
nvram_write(nvram, addr, value);
}
-uint8_t NVRAM_get_byte (nvram_t *nvram, uint32_t addr)
+static uint8_t NVRAM_get_byte(nvram_t *nvram, uint32_t addr)
{
return nvram_read(nvram, addr);
}
-void NVRAM_set_word (nvram_t *nvram, uint32_t addr, uint16_t value)
+static void NVRAM_set_word(nvram_t *nvram, uint32_t addr, uint16_t value)
{
nvram_write(nvram, addr, value >> 8);
nvram_write(nvram, addr + 1, value & 0xFF);
}
-uint16_t NVRAM_get_word (nvram_t *nvram, uint32_t addr)
+static uint16_t NVRAM_get_word(nvram_t *nvram, uint32_t addr)
{
uint16_t tmp;
@@ -1178,7 +1166,7 @@ uint16_t NVRAM_get_word (nvram_t *nvram, uint32_t addr)
return tmp;
}
-void NVRAM_set_lword (nvram_t *nvram, uint32_t addr, uint32_t value)
+static void NVRAM_set_lword(nvram_t *nvram, uint32_t addr, uint32_t value)
{
nvram_write(nvram, addr, value >> 24);
nvram_write(nvram, addr + 1, (value >> 16) & 0xFF);
@@ -1186,20 +1174,8 @@ void NVRAM_set_lword (nvram_t *nvram, uint32_t addr, uint32_t value)
nvram_write(nvram, addr + 3, value & 0xFF);
}
-uint32_t NVRAM_get_lword (nvram_t *nvram, uint32_t addr)
-{
- uint32_t tmp;
-
- tmp = nvram_read(nvram, addr) << 24;
- tmp |= nvram_read(nvram, addr + 1) << 16;
- tmp |= nvram_read(nvram, addr + 2) << 8;
- tmp |= nvram_read(nvram, addr + 3);
-
- return tmp;
-}
-
-void NVRAM_set_string (nvram_t *nvram, uint32_t addr,
- const char *str, uint32_t max)
+static void NVRAM_set_string(nvram_t *nvram, uint32_t addr, const char *str,
+ uint32_t max)
{
int i;
@@ -1210,20 +1186,6 @@ void NVRAM_set_string (nvram_t *nvram, uint32_t addr,
nvram_write(nvram, addr + max - 1, '\0');
}
-int NVRAM_get_string (nvram_t *nvram, uint8_t *dst, uint16_t addr, int max)
-{
- int i;
-
- memset(dst, 0, max);
- for (i = 0; i < max; i++) {
- dst[i] = NVRAM_get_byte(nvram, addr + i);
- if (dst[i] == '\0')
- break;
- }
-
- return i;
-}
-
static uint16_t NVRAM_crc_update (uint16_t prev, uint16_t value)
{
uint16_t tmp;
diff --git a/hw/ppc405.h b/hw/ppc405.h
index 1f5dc5f..54f0e00 100644
--- a/hw/ppc405.h
+++ b/hw/ppc405.h
@@ -59,12 +59,6 @@ struct ppc4xx_bd_info_t {
ram_addr_t ppc405_set_bootinfo (CPUPPCState *env, ppc4xx_bd_info_t *bd,
uint32_t flags);
-CPUPPCState *ppc405cr_init(MemoryRegion *address_space_mem,
- MemoryRegion ram_memories[4],
- target_phys_addr_t ram_bases[4],
- target_phys_addr_t ram_sizes[4],
- uint32_t sysclk, qemu_irq **picp,
- int do_init);
CPUPPCState *ppc405ep_init(MemoryRegion *address_space_mem,
MemoryRegion ram_memories[2],
target_phys_addr_t ram_bases[2],
diff --git a/hw/ppc405_uc.c b/hw/ppc405_uc.c
index b52ab2f..a30ac7a 100644
--- a/hw/ppc405_uc.c
+++ b/hw/ppc405_uc.c
@@ -1823,348 +1823,6 @@ void store_40x_dbcr0 (CPUPPCState *env, uint32_t val)
}
/*****************************************************************************/
-/* PowerPC 405CR */
-enum {
- PPC405CR_CPC0_PLLMR = 0x0B0,
- PPC405CR_CPC0_CR0 = 0x0B1,
- PPC405CR_CPC0_CR1 = 0x0B2,
- PPC405CR_CPC0_PSR = 0x0B4,
- PPC405CR_CPC0_JTAGID = 0x0B5,
- PPC405CR_CPC0_ER = 0x0B9,
- PPC405CR_CPC0_FR = 0x0BA,
- PPC405CR_CPC0_SR = 0x0BB,
-};
-
-enum {
- PPC405CR_CPU_CLK = 0,
- PPC405CR_TMR_CLK = 1,
- PPC405CR_PLB_CLK = 2,
- PPC405CR_SDRAM_CLK = 3,
- PPC405CR_OPB_CLK = 4,
- PPC405CR_EXT_CLK = 5,
- PPC405CR_UART_CLK = 6,
- PPC405CR_CLK_NB = 7,
-};
-
-typedef struct ppc405cr_cpc_t ppc405cr_cpc_t;
-struct ppc405cr_cpc_t {
- clk_setup_t clk_setup[PPC405CR_CLK_NB];
- uint32_t sysclk;
- uint32_t psr;
- uint32_t cr0;
- uint32_t cr1;
- uint32_t jtagid;
- uint32_t pllmr;
- uint32_t er;
- uint32_t fr;
-};
-
-static void ppc405cr_clk_setup (ppc405cr_cpc_t *cpc)
-{
- uint64_t VCO_out, PLL_out;
- uint32_t CPU_clk, TMR_clk, SDRAM_clk, PLB_clk, OPB_clk, EXT_clk, UART_clk;
- int M, D0, D1, D2;
-
- D0 = ((cpc->pllmr >> 26) & 0x3) + 1; /* CBDV */
- if (cpc->pllmr & 0x80000000) {
- D1 = (((cpc->pllmr >> 20) - 1) & 0xF) + 1; /* FBDV */
- D2 = 8 - ((cpc->pllmr >> 16) & 0x7); /* FWDVA */
- M = D0 * D1 * D2;
- VCO_out = cpc->sysclk * M;
- if (VCO_out < 400000000 || VCO_out > 800000000) {
- /* PLL cannot lock */
- cpc->pllmr &= ~0x80000000;
- goto bypass_pll;
- }
- PLL_out = VCO_out / D2;
- } else {
- /* Bypass PLL */
- bypass_pll:
- M = D0;
- PLL_out = cpc->sysclk * M;
- }
- CPU_clk = PLL_out;
- if (cpc->cr1 & 0x00800000)
- TMR_clk = cpc->sysclk; /* Should have a separate clock */
- else
- TMR_clk = CPU_clk;
- PLB_clk = CPU_clk / D0;
- SDRAM_clk = PLB_clk;
- D0 = ((cpc->pllmr >> 10) & 0x3) + 1;
- OPB_clk = PLB_clk / D0;
- D0 = ((cpc->pllmr >> 24) & 0x3) + 2;
- EXT_clk = PLB_clk / D0;
- D0 = ((cpc->cr0 >> 1) & 0x1F) + 1;
- UART_clk = CPU_clk / D0;
- /* Setup CPU clocks */
- clk_setup(&cpc->clk_setup[PPC405CR_CPU_CLK], CPU_clk);
- /* Setup time-base clock */
- clk_setup(&cpc->clk_setup[PPC405CR_TMR_CLK], TMR_clk);
- /* Setup PLB clock */
- clk_setup(&cpc->clk_setup[PPC405CR_PLB_CLK], PLB_clk);
- /* Setup SDRAM clock */
- clk_setup(&cpc->clk_setup[PPC405CR_SDRAM_CLK], SDRAM_clk);
- /* Setup OPB clock */
- clk_setup(&cpc->clk_setup[PPC405CR_OPB_CLK], OPB_clk);
- /* Setup external clock */
- clk_setup(&cpc->clk_setup[PPC405CR_EXT_CLK], EXT_clk);
- /* Setup UART clock */
- clk_setup(&cpc->clk_setup[PPC405CR_UART_CLK], UART_clk);
-}
-
-static uint32_t dcr_read_crcpc (void *opaque, int dcrn)
-{
- ppc405cr_cpc_t *cpc;
- uint32_t ret;
-
- cpc = opaque;
- switch (dcrn) {
- case PPC405CR_CPC0_PLLMR:
- ret = cpc->pllmr;
- break;
- case PPC405CR_CPC0_CR0:
- ret = cpc->cr0;
- break;
- case PPC405CR_CPC0_CR1:
- ret = cpc->cr1;
- break;
- case PPC405CR_CPC0_PSR:
- ret = cpc->psr;
- break;
- case PPC405CR_CPC0_JTAGID:
- ret = cpc->jtagid;
- break;
- case PPC405CR_CPC0_ER:
- ret = cpc->er;
- break;
- case PPC405CR_CPC0_FR:
- ret = cpc->fr;
- break;
- case PPC405CR_CPC0_SR:
- ret = ~(cpc->er | cpc->fr) & 0xFFFF0000;
- break;
- default:
- /* Avoid gcc warning */
- ret = 0;
- break;
- }
-
- return ret;
-}
-
-static void dcr_write_crcpc (void *opaque, int dcrn, uint32_t val)
-{
- ppc405cr_cpc_t *cpc;
-
- cpc = opaque;
- switch (dcrn) {
- case PPC405CR_CPC0_PLLMR:
- cpc->pllmr = val & 0xFFF77C3F;
- break;
- case PPC405CR_CPC0_CR0:
- cpc->cr0 = val & 0x0FFFFFFE;
- break;
- case PPC405CR_CPC0_CR1:
- cpc->cr1 = val & 0x00800000;
- break;
- case PPC405CR_CPC0_PSR:
- /* Read-only */
- break;
- case PPC405CR_CPC0_JTAGID:
- /* Read-only */
- break;
- case PPC405CR_CPC0_ER:
- cpc->er = val & 0xBFFC0000;
- break;
- case PPC405CR_CPC0_FR:
- cpc->fr = val & 0xBFFC0000;
- break;
- case PPC405CR_CPC0_SR:
- /* Read-only */
- break;
- }
-}
-
-static void ppc405cr_cpc_reset (void *opaque)
-{
- ppc405cr_cpc_t *cpc;
- int D;
-
- cpc = opaque;
- /* Compute PLLMR value from PSR settings */
- cpc->pllmr = 0x80000000;
- /* PFWD */
- switch ((cpc->psr >> 30) & 3) {
- case 0:
- /* Bypass */
- cpc->pllmr &= ~0x80000000;
- break;
- case 1:
- /* Divide by 3 */
- cpc->pllmr |= 5 << 16;
- break;
- case 2:
- /* Divide by 4 */
- cpc->pllmr |= 4 << 16;
- break;
- case 3:
- /* Divide by 6 */
- cpc->pllmr |= 2 << 16;
- break;
- }
- /* PFBD */
- D = (cpc->psr >> 28) & 3;
- cpc->pllmr |= (D + 1) << 20;
- /* PT */
- D = (cpc->psr >> 25) & 7;
- switch (D) {
- case 0x2:
- cpc->pllmr |= 0x13;
- break;
- case 0x4:
- cpc->pllmr |= 0x15;
- break;
- case 0x5:
- cpc->pllmr |= 0x16;
- break;
- default:
- break;
- }
- /* PDC */
- D = (cpc->psr >> 23) & 3;
- cpc->pllmr |= D << 26;
- /* ODP */
- D = (cpc->psr >> 21) & 3;
- cpc->pllmr |= D << 10;
- /* EBPD */
- D = (cpc->psr >> 17) & 3;
- cpc->pllmr |= D << 24;
- cpc->cr0 = 0x0000003C;
- cpc->cr1 = 0x2B0D8800;
- cpc->er = 0x00000000;
- cpc->fr = 0x00000000;
- ppc405cr_clk_setup(cpc);
-}
-
-static void ppc405cr_clk_init (ppc405cr_cpc_t *cpc)
-{
- int D;
-
- /* XXX: this should be read from IO pins */
- cpc->psr = 0x00000000; /* 8 bits ROM */
- /* PFWD */
- D = 0x2; /* Divide by 4 */
- cpc->psr |= D << 30;
- /* PFBD */
- D = 0x1; /* Divide by 2 */
- cpc->psr |= D << 28;
- /* PDC */
- D = 0x1; /* Divide by 2 */
- cpc->psr |= D << 23;
- /* PT */
- D = 0x5; /* M = 16 */
- cpc->psr |= D << 25;
- /* ODP */
- D = 0x1; /* Divide by 2 */
- cpc->psr |= D << 21;
- /* EBDP */
- D = 0x2; /* Divide by 4 */
- cpc->psr |= D << 17;
-}
-
-static void ppc405cr_cpc_init (CPUPPCState *env, clk_setup_t clk_setup[7],
- uint32_t sysclk)
-{
- ppc405cr_cpc_t *cpc;
-
- cpc = g_malloc0(sizeof(ppc405cr_cpc_t));
- memcpy(cpc->clk_setup, clk_setup,
- PPC405CR_CLK_NB * sizeof(clk_setup_t));
- cpc->sysclk = sysclk;
- cpc->jtagid = 0x42051049;
- ppc_dcr_register(env, PPC405CR_CPC0_PSR, cpc,
- &dcr_read_crcpc, &dcr_write_crcpc);
- ppc_dcr_register(env, PPC405CR_CPC0_CR0, cpc,
- &dcr_read_crcpc, &dcr_write_crcpc);
- ppc_dcr_register(env, PPC405CR_CPC0_CR1, cpc,
- &dcr_read_crcpc, &dcr_write_crcpc);
- ppc_dcr_register(env, PPC405CR_CPC0_JTAGID, cpc,
- &dcr_read_crcpc, &dcr_write_crcpc);
- ppc_dcr_register(env, PPC405CR_CPC0_PLLMR, cpc,
- &dcr_read_crcpc, &dcr_write_crcpc);
- ppc_dcr_register(env, PPC405CR_CPC0_ER, cpc,
- &dcr_read_crcpc, &dcr_write_crcpc);
- ppc_dcr_register(env, PPC405CR_CPC0_FR, cpc,
- &dcr_read_crcpc, &dcr_write_crcpc);
- ppc_dcr_register(env, PPC405CR_CPC0_SR, cpc,
- &dcr_read_crcpc, &dcr_write_crcpc);
- ppc405cr_clk_init(cpc);
- qemu_register_reset(ppc405cr_cpc_reset, cpc);
-}
-
-CPUPPCState *ppc405cr_init(MemoryRegion *address_space_mem,
- MemoryRegion ram_memories[4],
- target_phys_addr_t ram_bases[4],
- target_phys_addr_t ram_sizes[4],
- uint32_t sysclk, qemu_irq **picp,
- int do_init)
-{
- clk_setup_t clk_setup[PPC405CR_CLK_NB];
- qemu_irq dma_irqs[4];
- CPUPPCState *env;
- qemu_irq *pic, *irqs;
-
- memset(clk_setup, 0, sizeof(clk_setup));
- env = ppc4xx_init("405cr", &clk_setup[PPC405CR_CPU_CLK],
- &clk_setup[PPC405CR_TMR_CLK], sysclk);
- /* Memory mapped devices registers */
- /* PLB arbitrer */
- ppc4xx_plb_init(env);
- /* PLB to OPB bridge */
- ppc4xx_pob_init(env);
- /* OBP arbitrer */
- ppc4xx_opba_init(0xef600600);
- /* Universal interrupt controller */
- irqs = g_malloc0(sizeof(qemu_irq) * PPCUIC_OUTPUT_NB);
- irqs[PPCUIC_OUTPUT_INT] =
- ((qemu_irq *)env->irq_inputs)[PPC40x_INPUT_INT];
- irqs[PPCUIC_OUTPUT_CINT] =
- ((qemu_irq *)env->irq_inputs)[PPC40x_INPUT_CINT];
- pic = ppcuic_init(env, irqs, 0x0C0, 0, 1);
- *picp = pic;
- /* SDRAM controller */
- ppc4xx_sdram_init(env, pic[14], 1, ram_memories,
- ram_bases, ram_sizes, do_init);
- /* External bus controller */
- ppc405_ebc_init(env);
- /* DMA controller */
- dma_irqs[0] = pic[26];
- dma_irqs[1] = pic[25];
- dma_irqs[2] = pic[24];
- dma_irqs[3] = pic[23];
- ppc405_dma_init(env, dma_irqs);
- /* Serial ports */
- if (serial_hds[0] != NULL) {
- serial_mm_init(address_space_mem, 0xef600300, 0, pic[0],
- PPC_SERIAL_MM_BAUDBASE, serial_hds[0],
- DEVICE_BIG_ENDIAN);
- }
- if (serial_hds[1] != NULL) {
- serial_mm_init(address_space_mem, 0xef600400, 0, pic[1],
- PPC_SERIAL_MM_BAUDBASE, serial_hds[1],
- DEVICE_BIG_ENDIAN);
- }
- /* IIC controller */
- ppc405_i2c_init(0xef600500, pic[2]);
- /* GPIO */
- ppc405_gpio_init(0xef600700);
- /* CPU control */
- ppc405cr_cpc_init(env, clk_setup, sysclk);
-
- return env;
-}
-
-/*****************************************************************************/
/* PowerPC 405EP */
/* CPU control */
enum {
diff --git a/hw/ppc_mac.h b/hw/ppc_mac.h
index 7d08418..46adecc 100644
--- a/hw/ppc_mac.h
+++ b/hw/ppc_mac.h
@@ -76,6 +76,4 @@ MacIONVRAMState *macio_nvram_init (target_phys_addr_t size,
void macio_nvram_setup_bar(MacIONVRAMState *s, MemoryRegion *bar,
target_phys_addr_t mem_base);
void pmac_format_nvram_partition (MacIONVRAMState *nvr, int len);
-uint32_t macio_nvram_read (void *opaque, uint32_t addr);
-void macio_nvram_write (void *opaque, uint32_t addr, uint32_t val);
#endif /* !defined(__PPC_MAC_H__) */
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index faf4404..d3ada54 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -1175,10 +1175,7 @@ void cpu_ppc_store_atbl (CPUPPCState *env, uint32_t value);
void cpu_ppc_store_atbu (CPUPPCState *env, uint32_t value);
uint32_t cpu_ppc_load_decr (CPUPPCState *env);
void cpu_ppc_store_decr (CPUPPCState *env, uint32_t value);
-uint32_t cpu_ppc_load_hdecr (CPUPPCState *env);
-void cpu_ppc_store_hdecr (CPUPPCState *env, uint32_t value);
uint64_t cpu_ppc_load_purr (CPUPPCState *env);
-void cpu_ppc_store_purr (CPUPPCState *env, uint64_t value);
uint32_t cpu_ppc601_load_rtcl (CPUPPCState *env);
uint32_t cpu_ppc601_load_rtcu (CPUPPCState *env);
#if !defined(CONFIG_USER_ONLY)
--
1.7.2.5
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PATCH 09/11] target-ppc: make some functions static
2012-10-14 19:58 [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
` (7 preceding siblings ...)
2012-10-14 19:58 ` [Qemu-devel] [PATCH 08/11] ppc: add missing static and remove unused functions Blue Swirl
@ 2012-10-14 19:58 ` Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 10/11] arm: add missing static and remove unused functions Blue Swirl
` (3 subsequent siblings)
12 siblings, 0 replies; 25+ messages in thread
From: Blue Swirl @ 2012-10-14 19:58 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, blauwirbel, qemu-ppc, Alexander Graf
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
target-ppc/cpu.h | 6 ------
target-ppc/mmu_helper.c | 11 ++++++-----
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index d3ada54..ab88b33 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -1141,10 +1141,6 @@ int cpu_ppc_signal_handler (int host_signum, void *pinfo,
int cpu_ppc_handle_mmu_fault (CPUPPCState *env, target_ulong address, int rw,
int mmu_idx);
#define cpu_handle_mmu_fault cpu_ppc_handle_mmu_fault
-#if !defined(CONFIG_USER_ONLY)
-int get_physical_address (CPUPPCState *env, mmu_ctx_t *ctx, target_ulong vaddr,
- int rw, int access_type);
-#endif
void do_interrupt (CPUPPCState *env);
void ppc_hw_interrupt (CPUPPCState *env);
@@ -1187,8 +1183,6 @@ void store_40x_dbcr0 (CPUPPCState *env, uint32_t val);
void store_40x_sler (CPUPPCState *env, uint32_t val);
void store_booke_tcr (CPUPPCState *env, target_ulong val);
void store_booke_tsr (CPUPPCState *env, target_ulong val);
-void booke206_flush_tlb(CPUPPCState *env, int flags, const int check_iprot);
-target_phys_addr_t booke206_tlb_to_page_size(CPUPPCState *env, ppcmas_tlb_t *tlb);
int ppcmas_tlb_check(CPUPPCState *env, ppcmas_tlb_t *tlb,
target_phys_addr_t *raddrp, target_ulong address,
uint32_t pid);
diff --git a/target-ppc/mmu_helper.c b/target-ppc/mmu_helper.c
index 532b114..d4a8dcf 100644
--- a/target-ppc/mmu_helper.c
+++ b/target-ppc/mmu_helper.c
@@ -1276,7 +1276,8 @@ static int mmubooke_get_physical_address(CPUPPCState *env, mmu_ctx_t *ctx,
return ret;
}
-void booke206_flush_tlb(CPUPPCState *env, int flags, const int check_iprot)
+static void booke206_flush_tlb(CPUPPCState *env, int flags,
+ const int check_iprot)
{
int tlb_size;
int i, j;
@@ -1297,8 +1298,8 @@ void booke206_flush_tlb(CPUPPCState *env, int flags, const int check_iprot)
tlb_flush(env, 1);
}
-target_phys_addr_t booke206_tlb_to_page_size(CPUPPCState *env,
- ppcmas_tlb_t *tlb)
+static target_phys_addr_t booke206_tlb_to_page_size(CPUPPCState *env,
+ ppcmas_tlb_t *tlb)
{
int tlbm_size;
@@ -1708,8 +1709,8 @@ static inline int check_physical(CPUPPCState *env, mmu_ctx_t *ctx,
return ret;
}
-int get_physical_address(CPUPPCState *env, mmu_ctx_t *ctx, target_ulong eaddr,
- int rw, int access_type)
+static int get_physical_address(CPUPPCState *env, mmu_ctx_t *ctx,
+ target_ulong eaddr, int rw, int access_type)
{
int ret;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PATCH 10/11] arm: add missing static and remove unused functions
2012-10-14 19:58 [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
` (8 preceding siblings ...)
2012-10-14 19:58 ` [Qemu-devel] [PATCH 09/11] target-ppc: make some functions static Blue Swirl
@ 2012-10-14 19:58 ` Blue Swirl
2012-10-14 20:09 ` Peter Maydell
2012-10-14 19:58 ` [Qemu-devel] [PATCH 11/11] exec: make some functions static Blue Swirl
` (2 subsequent siblings)
12 siblings, 1 reply; 25+ messages in thread
From: Blue Swirl @ 2012-10-14 19:58 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, blauwirbel, Riku Voipio, Peter Maydell
Add missing 'static' qualifiers and remove unused functions.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
hw/devices.h | 3 --
hw/i2c.h | 3 --
hw/omap.h | 1 -
hw/omap_gpmc.c | 21 ---------------
hw/pxa.h | 3 --
hw/pxa2xx.c | 4 +-
hw/pxa2xx_pcmcia.c | 21 ---------------
hw/soc_dma.c | 52 -------------------------------------
hw/soc_dma.h | 16 +----------
hw/tc6393xb.c | 16 -----------
hw/tmp105.c | 16 -----------
linux-user/arm/nwfpe/fpa11.c | 4 +-
linux-user/arm/nwfpe/fpa11.h | 2 -
linux-user/arm/nwfpe/fpa11_cprt.c | 8 +++---
14 files changed, 9 insertions(+), 161 deletions(-)
diff --git a/hw/devices.h b/hw/devices.h
index 1a55c1e..b01af84 100644
--- a/hw/devices.h
+++ b/hw/devices.h
@@ -55,9 +55,6 @@ typedef struct TC6393xbState TC6393xbState;
#define TC6393XB_RAM 0x110000 /* amount of ram for Video and USB */
TC6393xbState *tc6393xb_init(struct MemoryRegion *sysmem,
uint32_t base, qemu_irq irq);
-void tc6393xb_gpio_out_set(TC6393xbState *s, int line,
- qemu_irq handler);
-qemu_irq *tc6393xb_gpio_in_get(TC6393xbState *s);
qemu_irq tc6393xb_l3v_get(TC6393xbState *s);
/* sm501.c */
diff --git a/hw/i2c.h b/hw/i2c.h
index 0f5682b..883b5c5 100644
--- a/hw/i2c.h
+++ b/hw/i2c.h
@@ -73,9 +73,6 @@ void *wm8750_dac_buffer(void *opaque, int samples);
void wm8750_dac_commit(void *opaque);
void wm8750_set_bclk_in(void *opaque, int new_hz);
-/* tmp105.c */
-void tmp105_set(I2CSlave *i2c, int temp);
-
/* lm832x.c */
void lm832x_key_event(DeviceState *dev, int key, int state);
diff --git a/hw/omap.h b/hw/omap.h
index 413851b..7aaf98c 100644
--- a/hw/omap.h
+++ b/hw/omap.h
@@ -114,7 +114,6 @@ struct omap_gpmc_s *omap_gpmc_init(struct omap_mpu_state_s *mpu,
qemu_irq irq, qemu_irq drq);
void omap_gpmc_reset(struct omap_gpmc_s *s);
void omap_gpmc_attach(struct omap_gpmc_s *s, int cs, MemoryRegion *iomem);
-void omap_gpmc_attach_nand(struct omap_gpmc_s *s, int cs, DeviceState *nand);
/*
* Common IRQ numbers for level 1 interrupt handler
diff --git a/hw/omap_gpmc.c b/hw/omap_gpmc.c
index 2fc4137..2c02a83 100644
--- a/hw/omap_gpmc.c
+++ b/hw/omap_gpmc.c
@@ -871,24 +871,3 @@ void omap_gpmc_attach(struct omap_gpmc_s *s, int cs, MemoryRegion *iomem)
f->iomem = iomem;
omap_gpmc_cs_map(s, cs);
}
-
-void omap_gpmc_attach_nand(struct omap_gpmc_s *s, int cs, DeviceState *nand)
-{
- struct omap_gpmc_cs_file_s *f;
- assert(nand);
-
- if (cs < 0 || cs >= 8) {
- fprintf(stderr, "%s: bad chip-select %i\n", __func__, cs);
- exit(-1);
- }
- f = &s->cs_file[cs];
-
- omap_gpmc_cs_unmap(s, cs);
- f->config[0] &= ~(0xf << 10);
- f->config[0] |= (OMAP_GPMC_NAND << 10);
- f->dev = nand;
- if (nand_getbuswidth(f->dev) == 16) {
- f->config[0] |= OMAP_GPMC_16BIT << 12;
- }
- omap_gpmc_cs_map(s, cs);
-}
diff --git a/hw/pxa.h b/hw/pxa.h
index 6a21205..19891d8 100644
--- a/hw/pxa.h
+++ b/hw/pxa.h
@@ -97,7 +97,6 @@ typedef struct PXA2xxPCMCIAState PXA2xxPCMCIAState;
PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem,
target_phys_addr_t base);
int pxa2xx_pcmcia_attach(void *opaque, PCMCIACardState *card);
-int pxa2xx_pcmcia_dettach(void *opaque);
void pxa2xx_pcmcia_set_irq_cb(void *opaque, qemu_irq irq, qemu_irq cd_irq);
/* pxa2xx_keypad.c */
@@ -114,8 +113,6 @@ void pxa27x_register_keypad(PXA2xxKeyPadState *kp, struct keymap *map,
/* pxa2xx.c */
typedef struct PXA2xxI2CState PXA2xxI2CState;
-PXA2xxI2CState *pxa2xx_i2c_init(target_phys_addr_t base,
- qemu_irq irq, uint32_t page_size);
i2c_bus *pxa2xx_i2c_bus(PXA2xxI2CState *s);
typedef struct PXA2xxI2SState PXA2xxI2SState;
diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c
index d5f1420..8f7051b 100644
--- a/hw/pxa2xx.c
+++ b/hw/pxa2xx.c
@@ -1449,8 +1449,8 @@ static TypeInfo pxa2xx_i2c_slave_info = {
.class_init = pxa2xx_i2c_slave_class_init,
};
-PXA2xxI2CState *pxa2xx_i2c_init(target_phys_addr_t base,
- qemu_irq irq, uint32_t region_size)
+static PXA2xxI2CState *pxa2xx_i2c_init(target_phys_addr_t base, qemu_irq irq,
+ uint32_t region_size)
{
DeviceState *dev;
SysBusDevice *i2c_dev;
diff --git a/hw/pxa2xx_pcmcia.c b/hw/pxa2xx_pcmcia.c
index b15872a..209d0f9 100644
--- a/hw/pxa2xx_pcmcia.c
+++ b/hw/pxa2xx_pcmcia.c
@@ -177,27 +177,6 @@ int pxa2xx_pcmcia_attach(void *opaque, PCMCIACardState *card)
return 0;
}
-/* Eject card from the slot */
-int pxa2xx_pcmcia_dettach(void *opaque)
-{
- PXA2xxPCMCIAState *s = (PXA2xxPCMCIAState *) opaque;
- if (!s->slot.attached)
- return -ENOENT;
-
- s->card->detach(s->card->state);
- s->card->slot = NULL;
- s->card = NULL;
-
- s->slot.attached = 0;
-
- if (s->irq)
- qemu_irq_lower(s->irq);
- if (s->cd_irq)
- qemu_irq_lower(s->cd_irq);
-
- return 0;
-}
-
/* Who to notify on card events */
void pxa2xx_pcmcia_set_irq_cb(void *opaque, qemu_irq irq, qemu_irq cd_irq)
{
diff --git a/hw/soc_dma.c b/hw/soc_dma.c
index 03bc846..fe9d0f4 100644
--- a/hw/soc_dma.c
+++ b/hw/soc_dma.c
@@ -255,58 +255,6 @@ struct soc_dma_s *soc_dma_init(int n)
return &s->soc;
}
-void soc_dma_port_add_fifo(struct soc_dma_s *soc, target_phys_addr_t virt_base,
- soc_dma_io_t fn, void *opaque, int out)
-{
- struct memmap_entry_s *entry;
- struct dma_s *dma = (struct dma_s *) soc;
-
- dma->memmap = g_realloc(dma->memmap, sizeof(*entry) *
- (dma->memmap_size + 1));
- entry = soc_dma_lookup(dma, virt_base);
-
- if (dma->memmap_size) {
- if (entry->type == soc_dma_port_mem) {
- if (entry->addr <= virt_base &&
- entry->addr + entry->u.mem.size > virt_base) {
- fprintf(stderr, "%s: FIFO at " TARGET_FMT_lx
- " collides with RAM region at " TARGET_FMT_lx
- "-" TARGET_FMT_lx "\n", __FUNCTION__,
- (target_ulong) virt_base,
- (target_ulong) entry->addr, (target_ulong)
- (entry->addr + entry->u.mem.size));
- exit(-1);
- }
-
- if (entry->addr <= virt_base)
- entry ++;
- } else
- while (entry < dma->memmap + dma->memmap_size &&
- entry->addr <= virt_base) {
- if (entry->addr == virt_base && entry->u.fifo.out == out) {
- fprintf(stderr, "%s: FIFO at " TARGET_FMT_lx
- " collides FIFO at " TARGET_FMT_lx "\n",
- __FUNCTION__, (target_ulong) virt_base,
- (target_ulong) entry->addr);
- exit(-1);
- }
-
- entry ++;
- }
-
- memmove(entry + 1, entry,
- (uint8_t *) (dma->memmap + dma->memmap_size ++) -
- (uint8_t *) entry);
- } else
- dma->memmap_size ++;
-
- entry->addr = virt_base;
- entry->type = soc_dma_port_fifo;
- entry->u.fifo.fn = fn;
- entry->u.fifo.opaque = opaque;
- entry->u.fifo.out = out;
-}
-
void soc_dma_port_add_mem(struct soc_dma_s *soc, uint8_t *phys_base,
target_phys_addr_t virt_base, size_t size)
{
diff --git a/hw/soc_dma.h b/hw/soc_dma.h
index 904b26c..3ad7f9c 100644
--- a/hw/soc_dma.h
+++ b/hw/soc_dma.h
@@ -84,26 +84,12 @@ void soc_dma_set_request(struct soc_dma_ch_s *ch, int level);
* ch->type[0...1],
* ch->vaddr[0...1],
* ch->paddr[0...1],
- * or after a soc_dma_port_add_fifo() or soc_dma_port_add_mem(). */
+ * or after a soc_dma_port_add_mem(). */
void soc_dma_ch_update(struct soc_dma_ch_s *ch);
/* The SoC should call this when the DMA module is being reset. */
void soc_dma_reset(struct soc_dma_s *s);
struct soc_dma_s *soc_dma_init(int n);
-void soc_dma_port_add_fifo(struct soc_dma_s *dma, target_phys_addr_t virt_base,
- soc_dma_io_t fn, void *opaque, int out);
void soc_dma_port_add_mem(struct soc_dma_s *dma, uint8_t *phys_base,
target_phys_addr_t virt_base, size_t size);
-
-static inline void soc_dma_port_add_fifo_in(struct soc_dma_s *dma,
- target_phys_addr_t virt_base, soc_dma_io_t fn, void *opaque)
-{
- return soc_dma_port_add_fifo(dma, virt_base, fn, opaque, 0);
-}
-
-static inline void soc_dma_port_add_fifo_out(struct soc_dma_s *dma,
- target_phys_addr_t virt_base, soc_dma_io_t fn, void *opaque)
-{
- return soc_dma_port_add_fifo(dma, virt_base, fn, opaque, 1);
-}
diff --git a/hw/tc6393xb.c b/hw/tc6393xb.c
index 420925c..5526077 100644
--- a/hw/tc6393xb.c
+++ b/hw/tc6393xb.c
@@ -134,11 +134,6 @@ struct TC6393xbState {
blanked : 1;
};
-qemu_irq *tc6393xb_gpio_in_get(TC6393xbState *s)
-{
- return s->gpio_in;
-}
-
static void tc6393xb_gpio_set(void *opaque, int line, int level)
{
// TC6393xbState *s = opaque;
@@ -151,17 +146,6 @@ static void tc6393xb_gpio_set(void *opaque, int line, int level)
// FIXME: how does the chip reflect the GPIO input level change?
}
-void tc6393xb_gpio_out_set(TC6393xbState *s, int line,
- qemu_irq handler)
-{
- if (line >= TC6393XB_GPIOS) {
- fprintf(stderr, "TC6393xb: no GPIO pin %d\n", line);
- return;
- }
-
- s->handler[line] = handler;
-}
-
static void tc6393xb_gpio_handler_update(TC6393xbState *s)
{
uint32_t level, diff;
diff --git a/hw/tmp105.c b/hw/tmp105.c
index 8e8dbd9..dbc3354 100644
--- a/hw/tmp105.c
+++ b/hw/tmp105.c
@@ -64,22 +64,6 @@ static void tmp105_alarm_update(TMP105State *s)
tmp105_interrupt_update(s);
}
-/* Units are 0.001 centigrades relative to 0 C. */
-void tmp105_set(I2CSlave *i2c, int temp)
-{
- TMP105State *s = (TMP105State *) i2c;
-
- if (temp >= 128000 || temp < -128000) {
- fprintf(stderr, "%s: values is out of range (%i.%03i C)\n",
- __FUNCTION__, temp / 1000, temp % 1000);
- exit(-1);
- }
-
- s->temperature = ((int16_t) (temp * 0x800 / 128000)) << 4;
-
- tmp105_alarm_update(s);
-}
-
static const int tmp105_faultq[4] = { 1, 2, 4, 6 };
static void tmp105_read(TMP105State *s)
diff --git a/linux-user/arm/nwfpe/fpa11.c b/linux-user/arm/nwfpe/fpa11.c
index eebd93f..3434036 100644
--- a/linux-user/arm/nwfpe/fpa11.c
+++ b/linux-user/arm/nwfpe/fpa11.c
@@ -33,7 +33,7 @@ FPA11* qemufpa = NULL;
CPUARMState* user_registers;
/* Reset the FPA11 chip. Called to initialize and reset the emulator. */
-void resetFPA11(void)
+static void resetFPA11(void)
{
int i;
FPA11 *fpa11 = GET_FPA11();
@@ -95,7 +95,7 @@ void SetRoundingMode(const unsigned int opcode)
set_float_rounding_mode(rounding_mode, &fpa11->fp_status);
}
-void SetRoundingPrecision(const unsigned int opcode)
+static void SetRoundingPrecision(const unsigned int opcode)
{
int rounding_precision;
FPA11 *fpa11 = GET_FPA11();
diff --git a/linux-user/arm/nwfpe/fpa11.h b/linux-user/arm/nwfpe/fpa11.h
index 002b3cb..9afe981 100644
--- a/linux-user/arm/nwfpe/fpa11.h
+++ b/linux-user/arm/nwfpe/fpa11.h
@@ -89,9 +89,7 @@ typedef struct tagFPA11 {
extern FPA11* qemufpa;
-void resetFPA11(void);
void SetRoundingMode(const unsigned int);
-void SetRoundingPrecision(const unsigned int);
static inline unsigned int readRegister(unsigned int reg)
{
diff --git a/linux-user/arm/nwfpe/fpa11_cprt.c b/linux-user/arm/nwfpe/fpa11_cprt.c
index 8011897..b53e345 100644
--- a/linux-user/arm/nwfpe/fpa11_cprt.c
+++ b/linux-user/arm/nwfpe/fpa11_cprt.c
@@ -26,8 +26,8 @@
//#include "fpmodule.h"
//#include "fpmodule.inl"
-unsigned int PerformFLT(const unsigned int opcode);
-unsigned int PerformFIX(const unsigned int opcode);
+static unsigned int PerformFLT(const unsigned int opcode);
+static unsigned int PerformFIX(const unsigned int opcode);
static unsigned int
PerformComparison(const unsigned int opcode);
@@ -68,7 +68,7 @@ unsigned int EmulateCPRT(const unsigned int opcode)
return nRc;
}
-unsigned int PerformFLT(const unsigned int opcode)
+static unsigned int PerformFLT(const unsigned int opcode)
{
FPA11 *fpa11 = GET_FPA11();
@@ -107,7 +107,7 @@ unsigned int PerformFLT(const unsigned int opcode)
return nRc;
}
-unsigned int PerformFIX(const unsigned int opcode)
+static unsigned int PerformFIX(const unsigned int opcode)
{
FPA11 *fpa11 = GET_FPA11();
unsigned int nRc = 1;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PATCH 11/11] exec: make some functions static
2012-10-14 19:58 [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
` (9 preceding siblings ...)
2012-10-14 19:58 ` [Qemu-devel] [PATCH 10/11] arm: add missing static and remove unused functions Blue Swirl
@ 2012-10-14 19:58 ` Blue Swirl
2012-10-14 20:06 ` [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
2012-10-19 8:38 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
12 siblings, 0 replies; 25+ messages in thread
From: Blue Swirl @ 2012-10-14 19:58 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, blauwirbel
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
cpu-common.h | 5 -----
exec-all.h | 2 --
exec-obsolete.h | 4 ----
exec.c | 19 +++++++++++--------
4 files changed, 11 insertions(+), 19 deletions(-)
diff --git a/cpu-common.h b/cpu-common.h
index c0d27af..f51ba67 100644
--- a/cpu-common.h
+++ b/cpu-common.h
@@ -39,10 +39,6 @@ typedef uint32_t CPUReadMemoryFunc(void *opaque, target_phys_addr_t addr);
void qemu_ram_remap(ram_addr_t addr, ram_addr_t length);
/* This should only be used for ram local to a device. */
void *qemu_get_ram_ptr(ram_addr_t addr);
-void *qemu_ram_ptr_length(ram_addr_t addr, ram_addr_t *size);
-/* Same but slower, to use for migration, where the order of
- * RAMBlocks must not change. */
-void *qemu_safe_ram_ptr(ram_addr_t addr);
void qemu_put_ram_ptr(void *addr);
/* This should not be used by devices. */
int qemu_ram_addr_from_host(void *ptr, ram_addr_t *ram_addr);
@@ -67,7 +63,6 @@ void *cpu_physical_memory_map(target_phys_addr_t addr,
void cpu_physical_memory_unmap(void *buffer, target_phys_addr_t len,
int is_write, target_phys_addr_t access_len);
void *cpu_register_map_client(void *opaque, void (*callback)(void *opaque));
-void cpu_unregister_map_client(void *cookie);
bool cpu_physical_memory_is_io(target_phys_addr_t phys_addr);
diff --git a/exec-all.h b/exec-all.h
index 6516da0..4a8a19b 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -196,8 +196,6 @@ static inline unsigned int tb_phys_hash_func(tb_page_addr_t pc)
void tb_free(TranslationBlock *tb);
void tb_flush(CPUArchState *env);
-void tb_link_page(TranslationBlock *tb,
- tb_page_addr_t phys_pc, tb_page_addr_t phys_page2);
void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr);
extern TranslationBlock *tb_phys_hash[CODE_GEN_PHYS_HASH_SIZE];
diff --git a/exec-obsolete.h b/exec-obsolete.h
index 286e2f7..d7a88a0 100644
--- a/exec-obsolete.h
+++ b/exec-obsolete.h
@@ -34,14 +34,10 @@ void qemu_ram_free_from_ptr(ram_addr_t addr);
struct MemoryRegion;
struct MemoryRegionSection;
-void cpu_register_physical_memory_log(struct MemoryRegionSection *section,
- bool readonly);
void qemu_register_coalesced_mmio(target_phys_addr_t addr, ram_addr_t size);
void qemu_unregister_coalesced_mmio(target_phys_addr_t addr, ram_addr_t size);
-int cpu_physical_memory_set_dirty_tracking(int enable);
-
#define VGA_DIRTY_FLAG 0x01
#define CODE_DIRTY_FLAG 0x02
#define MIGRATION_DIRTY_FLAG 0x08
diff --git a/exec.c b/exec.c
index 7899042..4344f2b 100644
--- a/exec.c
+++ b/exec.c
@@ -212,9 +212,12 @@ static PhysPageEntry phys_map = { .ptr = PHYS_MAP_NODE_NIL, .is_leaf = 0 };
static void io_mem_init(void);
static void memory_map_init(void);
+static void *qemu_safe_ram_ptr(ram_addr_t addr);
static MemoryRegion io_mem_watch;
#endif
+static void tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc,
+ tb_page_addr_t phys_page2);
/* statistics */
static int tb_flush_count;
@@ -1341,8 +1344,8 @@ static inline void tb_alloc_page(TranslationBlock *tb,
/* add a new TB and link it to the physical page tables. phys_page2 is
(-1) to indicate that only one page contains the TB. */
-void tb_link_page(TranslationBlock *tb,
- tb_page_addr_t phys_pc, tb_page_addr_t phys_page2)
+static void tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc,
+ tb_page_addr_t phys_page2)
{
unsigned int h;
TranslationBlock **ptb;
@@ -1851,7 +1854,7 @@ void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t end,
}
}
-int cpu_physical_memory_set_dirty_tracking(int enable)
+static int cpu_physical_memory_set_dirty_tracking(int enable)
{
int ret = 0;
in_migration = enable;
@@ -2272,8 +2275,8 @@ static void register_multipage(MemoryRegionSection *section)
section_index);
}
-void cpu_register_physical_memory_log(MemoryRegionSection *section,
- bool readonly)
+static void cpu_register_physical_memory_log(MemoryRegionSection *section,
+ bool readonly)
{
MemoryRegionSection now = *section, remain = *section;
@@ -2745,7 +2748,7 @@ void *qemu_get_ram_ptr(ram_addr_t addr)
/* Return a host pointer to ram allocated with qemu_ram_alloc.
* Same as qemu_get_ram_ptr but avoid reordering ramblocks.
*/
-void *qemu_safe_ram_ptr(ram_addr_t addr)
+static void *qemu_safe_ram_ptr(ram_addr_t addr)
{
RAMBlock *block;
@@ -2775,7 +2778,7 @@ void *qemu_safe_ram_ptr(ram_addr_t addr)
/* Return a host pointer to guest's ram. Similar to qemu_get_ram_ptr
* but takes a size argument */
-void *qemu_ram_ptr_length(ram_addr_t addr, ram_addr_t *size)
+static void *qemu_ram_ptr_length(ram_addr_t addr, ram_addr_t *size)
{
if (*size == 0) {
return NULL;
@@ -3569,7 +3572,7 @@ void *cpu_register_map_client(void *opaque, void (*callback)(void *opaque))
return client;
}
-void cpu_unregister_map_client(void *_client)
+static void cpu_unregister_map_client(void *_client)
{
MapClient *client = (MapClient *)_client;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PATCH 00/11] static patches
2012-10-14 19:58 [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
` (10 preceding siblings ...)
2012-10-14 19:58 ` [Qemu-devel] [PATCH 11/11] exec: make some functions static Blue Swirl
@ 2012-10-14 20:06 ` Blue Swirl
2012-10-14 20:32 ` malc
2012-10-19 8:38 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
12 siblings, 1 reply; 25+ messages in thread
From: Blue Swirl @ 2012-10-14 20:06 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, blauwirbel
[-- Attachment #1: Type: text/plain, Size: 3288 bytes --]
On Sun, Oct 14, 2012 at 7:58 PM, Blue Swirl <blauwirbel@gmail.com> wrote:
> I made a small tool to detect unused functions and
> variables. Here's some fixes.
Just run the attached tool in an object directory and after some time,
it will produce a list of suspect symbols:
AES_decrypt ( ./aes.o)
AES_encrypt ( ./aes.o)
AUD_get_elapsed_usec_in ( ./audio/audio.o)
AUD_get_elapsed_usec_out ( ./audio/audio.o)
AUD_init_time_stamp_in ( ./audio/audio.o)
AUD_init_time_stamp_out ( ./audio/audio.o)
AUD_is_active_in ( ./audio/audio.o)
AUD_is_active_out ( ./audio/audio.o)
DEFAULT_ATR ( ./hw/ccid-card-passthru.o)
...
>
> Blue Swirl (11):
> target-sparc: make do_unaligned_access static
> vl.c: add missing static
> vnc: add missing static and remove unused functions
> tap-win32: avoid a warning
> m48t59: remove unused m48t59_set_addr
> sun4c: remove unused functions
> slirp: remove unused function u_sleep
> ppc: add missing static and remove unused functions
> target-ppc: make some functions static
> arm: add missing static and remove unused functions
> exec: make some functions static
>
> console.h | 2 -
> cpu-common.h | 5 -
> exec-all.h | 2 -
> exec-obsolete.h | 4 -
> exec.c | 19 ++-
> hw/adb.c | 8 +-
> hw/adb.h | 4 -
> hw/devices.h | 3 -
> hw/i2c.h | 3 -
> hw/m48t59.c | 7 -
> hw/mac_nvram.c | 24 ---
> hw/nvram.h | 12 --
> hw/omap.h | 1 -
> hw/omap_gpmc.c | 21 ---
> hw/pcmcia.h | 1 -
> hw/ppc.c | 54 +-----
> hw/ppc405.h | 6 -
> hw/ppc405_uc.c | 342 -------------------------------------
> hw/ppc_mac.h | 2 -
> hw/pxa.h | 3 -
> hw/pxa2xx.c | 4 +-
> hw/pxa2xx_pcmcia.c | 21 ---
> hw/soc_dma.c | 52 ------
> hw/soc_dma.h | 16 +--
> hw/sun4c_intctl.c | 23 ---
> hw/sun4m.h | 4 -
> hw/tc6393xb.c | 16 --
> hw/tmp105.c | 16 --
> linux-user/arm/nwfpe/fpa11.c | 4 +-
> linux-user/arm/nwfpe/fpa11.h | 2 -
> linux-user/arm/nwfpe/fpa11_cprt.c | 8 +-
> net/tap-win32.c | 1 +
> slirp/misc.c | 14 --
> slirp/misc.h | 1 -
> sysemu.h | 5 -
> target-ppc/cpu.h | 9 -
> target-ppc/mmu_helper.c | 11 +-
> target-sparc/cpu.h | 3 -
> target-sparc/ldst_helper.c | 8 +-
> ui/vnc-jobs.c | 46 +-----
> ui/vnc-jobs.h | 4 -
> ui/vnc.c | 14 +-
> ui/vnc.h | 5 -
> vl.c | 33 ++---
> 44 files changed, 69 insertions(+), 774 deletions(-)
>
> --
> 1.7.2.5
>
[-- Attachment #2: statics.pl --]
[-- Type: application/x-perl, Size: 1494 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PATCH 10/11] arm: add missing static and remove unused functions
2012-10-14 19:58 ` [Qemu-devel] [PATCH 10/11] arm: add missing static and remove unused functions Blue Swirl
@ 2012-10-14 20:09 ` Peter Maydell
2012-10-14 20:33 ` Blue Swirl
0 siblings, 1 reply; 25+ messages in thread
From: Peter Maydell @ 2012-10-14 20:09 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-trivial, Riku Voipio, qemu-devel
On 14 October 2012 20:58, Blue Swirl <blauwirbel@gmail.com> wrote:
> index 2fc4137..2c02a83 100644
> --- a/hw/omap_gpmc.c
> +++ b/hw/omap_gpmc.c
> @@ -871,24 +871,3 @@ void omap_gpmc_attach(struct omap_gpmc_s *s, int cs, MemoryRegion *iomem)
> f->iomem = iomem;
> omap_gpmc_cs_map(s, cs);
> }
> -
> -void omap_gpmc_attach_nand(struct omap_gpmc_s *s, int cs, DeviceState *nand)
> -{
> - struct omap_gpmc_cs_file_s *f;
> - assert(nand);
> -
> - if (cs < 0 || cs >= 8) {
> - fprintf(stderr, "%s: bad chip-select %i\n", __func__, cs);
> - exit(-1);
> - }
> - f = &s->cs_file[cs];
> -
> - omap_gpmc_cs_unmap(s, cs);
> - f->config[0] &= ~(0xf << 10);
> - f->config[0] |= (OMAP_GPMC_NAND << 10);
> - f->dev = nand;
> - if (nand_getbuswidth(f->dev) == 16) {
> - f->config[0] |= OMAP_GPMC_16BIT << 12;
> - }
> - omap_gpmc_cs_map(s, cs);
> -}
Please don't delete this function, it is the public facing interface
for allowing board models to attach NAND devices to the GPMC. This
might not be used by anything currently in mainline, but it is used
by the omap3 beagle and overo board models in qemu-linaro (and which
I will upstream eventually, honest).
More generally I'm wary of deletion of apparently unused functions like
this one (or some of the others like the 'pcmcia eject card' function)
which are obviously intended to be public facing APIs to other
device models, unless they come with rationales along the lines of
"this function was added for purpose X but it is not needed now because
commit Y changed things so you do this with Z now".
> diff --git a/linux-user/arm/nwfpe/fpa11.c b/linux-user/arm/nwfpe/fpa11.c
> index eebd93f..3434036 100644
> --- a/linux-user/arm/nwfpe/fpa11.c
> +++ b/linux-user/arm/nwfpe/fpa11.c
In general anything in linux-user/arm/nwfpe is legacy code which
it's scarcely worth the effort of touching or reviewing.
thanks
-- PMM
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PATCH 00/11] static patches
2012-10-14 20:06 ` [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
@ 2012-10-14 20:32 ` malc
2012-10-14 20:41 ` Blue Swirl
0 siblings, 1 reply; 25+ messages in thread
From: malc @ 2012-10-14 20:32 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-trivial, qemu-devel
On Sun, 14 Oct 2012, Blue Swirl wrote:
> On Sun, Oct 14, 2012 at 7:58 PM, Blue Swirl <blauwirbel@gmail.com> wrote:
> > I made a small tool to detect unused functions and
> > variables. Here's some fixes.
>
> Just run the attached tool in an object directory and after some time,
> it will produce a list of suspect symbols:
> AES_decrypt ( ./aes.o)
> AES_encrypt ( ./aes.o)
> AUD_get_elapsed_usec_in ( ./audio/audio.o)
> AUD_get_elapsed_usec_out ( ./audio/audio.o)
> AUD_init_time_stamp_in ( ./audio/audio.o)
> AUD_init_time_stamp_out ( ./audio/audio.o)
> AUD_is_active_in ( ./audio/audio.o)
> AUD_is_active_out ( ./audio/audio.o)
And those are all part of public API mentioned in audio.h
Unused yes, but they are not static intentionally.
[..snip..]
--
mailto:av1474@comtv.ru
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PATCH 10/11] arm: add missing static and remove unused functions
2012-10-14 20:09 ` Peter Maydell
@ 2012-10-14 20:33 ` Blue Swirl
2012-10-14 20:35 ` Peter Maydell
2012-10-15 0:01 ` Andreas Färber
0 siblings, 2 replies; 25+ messages in thread
From: Blue Swirl @ 2012-10-14 20:33 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-trivial, Riku Voipio, qemu-devel
On Sun, Oct 14, 2012 at 8:09 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 14 October 2012 20:58, Blue Swirl <blauwirbel@gmail.com> wrote:
>> index 2fc4137..2c02a83 100644
>> --- a/hw/omap_gpmc.c
>> +++ b/hw/omap_gpmc.c
>> @@ -871,24 +871,3 @@ void omap_gpmc_attach(struct omap_gpmc_s *s, int cs, MemoryRegion *iomem)
>> f->iomem = iomem;
>> omap_gpmc_cs_map(s, cs);
>> }
>> -
>> -void omap_gpmc_attach_nand(struct omap_gpmc_s *s, int cs, DeviceState *nand)
>> -{
>> - struct omap_gpmc_cs_file_s *f;
>> - assert(nand);
>> -
>> - if (cs < 0 || cs >= 8) {
>> - fprintf(stderr, "%s: bad chip-select %i\n", __func__, cs);
>> - exit(-1);
>> - }
>> - f = &s->cs_file[cs];
>> -
>> - omap_gpmc_cs_unmap(s, cs);
>> - f->config[0] &= ~(0xf << 10);
>> - f->config[0] |= (OMAP_GPMC_NAND << 10);
>> - f->dev = nand;
>> - if (nand_getbuswidth(f->dev) == 16) {
>> - f->config[0] |= OMAP_GPMC_16BIT << 12;
>> - }
>> - omap_gpmc_cs_map(s, cs);
>> -}
>
> Please don't delete this function, it is the public facing interface
> for allowing board models to attach NAND devices to the GPMC. This
> might not be used by anything currently in mainline, but it is used
> by the omap3 beagle and overo board models in qemu-linaro (and which
> I will upstream eventually, honest).
It could be re-added with the boards, or just disabled now with #if 0/#endif.
> More generally I'm wary of deletion of apparently unused functions like
> this one (or some of the others like the 'pcmcia eject card' function)
> which are obviously intended to be public facing APIs to other
> device models, unless they come with rationales along the lines of
> "this function was added for purpose X but it is not needed now because
> commit Y changed things so you do this with Z now".
In case of pcmcia, it's from 2009 so one would expect users to have
appeared already.
>
>> diff --git a/linux-user/arm/nwfpe/fpa11.c b/linux-user/arm/nwfpe/fpa11.c
>> index eebd93f..3434036 100644
>> --- a/linux-user/arm/nwfpe/fpa11.c
>> +++ b/linux-user/arm/nwfpe/fpa11.c
>
> In general anything in linux-user/arm/nwfpe is legacy code which
> it's scarcely worth the effort of touching or reviewing.
Adding 'static' should be only beneficial.
>
> thanks
> -- PMM
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PATCH 10/11] arm: add missing static and remove unused functions
2012-10-14 20:33 ` Blue Swirl
@ 2012-10-14 20:35 ` Peter Maydell
2012-10-14 20:49 ` Blue Swirl
2012-10-15 0:01 ` Andreas Färber
1 sibling, 1 reply; 25+ messages in thread
From: Peter Maydell @ 2012-10-14 20:35 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-trivial, Riku Voipio, qemu-devel
On 14 October 2012 21:33, Blue Swirl <blauwirbel@gmail.com> wrote:
> On Sun, Oct 14, 2012 at 8:09 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
>> Please don't delete this function, it is the public facing interface
>> for allowing board models to attach NAND devices to the GPMC. This
>> might not be used by anything currently in mainline, but it is used
>> by the omap3 beagle and overo board models in qemu-linaro (and which
>> I will upstream eventually, honest).
>
> It could be re-added with the boards, or just disabled now with #if 0/#endif.
It could be, but why do either of these things when the least-effort
least-change move is to just do nothing?
>> In general anything in linux-user/arm/nwfpe is legacy code which
>> it's scarcely worth the effort of touching or reviewing.
>
> Adding 'static' should be only beneficial.
Except that it's taken you time to write these patches and it
will take me time to review them.
-- PMM
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PATCH 00/11] static patches
2012-10-14 20:32 ` malc
@ 2012-10-14 20:41 ` Blue Swirl
0 siblings, 0 replies; 25+ messages in thread
From: Blue Swirl @ 2012-10-14 20:41 UTC (permalink / raw)
To: malc; +Cc: qemu-trivial, qemu-devel
On Sun, Oct 14, 2012 at 8:32 PM, malc <av1474@comtv.ru> wrote:
> On Sun, 14 Oct 2012, Blue Swirl wrote:
>
>> On Sun, Oct 14, 2012 at 7:58 PM, Blue Swirl <blauwirbel@gmail.com> wrote:
>> > I made a small tool to detect unused functions and
>> > variables. Here's some fixes.
>>
>> Just run the attached tool in an object directory and after some time,
>> it will produce a list of suspect symbols:
>> AES_decrypt ( ./aes.o)
>> AES_encrypt ( ./aes.o)
>
>
>> AUD_get_elapsed_usec_in ( ./audio/audio.o)
>> AUD_get_elapsed_usec_out ( ./audio/audio.o)
>> AUD_init_time_stamp_in ( ./audio/audio.o)
>> AUD_init_time_stamp_out ( ./audio/audio.o)
>> AUD_is_active_in ( ./audio/audio.o)
>> AUD_is_active_out ( ./audio/audio.o)
>
> And those are all part of public API mentioned in audio.h
> Unused yes, but they are not static intentionally.
Yes, I checked those. The tool is a fool. There are other cases like
softfloat functions and TCG runtime parts which may be unused for some
host/target combinations. In theory, with lots of #ifdeffery or
splitting the files into smaller pieces, the unused parts could be
disabled, but that would be silly. A better approach might be using
some kind of AR library but it would still be a lot of effort for
little gain.
>
> [..snip..]
>
> --
> mailto:av1474@comtv.ru
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PATCH 10/11] arm: add missing static and remove unused functions
2012-10-14 20:35 ` Peter Maydell
@ 2012-10-14 20:49 ` Blue Swirl
2012-10-14 20:55 ` Peter Maydell
0 siblings, 1 reply; 25+ messages in thread
From: Blue Swirl @ 2012-10-14 20:49 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-trivial, Riku Voipio, qemu-devel
On Sun, Oct 14, 2012 at 8:35 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 14 October 2012 21:33, Blue Swirl <blauwirbel@gmail.com> wrote:
>> On Sun, Oct 14, 2012 at 8:09 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
>>> Please don't delete this function, it is the public facing interface
>>> for allowing board models to attach NAND devices to the GPMC. This
>>> might not be used by anything currently in mainline, but it is used
>>> by the omap3 beagle and overo board models in qemu-linaro (and which
>>> I will upstream eventually, honest).
>>
>> It could be re-added with the boards, or just disabled now with #if 0/#endif.
>
> It could be, but why do either of these things when the least-effort
> least-change move is to just do nothing?
Actually it's not least effort, since now I have to edit the patch.
I'm not sure what would be least effort, nobody does anything? ;-)
>
>>> In general anything in linux-user/arm/nwfpe is legacy code which
>>> it's scarcely worth the effort of touching or reviewing.
>>
>> Adding 'static' should be only beneficial.
>
> Except that it's taken you time to write these patches and it
> will take me time to review them.
Yes, the benefit may come to the users who may get a slightly faster
emulator. We, the developers, get the benefit from different things,
like technical excellence or something else.
>
> -- PMM
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PATCH 10/11] arm: add missing static and remove unused functions
2012-10-14 20:49 ` Blue Swirl
@ 2012-10-14 20:55 ` Peter Maydell
2012-10-19 16:43 ` Blue Swirl
0 siblings, 1 reply; 25+ messages in thread
From: Peter Maydell @ 2012-10-14 20:55 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-trivial, Riku Voipio, qemu-devel
On 14 October 2012 21:49, Blue Swirl <blauwirbel@gmail.com> wrote:
> On Sun, Oct 14, 2012 at 8:35 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
>> On 14 October 2012 21:33, Blue Swirl <blauwirbel@gmail.com> wrote:
>>> On Sun, Oct 14, 2012 at 8:09 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
>>>> In general anything in linux-user/arm/nwfpe is legacy code which
>>>> it's scarcely worth the effort of touching or reviewing.
>>>
>>> Adding 'static' should be only beneficial.
>>
>> Except that it's taken you time to write these patches and it
>> will take me time to review them.
>
> Yes, the benefit may come to the users who may get a slightly faster
> emulator.
If you or any other user would like to find me some test cases
which actually use the FPA floating point emulation at all
I'd be happy to (a) add them to my test collection and (b)
test this patch...
> We, the developers, get the benefit from different things,
> like technical excellence or something else.
One day I might pursue technical excellence by dropping
the nwfpe code completely :-)
-- PMM
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PATCH 10/11] arm: add missing static and remove unused functions
2012-10-14 20:33 ` Blue Swirl
2012-10-14 20:35 ` Peter Maydell
@ 2012-10-15 0:01 ` Andreas Färber
1 sibling, 0 replies; 25+ messages in thread
From: Andreas Färber @ 2012-10-15 0:01 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-trivial, Peter Maydell, Riku Voipio, qemu-devel
Am 14.10.2012 22:33, schrieb Blue Swirl:
> On Sun, Oct 14, 2012 at 8:09 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
>> Please don't delete this function, it is the public facing interface
>> for allowing board models to attach NAND devices to the GPMC. This
>> might not be used by anything currently in mainline, but it is used
>> by the omap3 beagle and overo board models in qemu-linaro (and which
>> I will upstream eventually, honest).
>
> It could be re-added with the boards, or just disabled now with #if 0/#endif.
#if 0 would make things worse, since then no compile-time checking of
the code is performed and it just rots, as seen with DPRINTF().
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PATCH 05/11] m48t59: remove unused m48t59_set_addr
2012-10-14 19:58 ` [Qemu-devel] [PATCH 05/11] m48t59: remove unused m48t59_set_addr Blue Swirl
@ 2012-10-15 0:04 ` Andreas Färber
0 siblings, 0 replies; 25+ messages in thread
From: Andreas Färber @ 2012-10-15 0:04 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-trivial, qemu-devel
Am 14.10.2012 21:58, schrieb Blue Swirl:
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH 00/11] static patches
2012-10-14 19:58 [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
` (11 preceding siblings ...)
2012-10-14 20:06 ` [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
@ 2012-10-19 8:38 ` Stefan Hajnoczi
2012-10-19 17:49 ` Blue Swirl
12 siblings, 1 reply; 25+ messages in thread
From: Stefan Hajnoczi @ 2012-10-19 8:38 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-trivial, qemu-devel
On Sun, Oct 14, 2012 at 07:58:48PM +0000, Blue Swirl wrote:
> I made a small tool to detect unused functions and
> variables. Here's some fixes.
>
> Blue Swirl (11):
> target-sparc: make do_unaligned_access static
> vl.c: add missing static
> vnc: add missing static and remove unused functions
> tap-win32: avoid a warning
> m48t59: remove unused m48t59_set_addr
> sun4c: remove unused functions
> slirp: remove unused function u_sleep
> ppc: add missing static and remove unused functions
> target-ppc: make some functions static
> arm: add missing static and remove unused functions
> exec: make some functions static
>
> console.h | 2 -
> cpu-common.h | 5 -
> exec-all.h | 2 -
> exec-obsolete.h | 4 -
> exec.c | 19 ++-
> hw/adb.c | 8 +-
> hw/adb.h | 4 -
> hw/devices.h | 3 -
> hw/i2c.h | 3 -
> hw/m48t59.c | 7 -
> hw/mac_nvram.c | 24 ---
> hw/nvram.h | 12 --
> hw/omap.h | 1 -
> hw/omap_gpmc.c | 21 ---
> hw/pcmcia.h | 1 -
> hw/ppc.c | 54 +-----
> hw/ppc405.h | 6 -
> hw/ppc405_uc.c | 342 -------------------------------------
> hw/ppc_mac.h | 2 -
> hw/pxa.h | 3 -
> hw/pxa2xx.c | 4 +-
> hw/pxa2xx_pcmcia.c | 21 ---
> hw/soc_dma.c | 52 ------
> hw/soc_dma.h | 16 +--
> hw/sun4c_intctl.c | 23 ---
> hw/sun4m.h | 4 -
> hw/tc6393xb.c | 16 --
> hw/tmp105.c | 16 --
> linux-user/arm/nwfpe/fpa11.c | 4 +-
> linux-user/arm/nwfpe/fpa11.h | 2 -
> linux-user/arm/nwfpe/fpa11_cprt.c | 8 +-
> net/tap-win32.c | 1 +
> slirp/misc.c | 14 --
> slirp/misc.h | 1 -
> sysemu.h | 5 -
> target-ppc/cpu.h | 9 -
> target-ppc/mmu_helper.c | 11 +-
> target-sparc/cpu.h | 3 -
> target-sparc/ldst_helper.c | 8 +-
> ui/vnc-jobs.c | 46 +-----
> ui/vnc-jobs.h | 4 -
> ui/vnc.c | 14 +-
> ui/vnc.h | 5 -
> vl.c | 33 ++---
> 44 files changed, 69 insertions(+), 774 deletions(-)
Will you send a v2 or will you drop this series?
Stefan
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PATCH 10/11] arm: add missing static and remove unused functions
2012-10-14 20:55 ` Peter Maydell
@ 2012-10-19 16:43 ` Blue Swirl
0 siblings, 0 replies; 25+ messages in thread
From: Blue Swirl @ 2012-10-19 16:43 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-trivial, Riku Voipio, qemu-devel
On Sun, Oct 14, 2012 at 8:55 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 14 October 2012 21:49, Blue Swirl <blauwirbel@gmail.com> wrote:
>> On Sun, Oct 14, 2012 at 8:35 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
>>> On 14 October 2012 21:33, Blue Swirl <blauwirbel@gmail.com> wrote:
>>>> On Sun, Oct 14, 2012 at 8:09 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
>>>>> In general anything in linux-user/arm/nwfpe is legacy code which
>>>>> it's scarcely worth the effort of touching or reviewing.
>>>>
>>>> Adding 'static' should be only beneficial.
>>>
>>> Except that it's taken you time to write these patches and it
>>> will take me time to review them.
>>
>> Yes, the benefit may come to the users who may get a slightly faster
>> emulator.
>
> If you or any other user would like to find me some test cases
> which actually use the FPA floating point emulation at all
> I'd be happy to (a) add them to my test collection and (b)
> test this patch...
>
>> We, the developers, get the benefit from different things,
>> like technical excellence or something else.
>
> One day I might pursue technical excellence by dropping
> the nwfpe code completely :-)
That would be the best option. Removed code does not need maintenance.
>
> -- PMM
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH 00/11] static patches
2012-10-19 8:38 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
@ 2012-10-19 17:49 ` Blue Swirl
0 siblings, 0 replies; 25+ messages in thread
From: Blue Swirl @ 2012-10-19 17:49 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: qemu-trivial, qemu-devel
On Fri, Oct 19, 2012 at 8:38 AM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Sun, Oct 14, 2012 at 07:58:48PM +0000, Blue Swirl wrote:
>> I made a small tool to detect unused functions and
>> variables. Here's some fixes.
>>
>> Blue Swirl (11):
>> target-sparc: make do_unaligned_access static
>> vl.c: add missing static
>> vnc: add missing static and remove unused functions
>> tap-win32: avoid a warning
>> m48t59: remove unused m48t59_set_addr
>> sun4c: remove unused functions
>> slirp: remove unused function u_sleep
>> ppc: add missing static and remove unused functions
>> target-ppc: make some functions static
>> arm: add missing static and remove unused functions
>> exec: make some functions static
>>
>> console.h | 2 -
>> cpu-common.h | 5 -
>> exec-all.h | 2 -
>> exec-obsolete.h | 4 -
>> exec.c | 19 ++-
>> hw/adb.c | 8 +-
>> hw/adb.h | 4 -
>> hw/devices.h | 3 -
>> hw/i2c.h | 3 -
>> hw/m48t59.c | 7 -
>> hw/mac_nvram.c | 24 ---
>> hw/nvram.h | 12 --
>> hw/omap.h | 1 -
>> hw/omap_gpmc.c | 21 ---
>> hw/pcmcia.h | 1 -
>> hw/ppc.c | 54 +-----
>> hw/ppc405.h | 6 -
>> hw/ppc405_uc.c | 342 -------------------------------------
>> hw/ppc_mac.h | 2 -
>> hw/pxa.h | 3 -
>> hw/pxa2xx.c | 4 +-
>> hw/pxa2xx_pcmcia.c | 21 ---
>> hw/soc_dma.c | 52 ------
>> hw/soc_dma.h | 16 +--
>> hw/sun4c_intctl.c | 23 ---
>> hw/sun4m.h | 4 -
>> hw/tc6393xb.c | 16 --
>> hw/tmp105.c | 16 --
>> linux-user/arm/nwfpe/fpa11.c | 4 +-
>> linux-user/arm/nwfpe/fpa11.h | 2 -
>> linux-user/arm/nwfpe/fpa11_cprt.c | 8 +-
>> net/tap-win32.c | 1 +
>> slirp/misc.c | 14 --
>> slirp/misc.h | 1 -
>> sysemu.h | 5 -
>> target-ppc/cpu.h | 9 -
>> target-ppc/mmu_helper.c | 11 +-
>> target-sparc/cpu.h | 3 -
>> target-sparc/ldst_helper.c | 8 +-
>> ui/vnc-jobs.c | 46 +-----
>> ui/vnc-jobs.h | 4 -
>> ui/vnc.c | 14 +-
>> ui/vnc.h | 5 -
>> vl.c | 33 ++---
>> 44 files changed, 69 insertions(+), 774 deletions(-)
>
> Will you send a v2 or will you drop this series?
I'll make a v2 with only 'static' patches and send function removal
patches separately.
>
> Stefan
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2012-10-19 17:50 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-14 19:58 [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 01/11] target-sparc: make do_unaligned_access static Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 02/11] vl.c: add missing static Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 03/11] vnc: add missing static and remove unused functions Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 04/11] tap-win32: avoid a warning Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 05/11] m48t59: remove unused m48t59_set_addr Blue Swirl
2012-10-15 0:04 ` Andreas Färber
2012-10-14 19:58 ` [Qemu-devel] [PATCH 06/11] sun4c: remove unused functions Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 07/11] slirp: remove unused function u_sleep Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 08/11] ppc: add missing static and remove unused functions Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 09/11] target-ppc: make some functions static Blue Swirl
2012-10-14 19:58 ` [Qemu-devel] [PATCH 10/11] arm: add missing static and remove unused functions Blue Swirl
2012-10-14 20:09 ` Peter Maydell
2012-10-14 20:33 ` Blue Swirl
2012-10-14 20:35 ` Peter Maydell
2012-10-14 20:49 ` Blue Swirl
2012-10-14 20:55 ` Peter Maydell
2012-10-19 16:43 ` Blue Swirl
2012-10-15 0:01 ` Andreas Färber
2012-10-14 19:58 ` [Qemu-devel] [PATCH 11/11] exec: make some functions static Blue Swirl
2012-10-14 20:06 ` [Qemu-devel] [PATCH 00/11] static patches Blue Swirl
2012-10-14 20:32 ` malc
2012-10-14 20:41 ` Blue Swirl
2012-10-19 8:38 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2012-10-19 17:49 ` Blue Swirl
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).