lkml.org 
[lkml]   [2015]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V3 0/4] Reducing parameters of alloc_pages* family of functions
From
On Mon, Jan 5, 2015 at 8:01 AM, Vlastimil Babka <vbabka@suse.cz> wrote:
>
> Hm, nope. The !CONFIG_COMPACTION variant of try_to_compact_pages() is static
> inline that returns COMPACT_CONTINUE, which is defined in compaction.h.
> Another solution is to add a "forward" declaration (not actually followed later
> by a full definition) of struct alloc_context into compaction.h. Seems to work
> here, but I'm not sure if such thing is allowed?

We do forward struct declarations quite often (well, _relatively_
often) in order to avoid nasty circular header includes, and sometimes
just to avoid unnecessarily many header includes.

See for example

git grep '\<struct [a-zA-Z_0-9]*;'

it's not exactly rare.

So it's fine.

Linus


\
 
 \ /
  Last update: 2015-01-07 06:01    [W:0.045 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site