All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jes Sorensen <jes.sorensen@gmail.com>
To: Vaishali Thakkar <vthakkar1994@gmail.com>,
	 outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH v2] Staging: rtl8712: Use mod_timer
Date: Mon, 23 Feb 2015 14:39:00 -0500	[thread overview]
Message-ID: <54EB81D4.30906@gmail.com> (raw)
In-Reply-To: <20150223105627.GA4466@vaishali-Ideapad-Z570>

On 02/23/15 05:56, Vaishali Thakkar wrote:
> This patch introduces the use of API function mod_timer
> instead of driver specific function as it is a more
> efficient and standard way to update the expire field of
> an active timer.
> 
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
> ---
> Changes since v1:
> 	-Edit commit message
> 	-Remove unnecessory parenthesis
> 	-Align second parameter of function
> 	 mod_timer properly
> 
>  drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

I like this patch!

However if you start getting rid of _set_timer() from a driver like
this, you should try and remove all instances, and then get rid of all
uses of _set_timer().

In addition you are still leaving some unnecessary parenthesis in place
- see below.

Cheers,
Jes


> diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
> index 9bb364f..0ce8e9d 100644
> --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
> +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
> @@ -129,7 +129,8 @@ static inline void handle_pairwise_key(struct sta_info *psta,
>  		memcpy(psta->tkiprxmickey. skey, &(param->u.crypt.
>  			key[24]), 8);
>  		padapter->securitypriv. busetkipkey = false;
> -		_set_timer(&padapter->securitypriv.tkip_timer, 50);
> +		mod_timer(&padapter->securitypriv.tkip_timer,
> +			  jiffies + msecs_to_jiffies(50));
>  	}
>  	r8712_setstakey_cmd(padapter, (unsigned char *)psta, true);
>  }
> @@ -153,8 +154,8 @@ static inline void handle_group_key(struct ieee_param *param,
>  		if (padapter->registrypriv.power_mgnt > PS_MODE_ACTIVE) {
>  			if (padapter->registrypriv.power_mgnt != padapter->
>  			    pwrctrlpriv.pwr_mode)
> -				_set_timer(&(padapter->mlmepriv.dhcp_timer),
> -					   60000);
> +				mod_timer(&(padapter->mlmepriv.dhcp_timer),
                                      here ^
> +					  jiffies + msecs_to_jiffies(60000));
>  		}
>  	}
>  }
> 



  reply	other threads:[~2015-02-23 19:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 10:56 [PATCH v2] Staging: rtl8712: Use mod_timer Vaishali Thakkar
2015-02-23 19:39 ` Jes Sorensen [this message]
2015-02-23 19:49   ` [Outreachy kernel] " Vaishali Thakkar
2015-02-23 19:52     ` Jes Sorensen
2015-02-23 20:06       ` Vaishali Thakkar
2015-02-23 20:12         ` Jes Sorensen
2015-02-23 20:17           ` Vaishali Thakkar

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=54EB81D4.30906@gmail.com \
    --to=jes.sorensen@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=vthakkar1994@gmail.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.