[Xorg-driver-geode] [PATCH] Rectify lx_display.c outstanding compiler warnings

Mart Raudsepp mart.raudsepp at artecdesign.ee
Sun Aug 8 21:22:01 PDT 2010


On E, 2010-08-09 at 12:01 +0800, Cui, Hunk wrote:
> From: Hunk Cui <Hunk.Cui at amd.com>
> 
> *Correct the type of LXAllocShadow from Bool to static void.

Why shouldn't LXAllocShadow be able to return if it succeeded or failed?
As in, just return TRUE if it succeeds, and then the caller maybe
wouldn't even need to separately check for pGeode->shadowArea->offset
being set?

> *Correct reasonless comparison between pointer and integer in line 407.

This part looks fine, assuming pGeode->shadowArea->offset is an unsigned
integer

Regards,
Mart


> Signed-off-by: Hunk Cui <Hunk.Cui at amd.com>
> ---
>  src/lx_display.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/lx_display.c b/src/lx_display.c
> index 4f7c4ed..6e47039 100644
> --- a/src/lx_display.c
> +++ b/src/lx_display.c
> @@ -368,7 +368,7 @@ lx_crtc_gamma_set(xf86CrtcPtr crtc, CARD16 * red,
> CARD16 * green,
>       * of card space is returned.
>       */
>  
> -Bool
> +static void
>  LXAllocShadow(ScrnInfoPtr pScrni, int size)
>  {
>      GeodeRec *pGeode = GEODEPTR(pScrni);
> @@ -386,7 +386,7 @@ LXAllocShadow(ScrnInfoPtr pScrni, int size)
>  		NULL, NULL);
>  
>  	if (pGeode->shadowArea == NULL)
> -		return FALSE;
> +		return;
>      }
>  
>      pScrni->fbOffset = pGeode->shadowArea->offset;
> @@ -404,7 +404,7 @@ lx_crtc_shadow_allocate(xf86CrtcPtr crtc, int width,
> int height)
>  
>      LXAllocShadow(pScrni, size); /* Allocate shadow memory */
>  
> -    if (pGeode->shadowArea->offset == NULL) {
> +    if (!pGeode->shadowArea->offset) {
>  	xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
>  	    "Couldn't allocate the shadow memory for rotation\n");
>  	xf86DrvMsg(pScrni->scrnIndex, X_ERROR,



More information about the Xorg-driver-geode mailing list