Messages in this thread | | | From | Arnd Bergmann <> | Date | Fri, 22 Mar 2019 16:07:50 +0100 | Subject | Re: [PATCH] ceph: fix clang warning for CEPH_DEFINE_OID_ONSTACK |
| |
On Fri, Mar 22, 2019 at 3:40 PM Ilya Dryomov <idryomov@gmail.com> wrote: > > On Fri, Mar 22, 2019 at 3:08 PM Arnd Bergmann <arnd@arndb.de> wrote: > > Hi Arnd, > > I don't like this because the initialization is no longer contained to > ceph_oid_init(). Now there are two things to patch instead of one. > > How is this going to be fixed in other places?
The only other warning like this that I encountered was in DECLARE_WAIT_QUEUE_HEAD_ONSTACK().
So far, I have no idea for how to solve it, other than disabling CONFIG_LOCKDEP when clang is used.
Would you prefer this version?
#define CEPH_OID_INITIALIZER(oid) { .name = (oid).inline_name } #define CEPH_DEFINE_OID_ONSTACK(oid) \ struct ceph_object_id oid = CEPH_OID_INITIALIZER(oid)
static inline void ceph_oid_init(struct ceph_object_id *oid) { *oid = (struct ceph_object_id)CEPH_OID_INITIALIZER(*oid); }
Arnd
| |