[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/24] block/vvfat: Remove unused code
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 10/24] block/vvfat: Remove unused code |
Date: |
Fri, 14 Oct 2011 18:49:05 +0200 |
From: Stefan Weil <address@hidden>
The unused code was detected using cppcheck.
Cc: Kevin Wolf <address@hidden>
Signed-off-by: Stefan Weil <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/vvfat.c | 56 --------------------------------------------------------
1 files changed, 0 insertions(+), 56 deletions(-)
diff --git a/block/vvfat.c b/block/vvfat.c
index f45939d..ba207e2 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -824,20 +824,6 @@ static inline off_t cluster2sector(BDRVVVFATState* s,
uint32_t cluster_num)
return s->faked_sectors + s->sectors_per_cluster * cluster_num;
}
-static inline uint32_t sector_offset_in_cluster(BDRVVVFATState* s,off_t
sector_num)
-{
- return
(sector_num-s->first_sectors_number-2*s->sectors_per_fat)%s->sectors_per_cluster;
-}
-
-#ifdef DBG
-static direntry_t* get_direntry_for_mapping(BDRVVVFATState* s,mapping_t*
mapping)
-{
- if(mapping->mode==MODE_UNDEFINED)
- return 0;
- return
(direntry_t*)(s->directory.pointer+sizeof(direntry_t)*mapping->dir_index);
-}
-#endif
-
static int init_directories(BDRVVVFATState* s,
const char* dirname)
{
@@ -1137,25 +1123,6 @@ static inline mapping_t*
find_mapping_for_cluster(BDRVVVFATState* s,int cluster_
return mapping;
}
-/*
- * This function simply compares path == mapping->path. Since the mappings
- * are sorted by cluster, this is expensive: O(n).
- */
-static inline mapping_t* find_mapping_for_path(BDRVVVFATState* s,
- const char* path)
-{
- int i;
-
- for (i = 0; i < s->mapping.next; i++) {
- mapping_t* mapping = array_get(&(s->mapping), i);
- if (mapping->first_mapping_index < 0 &&
- !strcmp(path, mapping->path))
- return mapping;
- }
-
- return NULL;
-}
-
static int open_file(BDRVVVFATState* s,mapping_t* mapping)
{
if(!mapping)
@@ -1222,23 +1189,6 @@ read_cluster_directory:
}
#ifdef DEBUG
-static void hexdump(const void* address, uint32_t len)
-{
- const unsigned char* p = address;
- int i, j;
-
- for (i = 0; i < len; i += 16) {
- for (j = 0; j < 16 && i + j < len; j++)
- fprintf(stderr, "%02x ", p[i + j]);
- for (; j < 16; j++)
- fprintf(stderr, " ");
- fprintf(stderr, " ");
- for (j = 0; j < 16 && i + j < len; j++)
- fprintf(stderr, "%c", (p[i + j] < ' ' || p[i + j] > 0x7f) ? '.' :
p[i + j]);
- fprintf(stderr, "\n");
- }
-}
-
static void print_direntry(const direntry_t* direntry)
{
int j = 0;
@@ -2887,11 +2837,5 @@ static void checkpoint(void) {
direntry = array_get(&(vvv->directory), mapping->dir_index);
assert(!memcmp(direntry->name, "USB H ", 11) || direntry->name[0]==0);
#endif
- return;
- /* avoid compiler warnings: */
- hexdump(NULL, 100);
- remove_mapping(vvv, 0);
- print_mapping(NULL);
- print_direntry(NULL);
}
#endif
--
1.7.6.4
- [Qemu-devel] [PATCH 02/24] linux-aio: Fix laio_submit error handling, (continued)
- [Qemu-devel] [PATCH 02/24] linux-aio: Fix laio_submit error handling, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 03/24] block: Keep track of devices' I/O status, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 04/24] virtio: Support I/O status, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 05/24] ide: Support I/O status, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 07/24] QMP: query-status: Add 'io-status' key, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 08/24] HMP: Print 'io-status' information, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 09/24] block/vvfat: Fix potential memory leaks and other memory errors, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 06/24] scsi: Support I/O status, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 13/24] block: directly invoke .bdrv_* from emulation functions, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 11/24] vvfat: Fix potential buffer overflow, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 10/24] block/vvfat: Remove unused code,
Kevin Wolf <=
- [Qemu-devel] [PATCH 12/24] block: directly invoke .bdrv_aio_*() in bdrv_co_io_em(), Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 14/24] block: split out bdrv_co_do_readv() and bdrv_co_do_writev(), Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 15/24] block: switch bdrv_read()/bdrv_write() to coroutines, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 17/24] block: mark blocks dirty on coroutine write completion, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 16/24] block: switch bdrv_aio_readv() to coroutines, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 18/24] block: switch bdrv_aio_writev() to coroutines, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 19/24] linux-aio: Allow reads beyond the end of growable images, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 20/24] block: drop emulation functions that use coroutines, Kevin Wolf, 2011/10/14
- [Qemu-devel] [PATCH 23/24] block: drop .bdrv_read()/.bdrv_write() emulation, Kevin Wolf, 2011/10/14