• Arnd Bergmann's avatar
    libceph: fix clang warning for CEPH_DEFINE_OID_ONSTACK · 0384892c
    Arnd Bergmann authored
    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: default avatarArnd Bergmann <arnd@arndb.de>
    Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
    Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
    0384892c
osdmap.h 8.13 KB