[PATCH 12/19] xfree86: Remove useless back-pointer to pScrn from colormap code

Keith Packard keithp at keithp.com
Mon Sep 29 13:36:50 PDT 2014


Adam Jackson <ajax at redhat.com> writes:

> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  hw/xfree86/common/xf86cmap.c | 46 +++++++++++++++++++-------------------------
>  1 file changed, 20 insertions(+), 26 deletions(-)
>
> diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c
> index 3f9c880..c4bae56 100644
> --- a/hw/xfree86/common/xf86cmap.c
> +++ b/hw/xfree86/common/xf86cmap.c
> @@ -74,7 +74,6 @@ typedef struct _CMapLink {
>  } CMapLink, *CMapLinkPtr;
>  
>  typedef struct {
> -    ScrnInfoPtr pScrn;
>      CloseScreenProcPtr CloseScreen;
>      CreateColormapProcPtr CreateColormap;
>      DestroyColormapProcPtr DestroyColormap;
> @@ -123,7 +122,7 @@ static int CMapSetDGAMode(ScrnInfoPtr, int, DGADevicePtr);
>  #endif
>  static int CMapChangeGamma(ScrnInfoPtr, Gamma);
>  
> -static void ComputeGamma(CMapScreenPtr);
> +static void ComputeGamma(ScrnInfoPtr, CMapScreenPtr);
>  static Bool CMapAllocateColormapPrivate(ColormapPtr);
>  static void CMapRefreshColors(ColormapPtr, int, int *);
>  static void CMapSetOverscan(ColormapPtr, int, int *);
> @@ -194,7 +193,6 @@ xf86HandleColormaps(ScreenPtr pScreen,
>      pScreen->InstallColormap = CMapInstallColormap;
>      pScreen->StoreColors = CMapStoreColors;
>  
> -    pScreenPriv->pScrn = pScrn;
>      pScrn->LoadPalette = loadPalette;
>      pScrn->SetOverscan = setOverscan;
>      pScreenPriv->maxColors = maxColors;
> @@ -221,7 +219,7 @@ xf86HandleColormaps(ScreenPtr pScreen,
>  #endif
>      pScrn->ChangeGamma = CMapChangeGamma;
>  
> -    ComputeGamma(pScreenPriv);
> +    ComputeGamma(pScrn, pScreenPriv);

I would have gone one further and not passed pScreenPriv here as it's
referenced (indirectly) from pScrn, of course. But, that's probably just me.

Reviewed-by: Keith Packard <keithp at keithp.com>

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140929/99e714f1/attachment-0001.sig>


More information about the xorg-devel mailing list