Re: [RFC PATCH 01/20] Create generic alignment API (v8)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Steven Rostedt
Date: Tuesday, August 17, 2010 - 6:25 pm

On Tue, 2010-08-17 at 19:16 -0400, Mathieu Desnoyers wrote:


Hmm, I wonder if we should add a compiler bug here too.

extern void __bug_obj_not_power_of_two(void);

({
	if ((sizeof(*obj) - 1) & sizeof(*obj))
		__bug_obj_not_power_of_two();
	PTR_ALIGN((obj), __alignof__(*(obj)));
})


I take it that theses functions can have variables passed to it for
alignment, thus a check wont help. Although, we could add a test for the
constant case.

-- Steve



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC PATCH 00/20] Generic Ring Buffer Library (v2), Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
[RFC PATCH 01/20] Create generic alignment API (v8), Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
[RFC PATCH 02/20] Notifier atomic call chain notrace, Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
[RFC PATCH 05/20] Poll : add poll_wait_set_exclusive, Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
[RFC PATCH 07/20] kthread: Add kthread_kill_stop(), Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
[RFC PATCH 09/20] x86: inline memcpy, Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
[RFC PATCH 10/20] Trace clock - build standalone, Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
[RFC PATCH 11/20] Ftrace ring buffer renaming (v2), Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
[RFC PATCH 12/20] Ring buffer backend, Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
[RFC PATCH 13/20] Ring buffer frontend, Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
[RFC PATCH 14/20] Ring buffer library - documentation (v2), Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
[RFC PATCH 15/20] Ring buffer library - VFS operations (v2), Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
[RFC PATCH 16/20] Ring buffer library - client sample, Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
[RFC PATCH 17/20] Ring buffer benchmark library, Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
[RFC PATCH 18/20] Ring buffer record iterator, Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
[RFC PATCH 19/20] Ring buffer library: basic API (v2), Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
[RFC PATCH 20/20] Ring buffer: benchmark simple API (v2), Mathieu Desnoyers, (Tue Aug 17, 4:16 pm)
Re: [RFC PATCH 01/20] Create generic alignment API (v8), Kirill A. Shutemov, (Tue Aug 17, 5:00 pm)
Re: [RFC PATCH 01/20] Create generic alignment API (v8), Mathieu Desnoyers, (Tue Aug 17, 6:05 pm)
Re: [RFC PATCH 01/20] Create generic alignment API (v8), Steven Rostedt, (Tue Aug 17, 6:25 pm)
Re: [RFC PATCH 01/20] Create generic alignment API (v8), Mathieu Desnoyers, (Tue Aug 17, 7:09 pm)