]> asedeno.scripts.mit.edu Git - linux.git/commit
libceph: fix clang warning for CEPH_DEFINE_OID_ONSTACK
authorArnd Bergmann <arnd@arndb.de>
Mon, 25 Mar 2019 12:51:43 +0000 (13:51 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 7 May 2019 17:22:37 +0000 (19:22 +0200)
commit0384892c2d839033566b53453be44b1f5812cd00
tree374fbec45b4a5e9aac08a76a3749ed084687a771
parent1680937266587906138752c2dfc80a45adb774c7
libceph: fix clang warning for CEPH_DEFINE_OID_ONSTACK

clang complains about assigning a variable to itself during the
declaration:

fs/ceph/ioctl.c:187:26: error: variable 'oid' is uninitialized when used within its own initialization [-Werror,-Wuninitialized]
        CEPH_DEFINE_OID_ONSTACK(oid);
                                ^~~
include/linux/ceph/osdmap.h:122:52: note: expanded from macro 'CEPH_DEFINE_OID_ONSTACK'
        struct ceph_object_id oid = CEPH_OID_INIT_ONSTACK(oid)
                              ~~~                         ^~~
include/linux/ceph/osdmap.h:120:29: note: expanded from macro 'CEPH_OID_INIT_ONSTACK'
    ({ ceph_oid_init(&oid); oid; })
                            ^~~

We use this trick in other places, but it is completely unnecessary
here, as we can just use a regular struct initializer.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
include/linux/ceph/osdmap.h