Return-path: Received: from mail-ig0-f179.google.com ([209.85.213.179]:38902 "EHLO mail-ig0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965753AbcBRAz4 (ORCPT ); Wed, 17 Feb 2016 19:55:56 -0500 MIME-Version: 1.0 In-Reply-To: <20160217123336.GA30230@amitoj-Inspiron-3542> References: <20160217123336.GA30230@amitoj-Inspiron-3542> From: Julian Calaby Date: Thu, 18 Feb 2016 11:55:36 +1100 Message-ID: (sfid-20160218_015621_880682_B4CF9514) Subject: Re: [PATCH] mwifiex: Use to_delayed_work() To: Amitoj Kaur Chawla Cc: Amitkumar Karwar , Nishant Sarmukadam , Kalle Valo , linux-wireless , netdev , "linux-kernel@vger.kernel.org" , Julia Lawall Content-Type: text/plain; charset=UTF-8 Sender: linux-wireless-owner@vger.kernel.org List-ID: Hi All, On Wed, Feb 17, 2016 at 11:33 PM, Amitoj Kaur Chawla wrote: > Introduce the use of to_delayed_work() helper function instead of open > coding it with container_of() > > A simplified version of the Coccinelle semantic patch used to make > this change is: > > // > @@ > expression a; > symbol work; > @@ > - container_of(a, struct delayed_work, work) > + to_delayed_work(a) > // > > Signed-off-by: Amitoj Kaur Chawla Looks right to me. Reviewed-by: Julian Calaby Thanks, > --- > drivers/net/wireless/marvell/mwifiex/11h.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/wireless/marvell/mwifiex/11h.c b/drivers/net/wireless/marvell/mwifiex/11h.c > index 71a1b58..81c60d0 100644 > --- a/drivers/net/wireless/marvell/mwifiex/11h.c > +++ b/drivers/net/wireless/marvell/mwifiex/11h.c > @@ -123,8 +123,7 @@ void mwifiex_11h_process_join(struct mwifiex_private *priv, u8 **buffer, > void mwifiex_dfs_cac_work_queue(struct work_struct *work) > { > struct cfg80211_chan_def chandef; > - struct delayed_work *delayed_work = > - container_of(work, struct delayed_work, work); > + struct delayed_work *delayed_work = to_delayed_work(work); > struct mwifiex_private *priv = > container_of(delayed_work, struct mwifiex_private, > dfs_cac_work); > @@ -289,8 +288,7 @@ int mwifiex_11h_handle_radar_detected(struct mwifiex_private *priv, > void mwifiex_dfs_chan_sw_work_queue(struct work_struct *work) > { > struct mwifiex_uap_bss_param *bss_cfg; > - struct delayed_work *delayed_work = > - container_of(work, struct delayed_work, work); > + struct delayed_work *delayed_work = to_delayed_work(work); > struct mwifiex_private *priv = > container_of(delayed_work, struct mwifiex_private, > dfs_chan_sw_work); > -- > 1.9.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Julian Calaby Email: julian.calaby@gmail.com Profile: http://www.google.com/profiles/julian.calaby/