netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: Dmitry <dbaryshkov@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] RFKILL: fix input layer initialisation
Date: Fri, 20 Jun 2008 21:23:15 +0200	[thread overview]
Message-ID: <200806202123.15939.IvDoorn@gmail.com> (raw)
In-Reply-To: <bc64b4640806191528g67ec856av7caf886e8e7c1975@mail.gmail.com>

On Friday 20 June 2008, Dmitry wrote:
> Hi,
> 
> 2008/6/19 Ivo van Doorn <ivdoorn@gmail.com>:
> > On Thursday 19 June 2008, Dmitry Baryshkov wrote:
> >> Initialise correctly last fields, so tasks can be actually executed
> >>
> >> Also move rfkill-input initialisation to subsys level so that it's
> >> available before generic drivers probing occurs.
> >>
> >> Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
> >> ---
> >>  net/rfkill/rfkill-input.c |    7 ++++++-
> >>  1 files changed, 6 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/net/rfkill/rfkill-input.c b/net/rfkill/rfkill-input.c
> >> index e4b051d..e4540fc 100644
> >> --- a/net/rfkill/rfkill-input.c
> >> +++ b/net/rfkill/rfkill-input.c
> >> @@ -181,6 +181,11 @@ static struct input_handler rfkill_handler = {
> >>
> >>  static int __init rfkill_handler_init(void)
> >>  {
> >> +     unsigned long last_run = jiffies - msecs_to_jiffies(500);
> >> +     rfkill_wlan.last = last_run;
> >> +     rfkill_bt.last = last_run;
> >> +     rfkill_uwb.last = last_run;
> >> +     rfkill_wimax.last = last_run;
> >
> > I'm not really fan of this approach
> > Can't this not be done someway in the DEFINE_RFKILL_TASK macro
> > where the entire structure is initialized?
> > That way it will automatically be set for all new rfkill task structures later.
> 
> IMHO it can't. the jiffies - mset_to_jiffies isn't a constant
> initialiser; gcc won't permit such a thing

True, but can't we make it a function then? rfkill_init_task() or something.
If we group the initialization steps as closely together as possible it will
make it easier to add new tasks later.

> >>       return input_register_handler(&rfkill_handler);
> >>  }
> >>
> >> @@ -190,5 +195,5 @@ static void __exit rfkill_handler_exit(void)
> >>       flush_scheduled_work();
> >>  }
> >>
> >> -module_init(rfkill_handler_init);
> >> +subsys_initcall(rfkill_handler_init);
> >>  module_exit(rfkill_handler_exit);
> >
> > This sounds good.
> >
> > Ivo
> >
> 
> 
> 



  reply	other threads:[~2008-06-20 19:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-19 11:28 [PATCH] RFKILL: fix input layer initialisation Dmitry Baryshkov
2008-06-19 18:49 ` Ivo van Doorn
2008-06-19 22:28   ` Dmitry
2008-06-20 19:23     ` Ivo van Doorn [this message]
2008-06-23 13:22 ` Dmitry Torokhov
2008-06-23 14:40   ` Dmitry Baryshkov
2008-06-23 15:24     ` Dmitry Torokhov
2008-06-23 18:21       ` Henrique de Moraes Holschuh
2008-06-23 18:25         ` Dmitry

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=200806202123.15939.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=dbaryshkov@gmail.com \
    --cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).