[openib-general] [PATCH] [TRIVIAL] OpenSM/complib: Move assert before variable is used
Hal Rosenstock
halr at voltaire.com
Wed Nov 30 14:34:05 PST 2005
Right. I've been looking at this stuff too long :-(
________________________________
From: Johannes Erdfelt [mailto:johannes at erdfelt.com]
Sent: Wed 11/30/2005 5:32 PM
To: Hal Rosenstock
Cc: Yael Kalka; openib-general at openib.org
Subject: Re: [openib-general] [PATCH] [TRIVIAL] OpenSM/complib: Move assert before variable is used
On Wed, Nov 30, 2005, Hal Rosenstock <halr at voltaire.com> wrote:
> OpenSM/complib: Move assert before variable is used
>
> Signed-off-by: Hal Rosenstock <halr at voltaire.com>
>
> Index: cl_dispatcher.c
> ===================================================================
> --- cl_dispatcher.c (revision 4257)
> +++ cl_dispatcher.c (working copy)
> @@ -344,8 +344,8 @@ cl_disp_post(
> cl_dispatcher_t *p_disp;
> cl_disp_msg_t *p_msg;
>
> - p_disp = handle->p_disp;
> CL_ASSERT( p_disp );
> + p_disp = handle->p_disp;
> CL_ASSERT( msg_id != CL_DISP_MSGID_NONE );
>
> cl_spinlock_acquire( &p_disp->lock );
It can't be correct to check the value before it is set, right?
JE
More information about the general
mailing list