All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: linux-sparse@vger.kernel.org, Chris Li <sparse@chrisli.org>
Subject: Re: [PATCH] dissect: use built_in_ident() instead of MK_IDENT()
Date: Tue, 20 Jun 2017 18:56:33 +0200	[thread overview]
Message-ID: <20170620165633.GA26352@redhat.com> (raw)
In-Reply-To: <20170620163950.gkdezvohrcz7okoo@ltop.local>

On 06/20, Luc Van Oostenryck wrote:
>
> On Tue, Jun 20, 2017 at 06:07:11PM +0200, Oleg Nesterov wrote:
> > Hmm. Now that I git-cloned the code I understand. And I can't recall why MK_IDENT() was
> > written this way, it simply doesn't look right.
>
> It looks to me as you simply wanted to avoid doing dynamic allocation
> and/or the cost of the hashing.

This is clear ;) what is not clear is why I didn't do, say,

	#define	MK_IDENT(s)	({				\
		static struct {					\
			struct ident ident;			\
			char name[sizeof(s)];			\
		} ident = {					\
			.ident.len  = sizeof(s)-1,		\
			.name = s,				\
		};						\
		&ident.ident;					\
	})

probably because I wanted to avoid __attribute__((packed)) in struct ident,
not sure.

> > Probably can be fixed but I agree, lets
> > remove it.
>
> Probably yes, but yes btter to remove it.

Agreed.

Oleg.


      reply	other threads:[~2017-06-20 16:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-19 21:14 [PATCH] dissect: use built_in_ident() instead of MK_IDENT() Luc Van Oostenryck
2017-06-19 22:35 ` Ramsay Jones
2017-06-19 22:42   ` Luc Van Oostenryck
2017-06-20 11:17 ` Oleg Nesterov
2017-06-20 12:53   ` Luc Van Oostenryck
2017-06-20 16:07     ` Oleg Nesterov
2017-06-20 16:39       ` Luc Van Oostenryck
2017-06-20 16:56         ` Oleg Nesterov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170620165633.GA26352@redhat.com \
    --to=oleg@redhat.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=sparse@chrisli.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.