SHA256
1
0
forked from pool/cryptsetup
cryptsetup/cryptsetup-luks-warnings.diff

75 lines
2.0 KiB
Diff

fix some gcc warnings
From: Ludwig Nussel <ludwig.nussel@suse.de>
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
---
lib/libdevmapper.c | 2 +-
lib/setup.c | 2 --
lib/utils.c | 4 ++--
luks/keymanage.c | 2 +-
4 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/lib/libdevmapper.c b/lib/libdevmapper.c
index 888b689..676064a 100644
--- a/lib/libdevmapper.c
+++ b/lib/libdevmapper.c
@@ -258,7 +258,7 @@ static int dm_query_device(int details, struct crypt_options *options,
options->skip = 0;
options->size = length;
if (details) {
- char *cipher, *key_, *device, *tmp;
+ char *cipher, *key_, *device;
uint64_t val64;
set_error("Invalid dm table");
diff --git a/lib/setup.c b/lib/setup.c
index 0429b33..5b85bd6 100644
--- a/lib/setup.c
+++ b/lib/setup.c
@@ -56,8 +56,6 @@ static int setup_enter(struct setup_backend *backend)
static int setup_leave(struct setup_backend *backend)
{
- const char *error;
-
if (backend)
backend->exit();
diff --git a/lib/utils.c b/lib/utils.c
index 718d418..fbf34bc 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -174,7 +174,7 @@ ssize_t write_blockwise(int fd, const void *orig_buf, size_t count)
{
char *padbuf; char *padbuf_base;
char *buf = (char *)orig_buf;
- int r;
+ int r = 0;
int hangover; int solid; int bsize;
if ((bsize = sector_size(fd)) < 0)
@@ -214,7 +214,7 @@ ssize_t write_blockwise(int fd, const void *orig_buf, size_t count)
ssize_t read_blockwise(int fd, void *orig_buf, size_t count) {
char *padbuf; char *padbuf_base;
char *buf = (char *)orig_buf;
- int r;
+ int r = 0;
int step;
int bsize;
diff --git a/luks/keymanage.c b/luks/keymanage.c
index 77d8414..8b07458 100644
--- a/luks/keymanage.c
+++ b/luks/keymanage.c
@@ -420,7 +420,7 @@ static int wipe(const char *device, unsigned int from, unsigned int to)
int LUKS_del_key(const char *device, unsigned int keyIndex)
{
struct luks_phdr hdr;
- unsigned int i, startOffset, endOffset, stripesLen;
+ unsigned int startOffset, endOffset, stripesLen;
int r;
r = LUKS_read_phdr(device, &hdr);