lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 14 Aug 2009 08:20:54 -0700
From:	Joe Perches <joe@...ches.com>
To:	Stefani Seibold <stefani@...bold.net>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Arnd Bergmann <arnd@...db.de>,
	Andi Kleen <andi@...stfloor.org>,
	Amerigo Wang <xiyou.wangcong@...il.com>
Subject: Re: [PATCH 4/6] new kfifo API v0.3 - add DEFINE_KFIFO and friends,
 add very tiny functions

On Fri, 2009-08-14 at 13:44 +0200, Stefani Seibold wrote:

Couple of trivial comments

> This is patch 4/6 of the new kfifo API:
>  Add KFIFO_INIT - macro to generate a kfifo initializer

Is it really necessary to use KFIFO_INIT and INIT_KFIFO?
I think it'll cause confusion and misuse.

> Add INIT_KFIFO - macro to initialize a with DECLARE_KFIFO declared kfifo 

What does the description mean?

> Add DEFINE_KFIFO - macro to define and initialize a kfifo as a global or local object

What does this mean?  Is scope relevant to the macro?

I think you should mention somewhere that these macros
actually define 2 objects.  "name##_buffer" might have
unexpected clashes and be prefixed with kfifo.
maybe something like "kfifo_##name##_buffer"?

> + * KFIFO_INIT - macro to generate a kfifo initializer
> + * @s: size of the fifo buffer
> + * @b: address of the fifo buffer
> + */
> +#define KFIFO_INIT(s, b) \
> +	(struct kfifo) { \
> +		.size	= s, \
> +		.in	= 0, \
> +		.out	= 0, \
> +		.buffer = b \
> +	}

> +/**
> + * INIT_KFIFO - macro to initialize a with DECLARE_KFIFO declared kfifo
> + * @name: name of the declared kfifo datatype
> + * @size: size of the fifo buffer
> + */
> +#define INIT_KFIFO(name) \
> +	name = KFIFO_INIT(sizeof(name##_buffer) - sizeof(struct kfifo), \
> +				name##_buffer)

Perhaps

#define __kfifo_initializer ?


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ