ubi: fastmap: Clean up the initialization of pointer p
authorColin Ian King <colin.king@canonical.com>
Sun, 29 Oct 2017 13:14:26 +0000 (13:14 +0000)
committerRichard Weinberger <richard@nod.at>
Wed, 17 Jan 2018 20:48:02 +0000 (21:48 +0100)
The pointer p is being initialized with one value and a few lines
later being set to a newer replacement value. Clean up the code by
using the latter assignment to p as the initial value. Cleans up
clang warning:

drivers/mtd/ubi/fastmap.c:217:19: warning: Value stored to 'p'
during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/ubi/fastmap.c

index 717db749808ab4bbdb4d94776c66c129096dd6ac..91705962ba7353c04e5a61fc2915e5a51a730e33 100644 (file)
@@ -214,9 +214,8 @@ static void assign_aeb_to_av(struct ubi_attach_info *ai,
                             struct ubi_ainf_volume *av)
 {
        struct ubi_ainf_peb *tmp_aeb;
-       struct rb_node **p = &ai->volumes.rb_node, *parent = NULL;
+       struct rb_node **p = &av->root.rb_node, *parent = NULL;
 
-       p = &av->root.rb_node;
        while (*p) {
                parent = *p;