Re: [PATCH] dissect: use built_in_ident() instead of MK_IDENT()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux