kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] staging: rtl8712: remove unneeded NULL check
@ 2013-09-28  9:58 Dan Carpenter
  2013-09-30 14:29 ` Larry Finger
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-09-28  9:58 UTC (permalink / raw)
  To: kernel-janitors

We knew "peventbuf" was a valid pointer and "peventbuf + 2" is also
non-NULL.  I have removed the check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c b/drivers/staging/rtl8712/rtl8712_cmd.c
index 088647c..53f247b 100644
--- a/drivers/staging/rtl8712/rtl8712_cmd.c
+++ b/drivers/staging/rtl8712/rtl8712_cmd.c
@@ -471,11 +471,9 @@ void r8712_event_handle(struct _adapter *padapter, uint *peventbuf)
 	if (pevt_priv->event_seq > 127)
 		pevt_priv->event_seq = 0;
 	peventbuf = peventbuf + 2; /* move to event content, 8 bytes alignment */
-	if (peventbuf) {
-		event_callback = wlanevents[evt_code].event_callback;
-		if (event_callback)
-			event_callback(padapter, (u8 *)peventbuf);
-	}
+	event_callback = wlanevents[evt_code].event_callback;
+	if (event_callback)
+		event_callback(padapter, (u8 *)peventbuf);
 	pevt_priv->evt_done_cnt++;
 _abort_event_:
 	return;

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

* Re: [patch] staging: rtl8712: remove unneeded NULL check
  2013-09-28  9:58 [patch] staging: rtl8712: remove unneeded NULL check Dan Carpenter
@ 2013-09-30 14:29 ` Larry Finger
  0 siblings, 0 replies; 2+ messages in thread
From: Larry Finger @ 2013-09-30 14:29 UTC (permalink / raw)
  To: kernel-janitors

On 09/28/2013 04:58 AM, Dan Carpenter wrote:
> We knew "peventbuf" was a valid pointer and "peventbuf + 2" is also
> non-NULL.  I have removed the check.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c b/drivers/staging/rtl8712/rtl8712_cmd.c
> index 088647c..53f247b 100644
> --- a/drivers/staging/rtl8712/rtl8712_cmd.c
> +++ b/drivers/staging/rtl8712/rtl8712_cmd.c
> @@ -471,11 +471,9 @@ void r8712_event_handle(struct _adapter *padapter, uint *peventbuf)
>   	if (pevt_priv->event_seq > 127)
>   		pevt_priv->event_seq = 0;
>   	peventbuf = peventbuf + 2; /* move to event content, 8 bytes alignment */
> -	if (peventbuf) {
> -		event_callback = wlanevents[evt_code].event_callback;
> -		if (event_callback)
> -			event_callback(padapter, (u8 *)peventbuf);
> -	}
> +	event_callback = wlanevents[evt_code].event_callback;
> +	if (event_callback)
> +		event_callback(padapter, (u8 *)peventbuf);
>   	pevt_priv->evt_done_cnt++;
>   _abort_event_:
>   	return;

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Thanks,

Larry



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

end of thread, other threads:[~2013-09-30 14:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-28  9:58 [patch] staging: rtl8712: remove unneeded NULL check Dan Carpenter
2013-09-30 14:29 ` Larry Finger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).