]> www.infradead.org Git - mtd-utils.git/commitdiff
Remove self-assignments of unused paramters
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Wed, 1 Nov 2017 23:50:27 +0000 (00:50 +0100)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Thu, 2 Nov 2017 00:14:34 +0000 (01:14 +0100)
Use casts to void instead. Clang generates warnings about that by
default.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
lib/libubi.c
ubifs-utils/mkfs.ubifs/key.h

index dcf6337cff31e693fa229a62aadb2139594ad879..b50e68a309a85239088452ad1318462cd9831e05 100644 (file)
@@ -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;
index cd4b849f3bf43b151ccbab43821100c852fb4e0c..c16d0a85418e3837402526064f0a41a87a42cfbd 100644 (file)
@@ -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;