All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] staging: wilc1000: remove pstrWFIDrv in host_int_set_mac_chnl_num
@ 2015-10-05  2:07 Chaehyun Lim
  2015-10-05  2:07 ` [PATCH 2/3] staging: wilc1000: return error code directly " Chaehyun Lim
  2015-10-05  2:07 ` [PATCH 3/3] staging: wilc1000: return error code direclty in host_int_wait_msg_queue_idle Chaehyun Lim
  0 siblings, 2 replies; 6+ messages in thread
From: Chaehyun Lim @ 2015-10-05  2:07 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch removes pstrWFIDrv variable in host_int_set_mac_chnl_num
function. There is no need to make another variable to check if first
arugment is NULL or not.
It is able to use wfi_drv directly that is first argument of
this function.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 39d72ac..47ccaa8 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -5318,10 +5318,9 @@ s32 host_int_get_rx_power_level(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8RxPowerLevel,
 int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *wfi_drv, u8 channel)
 {
 	int result = 0;
-	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)wfi_drv;
 	struct host_if_msg msg;
 
-	if (!pstrWFIDrv) {
+	if (!wfi_drv) {
 		PRINT_ER("driver is null\n");
 		return -EFAULT;
 	}
-- 
2.6.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] staging: wilc1000: return error code directly in host_int_set_mac_chnl_num
  2015-10-05  2:07 [PATCH 1/3] staging: wilc1000: remove pstrWFIDrv in host_int_set_mac_chnl_num Chaehyun Lim
@ 2015-10-05  2:07 ` Chaehyun Lim
  2015-10-05  2:07 ` [PATCH 3/3] staging: wilc1000: return error code direclty in host_int_wait_msg_queue_idle Chaehyun Lim
  1 sibling, 0 replies; 6+ messages in thread
From: Chaehyun Lim @ 2015-10-05  2:07 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

There is no need to pass the error code to the variable 'result'.
Just return the error directly when error occurs.
Return 0 at the end of this function when error is not happened.

Suggested-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 47ccaa8..b1aa7dd 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -5317,7 +5317,7 @@ s32 host_int_get_rx_power_level(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8RxPowerLevel,
  */
 int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *wfi_drv, u8 channel)
 {
-	int result = 0;
+	int result;
 	struct host_if_msg msg;
 
 	if (!wfi_drv) {
@@ -5334,10 +5334,10 @@ int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *wfi_drv, u8 channel)
 	result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
 	if (result) {
 		PRINT_ER("wilc mq send fail\n");
-		result = -EINVAL;
+		return -EINVAL;
 	}
 
-	return result;
+	return 0;
 }
 
 
-- 
2.6.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] staging: wilc1000: return error code direclty in host_int_wait_msg_queue_idle
  2015-10-05  2:07 [PATCH 1/3] staging: wilc1000: remove pstrWFIDrv in host_int_set_mac_chnl_num Chaehyun Lim
  2015-10-05  2:07 ` [PATCH 2/3] staging: wilc1000: return error code directly " Chaehyun Lim
@ 2015-10-05  2:07 ` Chaehyun Lim
  2015-10-05  2:41   ` Julian Calaby
  1 sibling, 1 reply; 6+ messages in thread
From: Chaehyun Lim @ 2015-10-05  2:07 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

There is no need to pass the error code to the variable 'result'.
Just return the error directly when error occurs.
Return 0 at the end of this function when error is not happened.

Suggested-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index b1aa7dd..427fbaa 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -5343,7 +5343,7 @@ int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *wfi_drv, u8 channel)
 
 int host_int_wait_msg_queue_idle(void)
 {
-	int result = 0;
+	int result;
 
 	struct host_if_msg msg;
 
@@ -5354,13 +5354,13 @@ int host_int_wait_msg_queue_idle(void)
 	result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
 	if (result) {
 		PRINT_ER("wilc mq send fail\n");
-		result = -EINVAL;
+		return -EINVAL;
 	}
 
 	/* wait untill MSG Q is empty */
 	down(&hWaitResponse);
 
-	return result;
+	return 0;
 }
 
 s32 host_int_set_wfi_drv_handler(tstrWILC_WFIDrv *u32address)
-- 
2.6.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] staging: wilc1000: return error code direclty in host_int_wait_msg_queue_idle
  2015-10-05  2:07 ` [PATCH 3/3] staging: wilc1000: return error code direclty in host_int_wait_msg_queue_idle Chaehyun Lim
@ 2015-10-05  2:41   ` Julian Calaby
  2015-10-05  2:48     ` Chaehyun Lim
  0 siblings, 1 reply; 6+ messages in thread
From: Julian Calaby @ 2015-10-05  2:41 UTC (permalink / raw)
  To: Chaehyun Lim
  Cc: Greg KH, Johnny Kim, Rachel Kim, Chris Park, Tony Cho, glen.lee,
	leo.kim, linux-wireless, devel

Hi Chaehyun,

On Mon, Oct 5, 2015 at 1:07 PM, Chaehyun Lim <chaehyun.lim@gmail.com> wrote:
> There is no need to pass the error code to the variable 'result'.
> Just return the error directly when error occurs.
> Return 0 at the end of this function when error is not happened.

We can't do this.

> Suggested-by: Julian Calaby <julian.calaby@gmail.com>
> Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
> ---
>  drivers/staging/wilc1000/host_interface.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index b1aa7dd..427fbaa 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -5343,7 +5343,7 @@ int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *wfi_drv, u8 channel)
>
>  int host_int_wait_msg_queue_idle(void)
>  {
> -       int result = 0;
> +       int result;
>
>         struct host_if_msg msg;
>
> @@ -5354,13 +5354,13 @@ int host_int_wait_msg_queue_idle(void)
>         result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
>         if (result) {
>                 PRINT_ER("wilc mq send fail\n");
> -               result = -EINVAL;
> +               return -EINVAL;

Returning here means that we don't call down:

>         }
>
>         /* wait untill MSG Q is empty */
>         down(&hWaitResponse);

here.

Sorry for the confusion.

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] staging: wilc1000: return error code direclty in host_int_wait_msg_queue_idle
  2015-10-05  2:41   ` Julian Calaby
@ 2015-10-05  2:48     ` Chaehyun Lim
  2015-10-05  2:49       ` Chaehyun Lim
  0 siblings, 1 reply; 6+ messages in thread
From: Chaehyun Lim @ 2015-10-05  2:48 UTC (permalink / raw)
  To: Julian Calaby
  Cc: Greg KH, Johnny Kim, Rachel Kim, Chris Park, Tony Cho, glen.lee,
	leo.kim, linux-wireless, devel

On Mon, Oct 5, 2015 at 11:41 AM, Julian Calaby <julian.calaby@gmail.com> wrote:
> Hi Chaehyun,
>
> On Mon, Oct 5, 2015 at 1:07 PM, Chaehyun Lim <chaehyun.lim@gmail.com> wrote:
>> There is no need to pass the error code to the variable 'result'.
>> Just return the error directly when error occurs.
>> Return 0 at the end of this function when error is not happened.
>
> We can't do this.
>
>> Suggested-by: Julian Calaby <julian.calaby@gmail.com>
>> Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
>> ---
>>  drivers/staging/wilc1000/host_interface.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
>> index b1aa7dd..427fbaa 100644
>> --- a/drivers/staging/wilc1000/host_interface.c
>> +++ b/drivers/staging/wilc1000/host_interface.c
>> @@ -5343,7 +5343,7 @@ int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *wfi_drv, u8 channel)
>>
>>  int host_int_wait_msg_queue_idle(void)
>>  {
>> -       int result = 0;
>> +       int result;
>>
>>         struct host_if_msg msg;
>>
>> @@ -5354,13 +5354,13 @@ int host_int_wait_msg_queue_idle(void)
>>         result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
>>         if (result) {
>>                 PRINT_ER("wilc mq send fail\n");
>> -               result = -EINVAL;
>> +               return -EINVAL;
>
> Returning here means that we don't call down:
>
>>         }
>>
>>         /* wait untill MSG Q is empty */
>>         down(&hWaitResponse);
>
> here.
>
> Sorry for the confusion.
>
> Thanks,
>

Thank you for your comment. I also did not see what you're indicating.

regards
Chaehyun Lim
> --
> Julian Calaby
>
> Email: julian.calaby@gmail.com
> Profile: http://www.google.com/profiles/julian.calaby/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] staging: wilc1000: return error code direclty in host_int_wait_msg_queue_idle
  2015-10-05  2:48     ` Chaehyun Lim
@ 2015-10-05  2:49       ` Chaehyun Lim
  0 siblings, 0 replies; 6+ messages in thread
From: Chaehyun Lim @ 2015-10-05  2:49 UTC (permalink / raw)
  To: Julian Calaby
  Cc: Greg KH, Johnny Kim, Rachel Kim, Chris Park, Tony Cho, glen.lee,
	leo.kim, linux-wireless, devel

Dear Greg

Please ignore this patch.

Thanks
Chaehyun Lim

On Mon, Oct 5, 2015 at 11:48 AM, Chaehyun Lim <chaehyun.lim@gmail.com> wrote:
> On Mon, Oct 5, 2015 at 11:41 AM, Julian Calaby <julian.calaby@gmail.com> wrote:
>> Hi Chaehyun,
>>
>> On Mon, Oct 5, 2015 at 1:07 PM, Chaehyun Lim <chaehyun.lim@gmail.com> wrote:
>>> There is no need to pass the error code to the variable 'result'.
>>> Just return the error directly when error occurs.
>>> Return 0 at the end of this function when error is not happened.
>>
>> We can't do this.
>>
>>> Suggested-by: Julian Calaby <julian.calaby@gmail.com>
>>> Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
>>> ---
>>>  drivers/staging/wilc1000/host_interface.c | 6 +++---
>>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
>>> index b1aa7dd..427fbaa 100644
>>> --- a/drivers/staging/wilc1000/host_interface.c
>>> +++ b/drivers/staging/wilc1000/host_interface.c
>>> @@ -5343,7 +5343,7 @@ int host_int_set_mac_chnl_num(tstrWILC_WFIDrv *wfi_drv, u8 channel)
>>>
>>>  int host_int_wait_msg_queue_idle(void)
>>>  {
>>> -       int result = 0;
>>> +       int result;
>>>
>>>         struct host_if_msg msg;
>>>
>>> @@ -5354,13 +5354,13 @@ int host_int_wait_msg_queue_idle(void)
>>>         result = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
>>>         if (result) {
>>>                 PRINT_ER("wilc mq send fail\n");
>>> -               result = -EINVAL;
>>> +               return -EINVAL;
>>
>> Returning here means that we don't call down:
>>
>>>         }
>>>
>>>         /* wait untill MSG Q is empty */
>>>         down(&hWaitResponse);
>>
>> here.
>>
>> Sorry for the confusion.
>>
>> Thanks,
>>
>
> Thank you for your comment. I also did not see what you're indicating.
>
> regards
> Chaehyun Lim
>> --
>> Julian Calaby
>>
>> Email: julian.calaby@gmail.com
>> Profile: http://www.google.com/profiles/julian.calaby/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-10-05  2:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-05  2:07 [PATCH 1/3] staging: wilc1000: remove pstrWFIDrv in host_int_set_mac_chnl_num Chaehyun Lim
2015-10-05  2:07 ` [PATCH 2/3] staging: wilc1000: return error code directly " Chaehyun Lim
2015-10-05  2:07 ` [PATCH 3/3] staging: wilc1000: return error code direclty in host_int_wait_msg_queue_idle Chaehyun Lim
2015-10-05  2:41   ` Julian Calaby
2015-10-05  2:48     ` Chaehyun Lim
2015-10-05  2:49       ` Chaehyun Lim

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.