All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alison Schofield <amsfield22@gmail.com>
To: outreachy-kernel@googlegroups.com
Cc: lars@metafoo.de
Subject: Re: Clean-up idea: IIO Headers
Date: Mon, 27 Feb 2017 09:56:14 -0800	[thread overview]
Message-ID: <20170227175613.GC1549@d830.WORKGROUP> (raw)
In-Reply-To: <20170225014231.GA3395@d830.WORKGROUP>

On Fri, Feb 24, 2017 at 05:42:40PM -0800, Alison Schofield wrote:
> 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!

Update - (thanks Lars)

The platform data struct needs to stay in the separate header file until
the driver is moved out of staging.  If this is your case, you can move
the other contents but will need to leave the platform data in the .h
file. When the driver is moved out of staging the header will go into
the global include/linux/platform_data/ folder.

You can see examples of this in the outreachy mailing list already.

> 
> 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


      parent reply	other threads:[~2017-02-27 17:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170227175613.GC1549@d830.WORKGROUP \
    --to=amsfield22@gmail.com \
    --cc=lars@metafoo.de \
    --cc=outreachy-kernel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.