[PATCH xf86-video-dummy v2] Remove pointless empty functions

Antoine Martin antoine at nagafix.co.uk
Fri Sep 23 06:00:37 UTC 2016


On 22/09/16 23:14, Aaron Plattner wrote:
> These functions might be useful in a real driver, but with no
> hardware, they're pointless.  Get rid of them.
> 
> v2: Rebase, get rid of pointless calls to DUMMYAdjustFrame, return TRUE from
> DUMMYSwitchMode.
> 
> Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
Both:
Reviewed-by: Antoine Martin <antoine at nagafix.co.uk>
Tested-by: Antoine Martin <antoine at nagafix.co.uk>

Cheers
Antoine

> ---
>  src/dummy_driver.c | 44 +-------------------------------------------
>  1 file changed, 1 insertion(+), 43 deletions(-)
> 
> diff --git a/src/dummy_driver.c b/src/dummy_driver.c
> index cf150539e10b..265660280549 100644
> --- a/src/dummy_driver.c
> +++ b/src/dummy_driver.c
> @@ -65,9 +65,6 @@ static ModeStatus DUMMYValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode,
>  static Bool	DUMMYSaveScreen(ScreenPtr pScreen, int mode);
>  
>  /* Internally used functions */
> -static Bool     dummyModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
> -static void	dummySave(ScrnInfoPtr pScrn);
> -static void	dummyRestore(ScrnInfoPtr pScrn, Bool restoreText);
>  static Bool	dummyDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op,
>  				pointer ptr);
>  
> @@ -461,14 +458,6 @@ DUMMYPreInit(ScrnInfoPtr pScrn, int flags)
>  static Bool
>  DUMMYEnterVT(VT_FUNC_ARGS_DECL)
>  {
> -    SCRN_INFO_PTR(arg);
> -    
> -    /* Should we re-save the text mode on each VT enter? */
> -    if(!dummyModeInit(pScrn, pScrn->currentMode))
> -      return FALSE;
> -
> -    DUMMYAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0));
> -
>      return TRUE;
>  }
>  
> @@ -476,8 +465,6 @@ DUMMYEnterVT(VT_FUNC_ARGS_DECL)
>  static void
>  DUMMYLeaveVT(VT_FUNC_ARGS_DECL)
>  {
> -    SCRN_INFO_PTR(arg);
> -    dummyRestore(pScrn, TRUE);
>  }
>  
>  static void
> @@ -535,15 +522,6 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
>  
>      if (!(dPtr->FBBase = malloc(pScrn->videoRam * 1024)))
>  	return FALSE;
> -    
> -    /*
> -     * next we save the current state and setup the first mode
> -     */
> -    dummySave(pScrn);
> -    
> -    if (!dummyModeInit(pScrn,pScrn->currentMode))
> -	return FALSE;
> -    DUMMYAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0));
>  
>      /*
>       * Reset visual list.
> @@ -665,8 +643,7 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
>  Bool
>  DUMMYSwitchMode(SWITCH_MODE_ARGS_DECL)
>  {
> -    SCRN_INFO_PTR(arg);
> -    return dummyModeInit(pScrn, mode);
> +    return TRUE;
>  }
>  
>  /* Mandatory */
> @@ -683,7 +660,6 @@ DUMMYCloseScreen(CLOSE_SCREEN_ARGS_DECL)
>      DUMMYPtr dPtr = DUMMYPTR(pScrn);
>  
>      if(pScrn->vtSema){
> - 	dummyRestore(pScrn, TRUE);
>  	free(dPtr->FBBase);
>      }
>  
> @@ -725,24 +701,6 @@ DUMMYValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags)
>      return(MODE_OK);
>  }
>  
> -static void
> -dummySave(ScrnInfoPtr pScrn)
> -{
> -}
> -
> -static void 
> -dummyRestore(ScrnInfoPtr pScrn, Bool restoreText)
> -{
> -}
> -    
> -static Bool
> -dummyModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
> -{
> -    dummyRestore(pScrn, FALSE);
> -    
> -    return(TRUE);
> -}
> -
>  Atom VFB_PROP  = 0;
>  #define  VFB_PROP_NAME  "VFB_IDENT"
>  
> 



More information about the xorg-devel mailing list