lkml.org 
[lkml]   [2019]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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

\
 
 \ /
  Last update: 2019-03-22 16:08    [W:0.052 / U:0.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site