lkml.org 
[lkml]   [2012]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 14/19] Staging: xgifb: Refactor XGI_GetCRT2ResInfo().
    Date
    Use a goto to remove one level of indentation, fixing style warnings.

    Signed-off-by: Miguel Gómez <magomez@igalia.com>
    ---
    drivers/staging/xgifb/vb_setmode.c | 61 ++++++++++++++++++------------------
    1 file changed, 31 insertions(+), 30 deletions(-)

    diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c
    index 9dfc2de..a7ba99f 100644
    --- a/drivers/staging/xgifb/vb_setmode.c
    +++ b/drivers/staging/xgifb/vb_setmode.c
    @@ -3263,46 +3263,47 @@ static void XGI_GetCRT2ResInfo(unsigned short ModeNo,
    if (modeflag & DoubleScanMode)
    yres *= 2;

    - if (pVBInfo->VBInfo & SetCRT2ToLCD) {
    - if (pVBInfo->IF_DEF_LVDS == 0) {
    - if (pVBInfo->LCDResInfo == Panel_1600x1200) {
    - if (!(pVBInfo->LCDInfo & XGI_LCDVESATiming)) {
    - if (yres == 1024)
    - yres = 1056;
    - }
    + if (!(pVBInfo->VBInfo & SetCRT2ToLCD))
    + goto exit;
    +
    + if (pVBInfo->IF_DEF_LVDS == 0) {
    + if (pVBInfo->LCDResInfo == Panel_1600x1200) {
    + if (!(pVBInfo->LCDInfo & XGI_LCDVESATiming)) {
    + if (yres == 1024)
    + yres = 1056;
    }
    + }

    - if (pVBInfo->LCDResInfo == Panel_1280x1024) {
    - if (yres == 400)
    - yres = 405;
    - else if (yres == 350)
    - yres = 360;
    + if (pVBInfo->LCDResInfo == Panel_1280x1024) {
    + if (yres == 400)
    + yres = 405;
    + else if (yres == 350)
    + yres = 360;

    - if (pVBInfo->LCDInfo & XGI_LCDVESATiming) {
    - if (yres == 360)
    - yres = 375;
    - }
    + if (pVBInfo->LCDInfo & XGI_LCDVESATiming) {
    + if (yres == 360)
    + yres = 375;
    }
    + }

    - if (pVBInfo->LCDResInfo == Panel_1024x768) {
    - if (!(pVBInfo->LCDInfo & XGI_LCDVESATiming)) {
    - if (!(pVBInfo->LCDInfo
    - & LCDNonExpanding)) {
    - if (yres == 350)
    - yres = 357;
    - else if (yres == 400)
    - yres = 420;
    - else if (yres == 480)
    - yres = 525;
    - }
    + if (pVBInfo->LCDResInfo == Panel_1024x768) {
    + if (!(pVBInfo->LCDInfo & XGI_LCDVESATiming)) {
    + if (!(pVBInfo->LCDInfo & LCDNonExpanding)) {
    + if (yres == 350)
    + yres = 357;
    + else if (yres == 400)
    + yres = 420;
    + else if (yres == 480)
    + yres = 525;
    }
    }
    }
    -
    - if (xres == 720)
    - xres = 640;
    }

    + if (xres == 720)
    + xres = 640;
    +
    +exit:
    pVBInfo->VGAHDE = xres;
    pVBInfo->HDE = xres;
    pVBInfo->VGAVDE = yres;
    --
    1.7.9.5
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2012-07-06 01:21    [W:0.039 / U:63.580 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site