lkml.org 
[lkml]   [2017]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 31/31] timer: Switch to testing for .function instead of .data
Date
On Friday, September 1, 2017 1:29:43 AM CEST Kees Cook wrote:
> In several places, .data is checked for initialization to gate early
> calls to del_timer_sync(). Checking for .function is equally valid, so
> switch to this in all callers.
>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Len Brown <len.brown@intel.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>
> Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
> Cc: Doug Ledford <dledford@redhat.com>
> Cc: Sean Hefty <sean.hefty@intel.com>
> Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Cc: linux-pm@vger.kernel.org
> Cc: linux-rdma@vger.kernel.org
> Cc: linux-input@vger.kernel.org
> Cc: intel-wired-lan@lists.osuosl.org
> Cc: netdev@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> drivers/base/power/wakeup.c | 3 +--
> drivers/infiniband/hw/hfi1/chip.c | 6 ++----
> drivers/infiniband/hw/hfi1/init.c | 2 +-
> drivers/infiniband/hw/qib/qib_iba7220.c | 2 +-
> drivers/infiniband/hw/qib/qib_iba7322.c | 2 +-
> drivers/infiniband/hw/qib/qib_init.c | 14 +++++---------
> drivers/infiniband/hw/qib/qib_mad.c | 2 +-
> drivers/input/input.c | 5 ++---
> drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
> 9 files changed, 15 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
> index 144e6d8fafc8..79a3c1b204af 100644
> --- a/drivers/base/power/wakeup.c
> +++ b/drivers/base/power/wakeup.c
> @@ -479,8 +479,7 @@ static bool wakeup_source_not_registered(struct wakeup_source *ws)
> * Use timer struct to check if the given source is initialized
> * by wakeup_source_add.
> */
> - return ws->timer.function != pm_wakeup_timer_fn ||
> - ws->timer.data != (unsigned long)ws;
> + return ws->timer.function != pm_wakeup_timer_fn;
> }
>
> /*

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

for the above.

Thanks!

\
 
 \ /
  Last update: 2017-09-02 15:57    [W:0.238 / U:5.372 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site