All of lore.kernel.org
 help / color / mirror / Atom feed
From: justin.skists@juzza.co.uk (Justin Skists)
To: kernelnewbies@lists.kernelnewbies.org
Subject: policy on externs
Date: Sat, 2 Jun 2018 18:43:31 +0100	[thread overview]
Message-ID: <20180602174331.GA13913@tanglefoot> (raw)
In-Reply-To: <20180602173346.GA21838@kroah.com>

On Sat, Jun 02, 2018 at 07:33:46PM +0200, Greg KH wrote:
> On Sat, Jun 02, 2018 at 05:23:20PM +0100, Justin Skists wrote:
> > Hi,
> > 
> > What is the kernel policy on using "extern" to share variables between
> > source files in a module?
> > 
> > I've been looking at one subsystem in staging [that shares variables quite a
> > bit] to becoming familar with it, and seeing if I can help do some work on it
> > in my free time.
> > 
> > Personally I prefer to see them eradicated (they polute the namespace), and
> > store such variables in a context structure that is passed around. But I don't
> > see any reference about it in the coding style, and I am not one to
> > code-churn just because it's not my personal style! :)
> 
> context structures are almost always best, as they can be tied to the
> hardware device, not the module itself.  So yes, if they can be
> eradicated, please do so.

OK, Greg. I'll have another look at it, then.

> What driver are you looking at?

I have been looking at the speakup subsystem.


Thanks,
Justin.

      reply	other threads:[~2018-06-02 17:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-02 16:23 policy on externs Justin Skists
2018-06-02 17:33 ` Greg KH
2018-06-02 17:43   ` Justin Skists [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=20180602174331.GA13913@tanglefoot \
    --to=justin.skists@juzza.co.uk \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /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.