All of lore.kernel.org
 help / color / mirror / Atom feed
* Clean-up idea: IIO Headers
@ 2017-02-25  1:42 Alison Schofield
  2017-02-25  5:27 ` [Outreachy kernel] " Katie Dunne
  2017-02-27 17:56 ` Alison Schofield
  0 siblings, 2 replies; 6+ messages in thread
From: Alison Schofield @ 2017-02-25  1:42 UTC (permalink / raw)
  To: outreachy-kernel

Hi Outreachy Applicants,

Here is a clean-up task for staging/iio you might like to try.

Staging IIO Header file (re-)organization:

Guidelines to follow:

(Reference  https://kernelnewbies.org/KernelHeaders)

Three cases you may find:
1) If it's a single source file, its header info should be in that source file.
   *** Do this!

2) Interfaces between source files in a single module can have a header file
   in same dir as the source files.
   *** Leave this alone.

3) Interfaces shared between modules go in a header file in include/linux/iio
   *** Leave this alone. We will do this when the driver is moving out of
	staging 

Here's an example patchset:
https://groups.google.com/forum/#!searchin/outreachy-kernel/header$20file$20ad5933%7Csort:relevance/outreachy-kernel/THYpgGyOgsI/iz8lrqwfDAAJ

Note that when you pull the header file in, there's a customary order to it
that the drivers in staging may not be following.  In the example one above,
I moved the #defines to be before the chip structure definitions.  So, you'll
do best if you look at similar drivers in the same directory upstream, to
see how they order their header information.  Always good to look at a few,
because one may not be the perfect role model.  

It is customary to alphabetize the #includes, and to separate the kernel
and IIO subsystem #includes with a blank line.  So, although we wouldn't
send in a patch just to alphabetize #includes, while you are moving them
to the .c file, and while you are checking that they are actually needed,
sure - go ahead and alphabetize them.  (Example patch didn't alphabetize,
you'll do better ;)
 
To verify the patch(set), I'd suggest applying it to a clean tree and
rebuilding.  

Questions?  Just ask on this thread.

alisons


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-02-27 17:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-25  1:42 Clean-up idea: IIO Headers Alison Schofield
2017-02-25  5:27 ` [Outreachy kernel] " Katie Dunne
2017-02-25 18:23   ` Alison Schofield
2017-02-26 19:01     ` Katie Dunne
2017-02-26 21:06       ` Alison Schofield
2017-02-27 17:56 ` Alison Schofield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.