All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Gargi Sharma <gs051095@gmail.com>
Cc: Alison Schofield <amsfield22@gmail.com>,
	 Julia Lawall <julia.lawall@lip6.fr>,
	outreachy-kernel@googlegroups.com,  lars@metafoo.de,
	Michael.Hennerich@analog.com, jic23@kernel.org,  knaack.h@gmx.de,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	 linux-iio@vger.kernel.org
Subject: Re: [Outreachy kernel] [PATCH] staging: iio: adc: Replace mlock with driver private lock
Date: Mon, 13 Mar 2017 21:40:43 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1703132138040.4053@hadrien> (raw)
In-Reply-To: <CAOCi2DEyu6_bBjsrSFzf0VcXcUnZ3LugLf==R9zsSmj+1JdFKw@mail.gmail.com>

> > I like the automated editing because it certainly cuts down on typos,
> > and even with this one, you can just move the new lock field upon
> > inspection.  Sadly, I don't think the script will apply too widely
> > because the use of "_state" for driver global data isn't a standard,
> > nor availability of that struct in the functions needing the locking.
> I only saw three files that had the mlock and they followed the structure
> with _state as suffix and only had mutex_lock for &indio_dev->mlock.
> Hence, I went ahead with the script even though I knew it wasn't probably
> very safe.

If _state is useful, you can add a regular expression to the metavariable declaration to checkk for that.  I think it would be something like:

identifier x =~ "_state$";

but I don't actually know.  I would prefer to use some more semantic
concept to identify such a structure.  For example, structures are often
stored in other structures or passed to some generic function.  Then you
can get to the structure in a way that is based on its purpose rather than
its name.

julia


  reply	other threads:[~2017-03-13 20:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-12 20:45 [PATCH] staging: iio: adc: Replace mlock with driver private lock Gargi Sharma
2017-03-12 20:56 ` [Outreachy kernel] " Julia Lawall
2017-03-12 21:33   ` Gargi Sharma
2017-03-12 21:37     ` Julia Lawall
2017-03-12 22:13       ` Alison Schofield
2017-03-12 22:27         ` Julia Lawall
2017-03-13  8:41           ` Gargi Sharma
2017-03-15  9:44             ` Julia Lawall
2017-03-13  8:40         ` Gargi Sharma
2017-03-13 20:40           ` Julia Lawall [this message]
2017-03-13 20:50             ` Jonathan Cameron
2017-03-13 21:09               ` Julia Lawall
2017-03-13 20:51           ` Jonathan Cameron
2017-03-13 20:54             ` Lars-Peter Clausen
2017-03-13 21:25               ` Jonathan Cameron
2017-03-14 17:36               ` Gargi Sharma
2017-03-14 17:36                 ` Gargi Sharma
2017-03-14 22:44                 ` Jonathan Cameron
2017-03-14 22:44                   ` Jonathan Cameron
2017-03-15 18:15                   ` Gargi Sharma
2017-03-16 17:41                     ` Alison Schofield
2017-03-16 17:45                       ` Alison Schofield

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=alpine.DEB.2.20.1703132138040.4053@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=Michael.Hennerich@analog.com \
    --cc=amsfield22@gmail.com \
    --cc=gs051095@gmail.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=pmeerw@pmeerw.net \
    /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.