* [PATCH] Staging: wilc1000: coreconfigurator: Remove unnecessary wrapper function
@ 2015-10-22 19:20 Shivani Bhardwaj
2015-10-22 19:29 ` [Outreachy kernel] " Julia Lawall
0 siblings, 1 reply; 7+ messages in thread
From: Shivani Bhardwaj @ 2015-10-22 19:20 UTC (permalink / raw)
To: outreachy-kernel
Remove the function get_current_channel() and replace its calls by
get_current_channel_802_11n() as the former function's definition
involves only returning the value of latter function.
Semantic patch used to find out the issue:
@@
identifier f,g;
@@
*f(...) {
return g(...); }
Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
drivers/staging/wilc1000/coreconfigurator.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 6dfe26d..f20f2f3 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -331,13 +331,6 @@ u8 get_current_channel_802_11n(u8 *pu8msa, u16 u16RxLen)
return 0; /* no MIB here */
}
-u8 get_current_channel(u8 *pu8msa, u16 u16RxLen)
-{
- /* Extract current channel information from */
- /* the beacon/probe response frame */
- return get_current_channel_802_11n(pu8msa, u16RxLen);
-}
-
/**
* @brief parses the received 'N' message
* @details
@@ -425,8 +418,11 @@ s32 parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
/* Get BSSID */
get_BSSID(pu8msa, pstrNetworkInfo->au8bssid);
- /* Get the current channel */
- pstrNetworkInfo->u8channel = get_current_channel(pu8msa, (u16RxLen + FCS_LEN));
+ /*
+ * Extract current channel information from
+ * the beacon/probe response frame
+ */
+ pstrNetworkInfo->u8channel = get_current_channel_802_11n(pu8msa, (u16RxLen + FCS_LEN));
/* Get beacon period */
u8index = (MAC_HDR_LEN + TIME_STAMP_LEN);
--
2.1.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: wilc1000: coreconfigurator: Remove unnecessary wrapper function
2015-10-22 19:20 [PATCH] Staging: wilc1000: coreconfigurator: Remove unnecessary wrapper function Shivani Bhardwaj
@ 2015-10-22 19:29 ` Julia Lawall
2015-10-22 22:45 ` Shivani Bhardwaj
0 siblings, 1 reply; 7+ messages in thread
From: Julia Lawall @ 2015-10-22 19:29 UTC (permalink / raw)
To: Shivani Bhardwaj; +Cc: outreachy-kernel
On Fri, 23 Oct 2015, Shivani Bhardwaj wrote:
> Remove the function get_current_channel() and replace its calls by
> get_current_channel_802_11n() as the former function's definition
> involves only returning the value of latter function.
> Semantic patch used to find out the issue:
>
> @@
> identifier f,g;
> @@
>
> *f(...) {
> return g(...); }
>
> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
> ---
> drivers/staging/wilc1000/coreconfigurator.c | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
> index 6dfe26d..f20f2f3 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.c
> +++ b/drivers/staging/wilc1000/coreconfigurator.c
> @@ -331,13 +331,6 @@ u8 get_current_channel_802_11n(u8 *pu8msa, u16 u16RxLen)
> return 0; /* no MIB here */
> }
>
> -u8 get_current_channel(u8 *pu8msa, u16 u16RxLen)
> -{
> - /* Extract current channel information from */
> - /* the beacon/probe response frame */
> - return get_current_channel_802_11n(pu8msa, u16RxLen);
> -}
> -
> /**
> * @brief parses the received 'N' message
> * @details
> @@ -425,8 +418,11 @@ s32 parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
> /* Get BSSID */
> get_BSSID(pu8msa, pstrNetworkInfo->au8bssid);
>
> - /* Get the current channel */
> - pstrNetworkInfo->u8channel = get_current_channel(pu8msa, (u16RxLen + FCS_LEN));
> + /*
> + * Extract current channel information from
> + * the beacon/probe response frame
> + */
> + pstrNetworkInfo->u8channel = get_current_channel_802_11n(pu8msa, (u16RxLen + FCS_LEN));
This goes way over 80 characters. I know the code went over 80 characters
before, but in constructing the new code, you could respect the 80
character limit at the same time.
Another issue, if someone is looking for something to do with Coccinelle,
is that the parentheses on the second argument above and on the addition
below are not necessary. But fixing that shouldn't be in the same patch.
julia
>
> /* Get beacon period */
> u8index = (MAC_HDR_LEN + TIME_STAMP_LEN);
> --
> 2.1.0
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151022192006.GA23576%40ubuntu.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: wilc1000: coreconfigurator: Remove unnecessary wrapper function
2015-10-22 19:29 ` [Outreachy kernel] " Julia Lawall
@ 2015-10-22 22:45 ` Shivani Bhardwaj
2015-10-23 5:20 ` Julia Lawall
0 siblings, 1 reply; 7+ messages in thread
From: Shivani Bhardwaj @ 2015-10-22 22:45 UTC (permalink / raw)
To: Julia Lawall; +Cc: outreachy-kernel
On Fri, Oct 23, 2015 at 12:59 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> On Fri, 23 Oct 2015, Shivani Bhardwaj wrote:
>
>> Remove the function get_current_channel() and replace its calls by
>> get_current_channel_802_11n() as the former function's definition
>> involves only returning the value of latter function.
>> Semantic patch used to find out the issue:
>>
>> @@
>> identifier f,g;
>> @@
>>
>> *f(...) {
>> return g(...); }
>>
>> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
>> ---
>> drivers/staging/wilc1000/coreconfigurator.c | 14 +++++---------
>> 1 file changed, 5 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
>> index 6dfe26d..f20f2f3 100644
>> --- a/drivers/staging/wilc1000/coreconfigurator.c
>> +++ b/drivers/staging/wilc1000/coreconfigurator.c
>> @@ -331,13 +331,6 @@ u8 get_current_channel_802_11n(u8 *pu8msa, u16 u16RxLen)
>> return 0; /* no MIB here */
>> }
>>
>> -u8 get_current_channel(u8 *pu8msa, u16 u16RxLen)
>> -{
>> - /* Extract current channel information from */
>> - /* the beacon/probe response frame */
>> - return get_current_channel_802_11n(pu8msa, u16RxLen);
>> -}
>> -
>> /**
>> * @brief parses the received 'N' message
>> * @details
>> @@ -425,8 +418,11 @@ s32 parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
>> /* Get BSSID */
>> get_BSSID(pu8msa, pstrNetworkInfo->au8bssid);
>>
>> - /* Get the current channel */
>> - pstrNetworkInfo->u8channel = get_current_channel(pu8msa, (u16RxLen + FCS_LEN));
>> + /*
>> + * Extract current channel information from
>> + * the beacon/probe response frame
>> + */
>> + pstrNetworkInfo->u8channel = get_current_channel_802_11n(pu8msa, (u16RxLen + FCS_LEN));
>
> This goes way over 80 characters. I know the code went over 80 characters
> before, but in constructing the new code, you could respect the 80
> character limit at the same time.
>
> Another issue, if someone is looking for something to do with Coccinelle,
> is that the parentheses on the second argument above and on the addition
> below are not necessary. But fixing that shouldn't be in the same patch.
>
I don't understand this issue, can you please elaborate a tad bit more?
> julia
>
>>
>> /* Get beacon period */
>> u8index = (MAC_HDR_LEN + TIME_STAMP_LEN);
>> --
>> 2.1.0
>>
>> --
>> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
>> To post to this group, send email to outreachy-kernel@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151022192006.GA23576%40ubuntu.
>> For more options, visit https://groups.google.com/d/optout.
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: wilc1000: coreconfigurator: Remove unnecessary wrapper function
2015-10-22 22:45 ` Shivani Bhardwaj
@ 2015-10-23 5:20 ` Julia Lawall
2015-10-23 6:19 ` Shivani Bhardwaj
0 siblings, 1 reply; 7+ messages in thread
From: Julia Lawall @ 2015-10-23 5:20 UTC (permalink / raw)
To: Shivani Bhardwaj; +Cc: outreachy-kernel
On Fri, 23 Oct 2015, Shivani Bhardwaj wrote:
> On Fri, Oct 23, 2015 at 12:59 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> > On Fri, 23 Oct 2015, Shivani Bhardwaj wrote:
> >
> >> Remove the function get_current_channel() and replace its calls by
> >> get_current_channel_802_11n() as the former function's definition
> >> involves only returning the value of latter function.
> >> Semantic patch used to find out the issue:
> >>
> >> @@
> >> identifier f,g;
> >> @@
> >>
> >> *f(...) {
> >> return g(...); }
> >>
> >> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
> >> ---
> >> drivers/staging/wilc1000/coreconfigurator.c | 14 +++++---------
> >> 1 file changed, 5 insertions(+), 9 deletions(-)
> >>
> >> diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
> >> index 6dfe26d..f20f2f3 100644
> >> --- a/drivers/staging/wilc1000/coreconfigurator.c
> >> +++ b/drivers/staging/wilc1000/coreconfigurator.c
> >> @@ -331,13 +331,6 @@ u8 get_current_channel_802_11n(u8 *pu8msa, u16 u16RxLen)
> >> return 0; /* no MIB here */
> >> }
> >>
> >> -u8 get_current_channel(u8 *pu8msa, u16 u16RxLen)
> >> -{
> >> - /* Extract current channel information from */
> >> - /* the beacon/probe response frame */
> >> - return get_current_channel_802_11n(pu8msa, u16RxLen);
> >> -}
> >> -
> >> /**
> >> * @brief parses the received 'N' message
> >> * @details
> >> @@ -425,8 +418,11 @@ s32 parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
> >> /* Get BSSID */
> >> get_BSSID(pu8msa, pstrNetworkInfo->au8bssid);
> >>
> >> - /* Get the current channel */
> >> - pstrNetworkInfo->u8channel = get_current_channel(pu8msa, (u16RxLen + FCS_LEN));
> >> + /*
> >> + * Extract current channel information from
> >> + * the beacon/probe response frame
> >> + */
> >> + pstrNetworkInfo->u8channel = get_current_channel_802_11n(pu8msa, (u16RxLen + FCS_LEN));
> >
> > This goes way over 80 characters. I know the code went over 80 characters
> > before, but in constructing the new code, you could respect the 80
> > character limit at the same time.
> >
> > Another issue, if someone is looking for something to do with Coccinelle,
> > is that the parentheses on the second argument above and on the addition
> > below are not necessary. But fixing that shouldn't be in the same patch.
> >
>
> I don't understand this issue, can you please elaborate a tad bit more?
See below.
> > julia
> >
> >>
> >> /* Get beacon period */
> >> u8index = (MAC_HDR_LEN + TIME_STAMP_LEN);
This code could be u8index = MAC_HDR_LEN + TIME_STAMP_LEN;. Parentheses
on the outside of an expression don't help anything.
julia
> >> 2.1.0
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> >> To post to this group, send email to outreachy-kernel@googlegroups.com.
> >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151022192006.GA23576%40ubuntu.
> >> For more options, visit https://groups.google.com/d/optout.
> >>
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAKHNQQGaEZ8DofL6F4psu-8Xg_PS5BShLh6Z%3DbtxUDN8xLDNBQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: wilc1000: coreconfigurator: Remove unnecessary wrapper function
2015-10-23 5:20 ` Julia Lawall
@ 2015-10-23 6:19 ` Shivani Bhardwaj
2015-10-23 6:24 ` Julia Lawall
0 siblings, 1 reply; 7+ messages in thread
From: Shivani Bhardwaj @ 2015-10-23 6:19 UTC (permalink / raw)
To: Julia Lawall; +Cc: outreachy-kernel
On Fri, Oct 23, 2015 at 10:50 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
> On Fri, 23 Oct 2015, Shivani Bhardwaj wrote:
>
>> On Fri, Oct 23, 2015 at 12:59 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>> > On Fri, 23 Oct 2015, Shivani Bhardwaj wrote:
>> >
>> >> Remove the function get_current_channel() and replace its calls by
>> >> get_current_channel_802_11n() as the former function's definition
>> >> involves only returning the value of latter function.
>> >> Semantic patch used to find out the issue:
>> >>
>> >> @@
>> >> identifier f,g;
>> >> @@
>> >>
>> >> *f(...) {
>> >> return g(...); }
>> >>
>> >> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
>> >> ---
>> >> drivers/staging/wilc1000/coreconfigurator.c | 14 +++++---------
>> >> 1 file changed, 5 insertions(+), 9 deletions(-)
>> >>
>> >> diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
>> >> index 6dfe26d..f20f2f3 100644
>> >> --- a/drivers/staging/wilc1000/coreconfigurator.c
>> >> +++ b/drivers/staging/wilc1000/coreconfigurator.c
>> >> @@ -331,13 +331,6 @@ u8 get_current_channel_802_11n(u8 *pu8msa, u16 u16RxLen)
>> >> return 0; /* no MIB here */
>> >> }
>> >>
>> >> -u8 get_current_channel(u8 *pu8msa, u16 u16RxLen)
>> >> -{
>> >> - /* Extract current channel information from */
>> >> - /* the beacon/probe response frame */
>> >> - return get_current_channel_802_11n(pu8msa, u16RxLen);
>> >> -}
>> >> -
>> >> /**
>> >> * @brief parses the received 'N' message
>> >> * @details
>> >> @@ -425,8 +418,11 @@ s32 parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
>> >> /* Get BSSID */
>> >> get_BSSID(pu8msa, pstrNetworkInfo->au8bssid);
>> >>
>> >> - /* Get the current channel */
>> >> - pstrNetworkInfo->u8channel = get_current_channel(pu8msa, (u16RxLen + FCS_LEN));
>> >> + /*
>> >> + * Extract current channel information from
>> >> + * the beacon/probe response frame
>> >> + */
>> >> + pstrNetworkInfo->u8channel = get_current_channel_802_11n(pu8msa, (u16RxLen + FCS_LEN));
>> >
>> > This goes way over 80 characters. I know the code went over 80 characters
>> > before, but in constructing the new code, you could respect the 80
>> > character limit at the same time.
>> >
>> > Another issue, if someone is looking for something to do with Coccinelle,
>> > is that the parentheses on the second argument above and on the addition
>> > below are not necessary. But fixing that shouldn't be in the same patch.
>> >
>>
>> I don't understand this issue, can you please elaborate a tad bit more?
>
> See below.
>
>> > julia
>> >
>> >>
>> >> /* Get beacon period */
>> >> u8index = (MAC_HDR_LEN + TIME_STAMP_LEN);
>
> This code could be u8index = MAC_HDR_LEN + TIME_STAMP_LEN;. Parentheses
> on the outside of an expression don't help anything.
>
> julia
>
I get that. Thanks. I'm sending v2.
>> >> 2.1.0
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
>> >> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
>> >> To post to this group, send email to outreachy-kernel@googlegroups.com.
>> >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151022192006.GA23576%40ubuntu.
>> >> For more options, visit https://groups.google.com/d/optout.
>> >>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
>> To post to this group, send email to outreachy-kernel@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAKHNQQGaEZ8DofL6F4psu-8Xg_PS5BShLh6Z%3DbtxUDN8xLDNBQ%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: wilc1000: coreconfigurator: Remove unnecessary wrapper function
2015-10-23 6:19 ` Shivani Bhardwaj
@ 2015-10-23 6:24 ` Julia Lawall
2015-10-23 6:33 ` Shivani Bhardwaj
0 siblings, 1 reply; 7+ messages in thread
From: Julia Lawall @ 2015-10-23 6:24 UTC (permalink / raw)
To: Shivani Bhardwaj; +Cc: outreachy-kernel
On Fri, 23 Oct 2015, Shivani Bhardwaj wrote:
> On Fri, Oct 23, 2015 at 10:50 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >
> >
> > On Fri, 23 Oct 2015, Shivani Bhardwaj wrote:
> >
> >> On Fri, Oct 23, 2015 at 12:59 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >> > On Fri, 23 Oct 2015, Shivani Bhardwaj wrote:
> >> >
> >> >> Remove the function get_current_channel() and replace its calls by
> >> >> get_current_channel_802_11n() as the former function's definition
> >> >> involves only returning the value of latter function.
> >> >> Semantic patch used to find out the issue:
> >> >>
> >> >> @@
> >> >> identifier f,g;
> >> >> @@
> >> >>
> >> >> *f(...) {
> >> >> return g(...); }
> >> >>
> >> >> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
> >> >> ---
> >> >> drivers/staging/wilc1000/coreconfigurator.c | 14 +++++---------
> >> >> 1 file changed, 5 insertions(+), 9 deletions(-)
> >> >>
> >> >> diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
> >> >> index 6dfe26d..f20f2f3 100644
> >> >> --- a/drivers/staging/wilc1000/coreconfigurator.c
> >> >> +++ b/drivers/staging/wilc1000/coreconfigurator.c
> >> >> @@ -331,13 +331,6 @@ u8 get_current_channel_802_11n(u8 *pu8msa, u16 u16RxLen)
> >> >> return 0; /* no MIB here */
> >> >> }
> >> >>
> >> >> -u8 get_current_channel(u8 *pu8msa, u16 u16RxLen)
> >> >> -{
> >> >> - /* Extract current channel information from */
> >> >> - /* the beacon/probe response frame */
> >> >> - return get_current_channel_802_11n(pu8msa, u16RxLen);
> >> >> -}
> >> >> -
> >> >> /**
> >> >> * @brief parses the received 'N' message
> >> >> * @details
> >> >> @@ -425,8 +418,11 @@ s32 parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
> >> >> /* Get BSSID */
> >> >> get_BSSID(pu8msa, pstrNetworkInfo->au8bssid);
> >> >>
> >> >> - /* Get the current channel */
> >> >> - pstrNetworkInfo->u8channel = get_current_channel(pu8msa, (u16RxLen + FCS_LEN));
> >> >> + /*
> >> >> + * Extract current channel information from
> >> >> + * the beacon/probe response frame
> >> >> + */
> >> >> + pstrNetworkInfo->u8channel = get_current_channel_802_11n(pu8msa, (u16RxLen + FCS_LEN));
> >> >
> >> > This goes way over 80 characters. I know the code went over 80 characters
> >> > before, but in constructing the new code, you could respect the 80
> >> > character limit at the same time.
> >> >
> >> > Another issue, if someone is looking for something to do with Coccinelle,
> >> > is that the parentheses on the second argument above and on the addition
> >> > below are not necessary. But fixing that shouldn't be in the same patch.
> >> >
> >>
> >> I don't understand this issue, can you please elaborate a tad bit more?
> >
> > See below.
> >
> >> > julia
> >> >
> >> >>
> >> >> /* Get beacon period */
> >> >> u8index = (MAC_HDR_LEN + TIME_STAMP_LEN);
> >
> > This code could be u8index = MAC_HDR_LEN + TIME_STAMP_LEN;. Parentheses
> > on the outside of an expression don't help anything.
> >
> > julia
> >
>
> I get that. Thanks. I'm sending v2.
Dropping the parens shouldn't be in the same patch. It could be in a
series.
julia
>
> >> >> 2.1.0
> >> >>
> >> >> --
> >> >> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> >> >> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> >> >> To post to this group, send email to outreachy-kernel@googlegroups.com.
> >> >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151022192006.GA23576%40ubuntu.
> >> >> For more options, visit https://groups.google.com/d/optout.
> >> >>
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> >> To post to this group, send email to outreachy-kernel@googlegroups.com.
> >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAKHNQQGaEZ8DofL6F4psu-8Xg_PS5BShLh6Z%3DbtxUDN8xLDNBQ%40mail.gmail.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: wilc1000: coreconfigurator: Remove unnecessary wrapper function
2015-10-23 6:24 ` Julia Lawall
@ 2015-10-23 6:33 ` Shivani Bhardwaj
0 siblings, 0 replies; 7+ messages in thread
From: Shivani Bhardwaj @ 2015-10-23 6:33 UTC (permalink / raw)
To: Julia Lawall; +Cc: outreachy-kernel
On Fri, Oct 23, 2015 at 11:54 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
> On Fri, 23 Oct 2015, Shivani Bhardwaj wrote:
>
>> On Fri, Oct 23, 2015 at 10:50 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>> >
>> >
>> > On Fri, 23 Oct 2015, Shivani Bhardwaj wrote:
>> >
>> >> On Fri, Oct 23, 2015 at 12:59 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>> >> > On Fri, 23 Oct 2015, Shivani Bhardwaj wrote:
>> >> >
>> >> >> Remove the function get_current_channel() and replace its calls by
>> >> >> get_current_channel_802_11n() as the former function's definition
>> >> >> involves only returning the value of latter function.
>> >> >> Semantic patch used to find out the issue:
>> >> >>
>> >> >> @@
>> >> >> identifier f,g;
>> >> >> @@
>> >> >>
>> >> >> *f(...) {
>> >> >> return g(...); }
>> >> >>
>> >> >> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
>> >> >> ---
>> >> >> drivers/staging/wilc1000/coreconfigurator.c | 14 +++++---------
>> >> >> 1 file changed, 5 insertions(+), 9 deletions(-)
>> >> >>
>> >> >> diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
>> >> >> index 6dfe26d..f20f2f3 100644
>> >> >> --- a/drivers/staging/wilc1000/coreconfigurator.c
>> >> >> +++ b/drivers/staging/wilc1000/coreconfigurator.c
>> >> >> @@ -331,13 +331,6 @@ u8 get_current_channel_802_11n(u8 *pu8msa, u16 u16RxLen)
>> >> >> return 0; /* no MIB here */
>> >> >> }
>> >> >>
>> >> >> -u8 get_current_channel(u8 *pu8msa, u16 u16RxLen)
>> >> >> -{
>> >> >> - /* Extract current channel information from */
>> >> >> - /* the beacon/probe response frame */
>> >> >> - return get_current_channel_802_11n(pu8msa, u16RxLen);
>> >> >> -}
>> >> >> -
>> >> >> /**
>> >> >> * @brief parses the received 'N' message
>> >> >> * @details
>> >> >> @@ -425,8 +418,11 @@ s32 parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
>> >> >> /* Get BSSID */
>> >> >> get_BSSID(pu8msa, pstrNetworkInfo->au8bssid);
>> >> >>
>> >> >> - /* Get the current channel */
>> >> >> - pstrNetworkInfo->u8channel = get_current_channel(pu8msa, (u16RxLen + FCS_LEN));
>> >> >> + /*
>> >> >> + * Extract current channel information from
>> >> >> + * the beacon/probe response frame
>> >> >> + */
>> >> >> + pstrNetworkInfo->u8channel = get_current_channel_802_11n(pu8msa, (u16RxLen + FCS_LEN));
>> >> >
>> >> > This goes way over 80 characters. I know the code went over 80 characters
>> >> > before, but in constructing the new code, you could respect the 80
>> >> > character limit at the same time.
>> >> >
>> >> > Another issue, if someone is looking for something to do with Coccinelle,
>> >> > is that the parentheses on the second argument above and on the addition
>> >> > below are not necessary. But fixing that shouldn't be in the same patch.
>> >> >
>> >>
>> >> I don't understand this issue, can you please elaborate a tad bit more?
>> >
>> > See below.
>> >
>> >> > julia
>> >> >
>> >> >>
>> >> >> /* Get beacon period */
>> >> >> u8index = (MAC_HDR_LEN + TIME_STAMP_LEN);
>> >
>> > This code could be u8index = MAC_HDR_LEN + TIME_STAMP_LEN;. Parentheses
>> > on the outside of an expression don't help anything.
>> >
>> > julia
>> >
>>
>> I get that. Thanks. I'm sending v2.
>
> Dropping the parens shouldn't be in the same patch. It could be in a
> series.
>
> julia
>
I'll take care. Thanks!
>>
>> >> >> 2.1.0
>> >> >>
>> >> >> --
>> >> >> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
>> >> >> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
>> >> >> To post to this group, send email to outreachy-kernel@googlegroups.com.
>> >> >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151022192006.GA23576%40ubuntu.
>> >> >> For more options, visit https://groups.google.com/d/optout.
>> >> >>
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
>> >> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
>> >> To post to this group, send email to outreachy-kernel@googlegroups.com.
>> >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAKHNQQGaEZ8DofL6F4psu-8Xg_PS5BShLh6Z%3DbtxUDN8xLDNBQ%40mail.gmail.com.
>> >> For more options, visit https://groups.google.com/d/optout.
>> >>
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-10-23 6:33 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-22 19:20 [PATCH] Staging: wilc1000: coreconfigurator: Remove unnecessary wrapper function Shivani Bhardwaj
2015-10-22 19:29 ` [Outreachy kernel] " Julia Lawall
2015-10-22 22:45 ` Shivani Bhardwaj
2015-10-23 5:20 ` Julia Lawall
2015-10-23 6:19 ` Shivani Bhardwaj
2015-10-23 6:24 ` Julia Lawall
2015-10-23 6:33 ` Shivani Bhardwaj
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.