bug-indent
[Top][All Lists]
Advanced

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

Indent and the Linux Kernel


From: J.R. Mauro
Subject: Indent and the Linux Kernel
Date: Wed, 8 Oct 2008 18:08:11 -0400

Hello,

The Linux kernel has a script called 'Lindent' which is a wrapper
around indent. It passes indent the following options: -npro -kr -i8
-ts8 -sob -l80 -ss -ncs -cp1, and for certain indent versions, -il0 as
well. I've been cleaning up some kernel code lately and I noticed a
problem with Lindent's suggestion about certain function prototypes.
Linux uses the sparse tool to do semantic analysis, but also to check
for proper usage of address spaces for pointers. The kernel defines
several macros, such as __user and __iomem. These define either to a
gcc __attibute__ macro or to nothing; they also act as a clue to
sparse as to what kind of pointer is being passed.

Now my problem is that indent as invoked by the Lindent script doesn't
understand this odd convention. When it sees something like fun(void
__iomem *ptr), it seems to think I'm multiplying or something and
tells me to change this to fun(void __iomem * ptr). Is there a way for
indent to understand that __iomem, __user, etc. are specifiers that it
should ignore? I didn't see anything immediately useful in the man
page.

Thanks,
~J.R.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]