summaryrefslogtreecommitdiffstats
path: root/drivers/staging/xgifb/vb_setmode.c
Commit message (Collapse)AuthorAgeFilesLines
* staging: xgifb: use swap() in XGI_WriteDAC()Fabian Frederick2015-05-311-13/+6Star
| | | | | | | Use kernel.h macro definition. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: xgifb: vb_setmode: Fixed spelling errorColin Cronin2015-05-311-1/+1
| | | | | | | Fixed spelling error in comment. Signed-off-by: Colin Cronin <colinpatrickcronin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: rewrite the right hand side of an assignmentAya Mahfouz2015-02-271-70/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch rewrites the right hand side of an assignment for expressions of the form: a = (a <op> b); to be: a <op>= b; where <op> = << | >>. This issue was detected and resolved using the following coccinelle script: @@ identifier i; expression e; @@ -i = (i >> e); +i >>= e; @@ identifier i; expression e; @@ -i = (i << e); +i <<= e; Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: remove unneeded parentheses around the right hand side of an assignmentJiayi Ye2014-10-271-1/+1
| | | | | | | | | | | | | | | | In assignments such as value = (FLASH_CMD_STATUS_REG_READ << 24);, parentheses are not needed. The Coccinelle semantic patch was used to find cases. @r@ identifier x; expression e1, e2; @@ - x = (e1 << e2); + x = e1 << e2; Signed-off-by: Jiayi Ye <yejiayily@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: remove unnecessary elseThomas Gummerer2014-09-071-2/+1Star
| | | | | Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: xgifb: Fixed a code-style warningChaitanya Hazarey2014-05-231-0/+1
| | | | | | | | | Added a blank line after declarations to fix the following warning issued by checkpatch.pl: drivers/staging/xgifb/vb_init.c:800: WARNING: Missing a blank line after declarations Signed-off-by: Chaitanya Hazarey <c@24.io> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb coding style cleanupVitor Braga2014-04-261-0/+2
| | | | | | | | | | This fixes "missing a blank line after declaration" warnings from checkpatch.pl for driver xgifb. The driver has no remaining errors or warnings from checkpatch.pl Signed-off-by: Vitor Braga <vitorpybraga@gmail.com> Reviewed-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: xgifb: fix braces {} are not necessary for any arm of this statementEbru Akagunduz2013-10-301-3/+2Star
| | | | | | | | Fix checkpatch.pl issues with braces {} are not necessary for any arm of this statement in vb_setmode.c Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: xgifb: braces {} are not necessary for single statement in vb_setmodeEbru Akagunduz2013-10-081-4/+2Star
| | | | | | | | | Fix checkpatch.pl issues with braces {} are not necessary for single statement blocks in vb_setmode.c Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: delete unused "pVBInfo" parametersAaro Koskinen2013-07-241-15/+10Star
| | | | | | | Delete unused "pVBInfo" parameters from internal functions. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: delete unused "RefreshRateTableIndex" parametersAaro Koskinen2013-07-241-27/+17Star
| | | | | | | Delete unused "RefreshRateTableIndex" parameters from internal functions. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: delete unused "HwDeviceExtension" parametersAaro Koskinen2013-07-241-54/+24Star
| | | | | | | Delete unused "HwDeviceExtension" parameters from internal functions. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: delete unused "ModeIdIndex" parametersAaro Koskinen2013-07-241-23/+14Star
| | | | | | | Delete unused "ModeIdIndex" parameters from internal functions. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: delete unused "ModeNo" parametersAaro Koskinen2013-07-241-134/+107Star
| | | | | | | Delete unused "ModeNo" parameters from internal functions. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: vb_setmode: delete IF_DEF_CRT2Monitor checksAaro Koskinen2013-05-301-14/+5Star
| | | | | | | | Code checking for IF_DEF_CRT2Monitor is only executed for chips < XG20, and there IF_DEF_CRT2Monitor is always true, so the flag is redundant. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: vb_setmode: delete IF_DEF_HiVision checksAaro Koskinen2013-05-301-25/+14Star
| | | | | | | | Code checking for IF_DEF_HiVision is only executed for chips < XG20, and there IF_DEF_HiVision is always true, so the flag is redundant. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: vb_setmode: delete IF_DEF_YPbPr checksAaro Koskinen2013-05-301-41/+26Star
| | | | | | | | Code checking for IF_DEF_YPbPr is only executed for chips < XG20, and there IF_DEF_YPbPr is always true, so the flag is redundant. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: delete redundant return statementsAaro Koskinen2013-05-301-14/+1Star
| | | | | | | Delete redundant return statements at the end of void functions. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: XGI_DisableBridge(): delete redundant checksAaro Koskinen2013-05-301-11/+4Star
| | | | | | | Delete some redudant checks. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: XGI_EnableChISLCD(): delete trivial functionAaro Koskinen2013-05-301-28/+5Star
| | | | | | | The function returns always false, delete it. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: SetFlag: delete EnableChAAaro Koskinen2013-05-301-18/+3Star
| | | | | | | | This flag is never set, so checks can be removed and code behind it deleted. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: SetFlag: delete DisableChAAaro Koskinen2013-05-301-24/+11Star
| | | | | | | | This flag is never set, so checks can be removed and code behind it deleted. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: SetFlag: delete EnableChBAaro Koskinen2013-05-301-14/+4Star
| | | | | | | | This flag is never set, so checks can be removed and code behind it deleted. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: SetFlag: delete DisableChBAaro Koskinen2013-05-301-33/+19Star
| | | | | | | | This flag is never set, so checks can be removed and code behind it deleted. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: SetFlag: delete GatingCRTAaro Koskinen2013-05-301-16/+3Star
| | | | | | | | This flag is never set, so checks can be removed and code behind it deleted. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: XGI_SetCRT1VCLK(): avoid copy-pasteAaro Koskinen2013-05-301-10/+4Star
| | | | | | | Avoid copy-pasted code in if branches by rearranging the checks. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: XGI_GetRatePtrCRT2(): delete IF_DEF_LVDS checkAaro Koskinen2013-05-301-8/+3Star
| | | | | | | | IF_DEF_LVDS cannot be set if ProgrammingCRT2 flag is set, so remove the check to simplify the code. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: XGI_AjustCRT2Rate(): delete IF_DEF_LVDS checkAaro Koskinen2013-05-301-55/+34Star
| | | | | | | | IF_DEF_LVDS cannot be set when XGI_AjustCRT2Rate() is called, so we can remove the check and dead code. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: call XGI_GetVBType from InitTo330PointerAaro Koskinen2013-05-301-3/+3
| | | | | | | Move XGI_GetVBType call inside InitTo330Pointer to avoid code duplication. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: XGI_GetVBType(): delete IF_DEF_LVDS checkAaro Koskinen2013-05-301-3/+0Star
| | | | | | | | XGI_GetVBType() is called only for chips < XG20 so IF_DEF_LVDS cannot be set. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: refactor XGI_BridgeIsOn()Aaro Koskinen2013-05-301-15/+0Star
| | | | | | | | Refactor XGI_BridgeIsOn(). IF_DEF_LVDS bit is not valid for < XG20 chips. Also we can make the function static by moving it to vb_init. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/xgifb: Remove dead assignments/incrementsPeter Huewe2013-05-181-19/+1Star
| | | | | | | | | | The code now contains several dead assignments which are shadowed by another assignment a few lines later. -> This patch removes them (and possibly associated code). Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/xgifb: Fix always false condition in vb_setmode.c (smatch)Peter Huewe2013-05-171-1/+1
| | | | | | | | | | | | | Smatch complains: drivers/staging/xgifb/vb_setmode.c:3181 XGI_SetLockRegs() warn: bitwise AND condition is false here Since SetNTSCTV is defined as 0 in drivers/video/sis/initdef.h this is correct. -> Change the condition to == to fix this. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: rename SR15/SR13 arrays to SR18Aaro Koskinen2013-03-291-2/+2
| | | | | | | | Since we are programming SR register 18, better name structs/arrays accordingly to avoid confusion. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/xgifb: Remove duplicated code in loops.Peter Huewe2013-02-161-8/+3Star
| | | | | | | | | | Instead of calling the same function three times in a loop, multiply the loop counter by three. And since the value in DAC_TEST_PARMS is always the same we can use the value directly. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/xgifb: Consolidate return pathsPeter Huewe2013-02-161-3/+1Star
| | | | | | | | Both branches of this if statement end in the same return statement. -> move the return to the bottom and get rid of the else statement. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/xgifb: Remove code without effectPeter Huewe2013-02-161-8/+1Star
| | | | | | | | | | The tempal variable is assigned and then immediately overwritten. -> remove everything without effect. The inb is kept for possible side effects. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/xgifb: Remove unnecessary castsPeter Huewe2013-02-161-35/+31Star
| | | | | | | | | | Both functions xgifb_reg_get and inb return an u8 value, so we don't need to cast their return value to unsigned char. -> remove the cast Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/xgifb: Consolidate if/else if with identical code branchesPeter Huewe2013-02-161-5/+2Star
| | | | | | | | Both branches of this if statement execute the same code. Thus we can || them together and remove code duplication Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: XGI_SetDelayComp(): delete IF_DEF_LVDS checkAaro Koskinen2013-02-091-10/+0Star
| | | | | | | Delete IF_DEF_LVDS check, this function is never called when it's true. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: XGI_GetCRT2ResInfo(): delete IF_DEF_LVDS checkAaro Koskinen2013-02-091-25/+23Star
| | | | | | | Delete IF_DEF_LVDS check, this function is never called when it's true. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: XGI_GetLCDInfo(): delete IF_DEF_LVDS checkAaro Koskinen2013-02-091-15/+12Star
| | | | | | | Delete IF_DEF_LVDS check, this function is never called when it's true. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: XGI_GetTVInfo(): delete IF_DEF_LVDS checksAaro Koskinen2013-02-091-28/+19Star
| | | | | | | | This function is never called when pVBInfo->IF_DEF_LVDS is true, so we can remove checks and reduce complexity. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: XGI_GetVBInfo(): delete IF_DEF_LVDS checkAaro Koskinen2013-02-091-69/+35Star
| | | | | | | Delete IF_DEF_LVDS check, this function is never called when it's true. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: XGI_GetVCLK2Ptr(): delete IF_DEF_LVDS checkAaro Koskinen2013-02-091-41/+30Star
| | | | | | | Delete IF_DEF_LVDS check, this function is never called when it's true. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/xgifb: Consolidate if branches with similar conditionsPeter Huewe2013-02-051-11/+2Star
| | | | | | | | | | | | 1) The same condition (pVBInfo->IF_DEF_LVDS == 0) was checked in the if clause directly in front of this one. 2) The same condition pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV | VB_SIS302LV | VB_XGI301C) was checked in the if clause directly in front of this one. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/xgifb: Consolidate if/else for 'identical' branchesPeter Huewe2013-02-051-25/+6Star
| | | | | | | | | | Since XGI_LCDDesStruct is fully contained in XGI330_LCDDataDesStruct2 and the offsets for the first members is identical we can consolidate the if/else branches here and use XGI330_LCDDataDesStruct2 for everything. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/xgifb: Simplify XGISetModeNewPeter Huewe2013-02-041-15/+3Star
| | | | | | | | | This patch simplifies the code of XGISetModeNew by reordering the if/else if/case conditions when both branches are doing exactly the same. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/xgifb: Consolidate XGI_EnableChISLCD and XGI_DisableChISLCDPeter Huewe2013-02-041-35/+13Star
| | | | | | | | These two functions share the same code except one line - thus we can simply merge them and add a parameter to switch between both variants. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/xgifb: Remove unnecessary bitshifts in XGI_SetCRT1ModeRegsPeter Huewe2013-02-041-4/+2Star
| | | | | | | | | | Since data can only be 0x0000, 0x0035 or 0x0048 we can simply skip the bit shifting and masking as data & 0xFF is always equal to data and data & 0xFF00 is always 0. So we simply use data and 0 directly and save the assignment. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>