On 01/17/2012 02:00 PM, Anuj Phogat wrote:
> It is better to test if(intel == NULL) and simply return in that case.
> 
> Signed-off-by: Anuj Phogat <[email protected]>
> ---
>  src/mesa/drivers/dri/intel/intel_screen.c |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/intel/intel_screen.c 
> b/src/mesa/drivers/dri/intel/intel_screen.c
> index a08f3d1..0566907 100644
> --- a/src/mesa/drivers/dri/intel/intel_screen.c
> +++ b/src/mesa/drivers/dri/intel/intel_screen.c
> @@ -114,16 +114,16 @@ intelDRI2Flush(__DRIdrawable *drawable)
>  {
>     GET_CURRENT_CONTEXT(ctx);
>     struct intel_context *intel = intel_context(ctx);
> +   if (intel == NULL)
> +      return;
>  
> -   if (intel != NULL) {
> -      if (intel->gen < 4)
> -      INTEL_FIREVERTICES(intel);
> +   if (intel->gen < 4)
> +      INTEL_FIREVERTICES(intel);
>  
> -      intel->need_throttle = true;
> +   intel->need_throttle = true;
>  
> -      if (intel->batch.used)
> -      intel_batchbuffer_flush(intel);
> -   }
> +   if (intel->batch.used)
> +      intel_batchbuffer_flush(intel);
>  }
>  
>  static const struct __DRI2flushExtensionRec intelFlushExtension = {


Yay for less indentation.

Reviewed-by: Chad Versace <[email protected]>
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to