lkml.org 
[lkml]   [2009]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86, apicdef: Fix checkpatch issues in apicdef.h
On Sat, 31 Oct 2009, Cyrill Gorcunov wrote:

> [Cyrill Gorcunov - Sat, Oct 31, 2009 at 12:44:31PM +0300]
> | [Rakib Mullick - Sat, Oct 31, 2009 at 03:29:32PM +0600]
> | |
> | | In apicdef.h - we have a checkpatch issue - needs to be fixed.
> | | We were warned by the following checkpatch warning:
> | |
> | | ERROR: space prohibited before that ':' (ctx:WxW)
> | | #276: FILE: arch/x86/include/asm/apicdef.h:376:
> | | + hi : 1;
> | | ^
> | | ---
> | | Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
> | |
> |
> | personally I would not change it even having checkpatch
> | issue. Really, it's easier to read this bitfield width
> | aligned rather then moved left. But this is a personal
> | opinion only (sorry).

I agree -- don't fix what ain't broke!

> On the other hands -- I wonder if we need this structure
> at all. Perhaps there was an idea to use it with suspend/resume
> actions? Ingo, Maciej, Yinghai?

The existence of this structure is purely documentary as it's considered
unsafe to map device registers using bitfields -- first: the C language
standard does not guarantee the layout of bitfield struct members, second:
the compiler may choose to use machine instructions such as BT that are
unsafe for MMIO, so all accesses should be made via the appropriate
accessors.

Then even as such, the contents are out of date and as such may be
misleading, especially to the newcomers, so I think the choice is either
to fix the declarations or to dump them altogether and given I couldn't be
bothered to do the former, my vote is for the latter.

Maciej


\
 
 \ /
  Last update: 2009-11-04 00:37    [W:0.426 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site