aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2017-11-02 00:50:27 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2017-11-02 01:14:34 +0100
commit81fd176a6b4958147302ef900f2651c476a3d4e7 (patch)
tree33ddc341f5635c89df17dd9d33bd7c0b45e73170
parent3b421ab6144c661893e555d70b0c75608eb6a090 (diff)
Remove self-assignments of unused paramters
Use casts to void instead. Clang generates warnings about that by default. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--lib/libubi.c16
-rw-r--r--ubifs-utils/mkfs.ubifs/key.h2
2 files changed, 8 insertions, 10 deletions
diff --git a/lib/libubi.c b/lib/libubi.c
index dcf6337..b50e68a 100644
--- a/lib/libubi.c
+++ b/lib/libubi.c
@@ -835,8 +835,7 @@ int ubi_detach(libubi_t desc, const char *node, const char *mtd_dev_node)
int ubi_remove_dev(libubi_t desc, const char *node, int ubi_dev)
{
int fd, ret;
-
- desc = desc;
+ (void)desc;
fd = open(node, O_RDONLY);
if (fd == -1)
@@ -993,10 +992,10 @@ int ubi_mkvol(libubi_t desc, const char *node, struct ubi_mkvol_request *req)
int fd, ret;
struct ubi_mkvol_req r;
size_t n;
+ (void)desc;
memset(&r, 0, sizeof(struct ubi_mkvol_req));
- desc = desc;
r.vol_id = req->vol_id;
r.alignment = req->alignment;
r.bytes = req->bytes;
@@ -1009,7 +1008,6 @@ int ubi_mkvol(libubi_t desc, const char *node, struct ubi_mkvol_request *req)
strncpy(r.name, req->name, UBI_MAX_VOLUME_NAME + 1);
r.name_len = n;
- desc = desc;
fd = open(node, O_RDONLY);
if (fd == -1)
return sys_errmsg("cannot open \"%s\"", node);
@@ -1029,8 +1027,8 @@ int ubi_mkvol(libubi_t desc, const char *node, struct ubi_mkvol_request *req)
int ubi_rmvol(libubi_t desc, const char *node, int vol_id)
{
int fd, ret;
+ (void)desc;
- desc = desc;
fd = open(node, O_RDONLY);
if (fd == -1)
return sys_errmsg("cannot open \"%s\"", node);
@@ -1049,8 +1047,8 @@ int ubi_rmvol(libubi_t desc, const char *node, int vol_id)
int ubi_rnvols(libubi_t desc, const char *node, struct ubi_rnvol_req *rnvol)
{
int fd, ret;
+ (void)desc;
- desc = desc;
fd = open(node, O_RDONLY);
if (fd == -1)
return -1;
@@ -1070,8 +1068,8 @@ int ubi_rsvol(libubi_t desc, const char *node, int vol_id, long long bytes)
{
int fd, ret;
struct ubi_rsvol_req req;
+ (void)desc;
- desc = desc;
fd = open(node, O_RDONLY);
if (fd == -1)
return sys_errmsg("cannot open \"%s\"", node);
@@ -1096,7 +1094,7 @@ int ubi_vol_block_remove(int fd)
int ubi_update_start(libubi_t desc, int fd, long long bytes)
{
- desc = desc;
+ (void)desc;
if (ioctl(fd, UBI_IOCVOLUP, &bytes))
return -1;
return 0;
@@ -1105,8 +1103,8 @@ int ubi_update_start(libubi_t desc, int fd, long long bytes)
int ubi_leb_change_start(libubi_t desc, int fd, int lnum, int bytes)
{
struct ubi_leb_change_req req;
+ (void)desc;
- desc = desc;
memset(&req, 0, sizeof(struct ubi_leb_change_req));
req.lnum = lnum;
req.bytes = bytes;
diff --git a/ubifs-utils/mkfs.ubifs/key.h b/ubifs-utils/mkfs.ubifs/key.h
index cd4b849..c16d0a8 100644
--- a/ubifs-utils/mkfs.ubifs/key.h
+++ b/ubifs-utils/mkfs.ubifs/key.h
@@ -64,8 +64,8 @@ static inline uint32_t key_r5_hash(const char *s, int len)
{
uint32_t a = 0;
const signed char *str = (const signed char *)s;
+ (void)len;
- len = len;
while (*str) {
a += *str << 4;
a += *str >> 4;