Subject: [PATCH] Staging: rtl8192e: Timer setup using macro rather assignment

setup_timer is used for timer parameter setup rather than direct
assignment

Signed-off-by: Gnanachandran Dhanapal <[email protected]>
---
drivers/staging/rtl8192e/rtllib_module.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_module.c b/drivers/staging/rtl8192e/rtllib_module.c
index 32cc8df..7ad1541 100644
--- a/drivers/staging/rtl8192e/rtllib_module.c
+++ b/drivers/staging/rtl8192e/rtllib_module.c
@@ -59,9 +59,8 @@ EXPORT_SYMBOL(rt_global_debug_component);

void _setup_timer(struct timer_list *ptimer, void *fun, unsigned long data)
{
- ptimer->function = fun;
- ptimer->data = data;
init_timer(ptimer);
+ setup_timer(ptimer, fun, data);
}

static inline int rtllib_networks_allocate(struct rtllib_device *ieee)
--
1.7.9.5


2015-05-18 16:05:50

by Sudip Mukherjee

[permalink] [raw]
Subject: Re: [PATCH] Staging: rtl8192e: Timer setup using macro rather assignment

On Mon, May 18, 2015 at 02:44:15PM +0000, DHANAPAL, GNANACHANDRAN (G.) wrote:
> setup_timer is used for timer parameter setup rather than direct
> assignment
>
> Signed-off-by: Gnanachandran Dhanapal <[email protected]>

your From: name and Signed-off-by: names are not matching. They should
be same.

> ---
<snip>
> --- a/drivers/staging/rtl8192e/rtllib_module.c
> +++ b/drivers/staging/rtl8192e/rtllib_module.c
> @@ -59,9 +59,8 @@ EXPORT_SYMBOL(rt_global_debug_component);
>
> void _setup_timer(struct timer_list *ptimer, void *fun, unsigned long data)
> {
> - ptimer->function = fun;
> - ptimer->data = data;
> init_timer(ptimer);
> + setup_timer(ptimer, fun, data);
setup_timer is calling __setup_timer which is again calling __init_timer
here we already have an init_timer which is also calling __init_timer.
so now __init_timer gets executed two times for one timer.

regards
sudip

2015-05-18 16:26:16

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] Staging: rtl8192e: Timer setup using macro rather assignment

On Mon, 2015-05-18 at 21:35 +0530, Sudip Mukherjee wrote:
> On Mon, May 18, 2015 at 02:44:15PM +0000, DHANAPAL, GNANACHANDRAN (G.) wrote:
> > setup_timer is used for timer parameter setup rather than direct
> > assignment
> >
> > Signed-off-by: Gnanachandran Dhanapal <[email protected]>
>
> your From: name and Signed-off-by: names are not matching. They should
> be same.

If there's a specific "From: " in the _body_ of the email,
that's true, but the sender email "From: " header and the
Signed-off-by: line do not have to match.

A "From: " line in the email body should only be used when
the patch is from a different sender than the sign-off.

2015-05-18 16:42:53

by Sudip Mukherjee

[permalink] [raw]
Subject: Re: [PATCH] Staging: rtl8192e: Timer setup using macro rather assignment

On Mon, May 18, 2015 at 09:26:03AM -0700, Joe Perches wrote:
> On Mon, 2015-05-18 at 21:35 +0530, Sudip Mukherjee wrote:
> > On Mon, May 18, 2015 at 02:44:15PM +0000, DHANAPAL, GNANACHANDRAN (G.) wrote:
> > > setup_timer is used for timer parameter setup rather than direct
> > > assignment
> > >
> > > Signed-off-by: Gnanachandran Dhanapal <[email protected]>
> >
> > your From: name and Signed-off-by: names are not matching. They should
> > be same.
>
> If there's a specific "From: " in the _body_ of the email,
> that's true, but the sender email "From: " header and the
> Signed-off-by: line do not have to match.
But Greg usually rejects these patches where the sender "From:" header
and Signed-off-by: doesnot match. Just for example:

https://lkml.org/lkml/2014/11/25/924

regards
sudip

>
> A "From: " line in the email body should only be used when
> the patch is from a different sender than the sign-off.
>
>

2015-05-18 17:49:34

by Julia Lawall

[permalink] [raw]
Subject: Re: [PATCH] Staging: rtl8192e: Timer setup using macro rather assignment

> void _setup_timer(struct timer_list *ptimer, void *fun, unsigned long data)
> {
> - ptimer->function = fun;
> - ptimer->data = data;
> init_timer(ptimer);
> + setup_timer(ptimer, fun, data);
> }

setup_timer also subsumes init_timer. Check the definition. Probably you
can delete this function completely.

julia