All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
To: Jes Sorensen <jes.sorensen@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH v2] staging: comedi: drivers: replace init_timer by setup_timer
Date: Thu, 19 Feb 2015 01:52:47 +0200	[thread overview]
Message-ID: <20150218235247.GA13870@localhost.localdomain> (raw)
In-Reply-To: <54E51186.9080302@gmail.com>

On Wed, Feb 18, 2015 at 05:26:14PM -0500, Jes Sorensen wrote:
> On 02/18/15 13:29, Aya Mahfouz wrote:
> > This patch replaces init_timer and 2 step initialization of
> > function and data by setup_timer to make the code 
> > more concise using the following coccinelle script:
> > 
> > @@
> > expression ds, e1, e2;
> > @@
> > 
> > -init_timer (&ds);
> > +setup_timer (&ds, e1, e2);
> > ...
> > -ds.function = e1;
> > ...
> > -ds.data = e2;
> > 
> > 
> > Acked-by: Julia Lawall <julia.lawall@lip6.fr>
> > Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
> > ---
> > v2: changed commit message and picked Julia'a ack
> 
> Looks good to me - the only minor issue is the commit message. I would
> make it say:
> 
> "
> This patch replaces init_timer and 2 step initialization of function and
> data by setup_timer to make the code  more concise.
> 
> The issue was discovered using the following coccinelle script:
> "
> 
> Cheers,
> Jes
> 
Thanks will do!

Kind Regards,
Aya Saif El-yazal Mahfouz

> >  drivers/staging/comedi/drivers/comedi_test.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c
> > index e56525a..fbc4342 100644
> > --- a/drivers/staging/comedi/drivers/comedi_test.c
> > +++ b/drivers/staging/comedi/drivers/comedi_test.c
> > @@ -420,9 +420,8 @@ static int waveform_attach(struct comedi_device *dev,
> >  	for (i = 0; i < s->n_chan; i++)
> >  		devpriv->ao_loopbacks[i] = s->maxdata / 2;
> >  
> > -	init_timer(&devpriv->timer);
> > -	devpriv->timer.function = waveform_ai_interrupt;
> > -	devpriv->timer.data = (unsigned long)dev;
> > +	setup_timer(&devpriv->timer, waveform_ai_interrupt,
> > +		    (unsigned long)dev);
> >  
> >  	dev_info(dev->class_dev,
> >  		 "%s: %i microvolt, %li microsecond waveform attached\n",
> > 
> 


      reply	other threads:[~2015-02-18 23:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-18 18:29 [PATCH v2] staging: comedi: drivers: replace init_timer by setup_timer Aya Mahfouz
2015-02-18 22:26 ` [Outreachy kernel] " Jes Sorensen
2015-02-18 23:52   ` Aya Mahfouz [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=20150218235247.GA13870@localhost.localdomain \
    --to=mahfouz.saif.elyazal@gmail.com \
    --cc=jes.sorensen@gmail.com \
    --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.