Commit graph

514 commits

Author SHA1 Message Date
Aya Mahfouz 9ea755f3e8 staging: xgifb: remove extra parentheses around right bit shift operations
Removes extra parentheses around bitwise right shift operations.
The cases handled here are when resultant values are assigned to
variables. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 15:22:43 -08:00
Aya Mahfouz 462833726c staging: xgifb: rewrite the right hand side of an assignment
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>
2015-02-26 15:23:46 -08:00
Aaro Koskinen 509031dd5f staging: xgifb: fix colours on big-endian machines other than powerpc
XGI framebuffer supports big-endian machines, but it's currently
enabled based on __powerpc__ define (which is wrong, as powerpc can
be also little-endian now). Use __BIG_ENDIAN instead. This will fix
wrong colours on such machines.

Tested on parisc with XGI Z7.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07 17:24:11 +08:00
Sudip Mukherjee 38c977230c staging: xgifb: remove unnecessary check
the check for htotal and vtotal is not required as we have already
checked for them and returned -EINVAL if any of them is zero.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 16:15:59 -08:00
Sarah Khan 85ebbcca8a staging: xgifb: Removed a definition which was not used in driver
This patch removes a definition that was not used in driver xgifb

Signed-off-by: Sarah Khan <sarahjmi07@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-03 16:10:38 -08:00
Brian Vandre 92be2d4d3c Staging: xgifb: fix space before comma
This fixes the checkpatch.pl error:
ERROR: space prohibited before that ','

Signed-off-by: Brian Vandre <bvandre@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 16:05:16 -07:00
Jiayi Ye 1d06bb4e9d staging: remove unneeded parentheses around the right hand side of an assignment
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>
2014-10-27 10:33:06 +08:00
Sarah Khan fe4c6a38b8 staging: xgifb: Removed an unnecessary assignment statement
Used coccinelle patch
@@

expression data;
identifier f;

@@

-data =
+return
     f(...);
-return (data);

Signed-off-by: Sarah Khan <sarahjmi07@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-27 10:33:05 +08:00
Thomas Gummerer 9c8c831514 staging: xgifb: remove unnecessary else
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-06 21:48:19 -07:00
Chaitanya Hazarey 0292bd466a Staging: xgifb: Fixed a code-style warning
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>
2014-05-24 04:42:20 +09:00
Lubomir Rintel 5a0ba45727 staging: xgifb: Update TODO
There's no more printk abuse, it's been sorted out in
448810662a ("Staging: xgifb: Remove printk usage.")

Extra ifdefs have been fixed too, mostly in
800d67cf9f ("staging: xgifb: eliminate #ifdef Tap4"),
c39aada692 ("staging: xgifb: eliminate #ifdef XGIFB_PAN"),
fa4c212f2b ("staging: xgifb: delete unused definitions"),
5c167b30c1 ("staging: xgifb: eliminate #ifdef NewScratch"),
f059077388 ("Staging: xgifb: Remove #ifdef MODULE") and more.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 10:03:32 -07:00
Lubomir Rintel 51c4491457 staging: xgifb: Drop some more useless defines
SetLCDStdMode is not supported as of 34c13ee2b6 ("staging: xgifb: drop
code for legacy VGA modes").

DisableLCD24bpp defined to zero was never realy useful and went away with
aa56b2790a ("staging: xgifb: vb_table: delete XGI21_LCDCapList").

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 10:03:31 -07:00
Lubomir Rintel a5c79d610f staging: xgifb: Initialize Part0Port
It was left uninitialized, likely overseen, in this commit:
56810a92c6 ("staging: xgifb: use XGIRegInit()
Avoid copy-paste and use XGIRegInit() to initialize registers addresses.")

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 10:03:31 -07:00
Lubomir Rintel bb7e5ed497 staging: xgifb: Eliminate useless ifndefs
XGI_VB_CHIP_TYPE, PCI_DEVICE_ID_XGI_42 and PCI_DEVICE_ID_XGI_27
are never defined.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 10:03:31 -07:00
Vitor Braga 694683f631 staging: xgifb coding style cleanup
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>
2014-04-25 16:20:02 -07:00
Tomi Valkeinen f7018c2135 video: move fbdev to drivers/video/fbdev
The drivers/video directory is a mess. It contains generic video related
files, directories for backlight, console, linux logo, lots of fbdev
device drivers, fbdev framework files.

Make some order into the chaos by creating drivers/video/fbdev
directory, and move all fbdev related files there.

No functionality is changed, although I guess it is possible that some
subtle Makefile build order related issue could be created by this
patch.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Rob Clark <robdclark@gmail.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-17 08:10:19 +03:00
Monam Agarwal e508b52a45 Staging: xgifb: Fix quoted string split across lines in XGI_main_26.c
This patch fixes the following checkpatch.pl issues in XGI_main_26.c:
WARNING: Quoted string split across lines

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-28 14:29:38 -08:00
Jingoo Han 41e043fcfa staging: remove DEFINE_PCI_DEVICE_TABLE macro
Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro
is not preferred.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-02 22:32:35 -08:00
Ebru Akagunduz 4759e82481 Staging: xgifb: fix braces {} are not necessary for any arm of this statement
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>
2013-10-30 09:22:05 -07:00
Ashvini Varatharaj 1d2a01eb40 Staging: xgifb: remove space before semicolon
Fix checkpatch warning: WARNING:space prohibited before semicolon

Signed-off-by: Ashvini Varatharaj <ashvinivaratharaj@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-14 09:15:27 -07:00
Ebru Akagunduz f88d818717 Staging: xgifb: braces {} are not necessary for single statement in vb_setmode
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>
2013-10-07 18:39:32 -07:00
Sachin Kamat 477c81f025 staging: xgifb: Remove redundant pci_set_drvdata
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25 16:45:19 -07:00
Kumar Gaurav 2acb6111d7 Staging: xgifb: Fixed a warning of Space before semicolon
Fixed issue by removing Space before semicolon

Signed-off-by: Kumar Gaurav <kumargauravgupta3@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-12 14:08:27 -07:00
Aaro Koskinen 334ab0728d staging: xgifb: delete unused "pVBInfo" parameters
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>
2013-07-23 15:01:09 -07:00
Aaro Koskinen 88a3dfdd93 staging: xgifb: delete unused "RefreshRateTableIndex" parameters
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>
2013-07-23 15:01:09 -07:00
Aaro Koskinen b053af1688 staging: xgifb: delete unused "HwDeviceExtension" parameters
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>
2013-07-23 15:01:09 -07:00
Aaro Koskinen 6b6e6a3995 staging: xgifb: delete unused "ModeIdIndex" parameters
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>
2013-07-23 15:01:09 -07:00
Aaro Koskinen 3d05f66f76 staging: xgifb: delete unused "ModeNo" parameters
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>
2013-07-23 15:01:09 -07:00
Aaro Koskinen f3ac47cf79 staging: xgifb: delete unused "rateindex" parameters
Delete unused "rateindex" parameters from internal functions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23 15:01:09 -07:00
Aaro Koskinen ee76875ea5 staging: xgifb: vb_setmode: delete IF_DEF_CRT2Monitor checks
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>
2013-05-30 20:55:53 +09:00
Aaro Koskinen aee0ac92f4 staging: xgifb: vb_setmode: delete IF_DEF_HiVision checks
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>
2013-05-30 20:55:52 +09:00
Aaro Koskinen a4ce0e7e6e staging: xgifb: vb_setmode: delete IF_DEF_YPbPr checks
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>
2013-05-30 20:55:52 +09:00
Aaro Koskinen 2351d1fd97 staging: xgifb: delete redundant return statements
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>
2013-05-30 20:55:52 +09:00
Aaro Koskinen 41fc5f031c staging: xgifb: XGI_DisableBridge(): delete redundant checks
Delete some redudant checks.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 20:55:51 +09:00
Aaro Koskinen 056b5405fa staging: xgifb: XGI_EnableChISLCD(): delete trivial function
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>
2013-05-30 20:55:51 +09:00
Aaro Koskinen a2526d1f32 staging: xgifb: SetFlag: delete EnableChA
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>
2013-05-30 20:55:51 +09:00
Aaro Koskinen d1724637e1 staging: xgifb: SetFlag: delete DisableChA
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>
2013-05-30 20:55:51 +09:00
Aaro Koskinen b8e34b3ffa staging: xgifb: SetFlag: delete EnableChB
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>
2013-05-30 20:55:51 +09:00
Aaro Koskinen c4f9c31ebe staging: xgifb: SetFlag: delete DisableChB
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>
2013-05-30 20:55:50 +09:00
Aaro Koskinen ae424a3d6e staging: xgifb: SetFlag: delete GatingCRT
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>
2013-05-30 20:55:49 +09:00
Aaro Koskinen b750f51661 staging: xgifb: XGI_SetCRT1VCLK(): avoid copy-paste
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>
2013-05-30 20:55:49 +09:00
Aaro Koskinen b0b4a8a126 staging: xgifb: XGI_GetRatePtrCRT2(): delete IF_DEF_LVDS check
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>
2013-05-30 20:55:49 +09:00
Aaro Koskinen 0903b0dbd2 staging: xgifb: XGI_AjustCRT2Rate(): delete IF_DEF_LVDS check
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>
2013-05-30 20:55:48 +09:00
Aaro Koskinen ce76de5abe staging: xgifb: call XGI_GetVBType from InitTo330Pointer
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>
2013-05-30 20:55:47 +09:00
Aaro Koskinen 4b8071121d staging: xgifb: XGI_GetVBType(): delete IF_DEF_LVDS check
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>
2013-05-30 20:55:47 +09:00
Aaro Koskinen c976c7819b staging: xgifb: refactor XGI_BridgeIsOn()
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>
2013-05-30 20:55:47 +09:00
Peter Huewe 7580d7feb4 staging/xgifb: Remove dead assignments/increments
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>
2013-05-17 15:47:18 -07:00
Peter Huewe 85b38476fd staging/xgifb: Fix always false condition in vb_setmode.c (smatch)
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>
2013-05-16 16:02:35 -07:00
Peter Huewe 986eb9fad5 staging/xgifb: Remove unnecessary binary calculation in GetXG27FPBits
If temp <= 2 no other bits than the lowest two (0x03) can be set anyway
-> this operation can be removed.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16 16:02:34 -07:00
Peter Huewe 9195ba095d staging/xgifb: Consolidate function almost identical calls in XGINew_GetXG21Sense
Instead of calling xgifb_reg_and_or with almost identical parameters in
a simple if/else scenario, we assign the changing parameter to a temp
variable and call xgifb_reg_and_or only from one location.

-> Easier to read, easier to understand (especially wrt the line breaks)

(For the if condition we don't need the Temp variable, so we can use the
value directly).

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16 16:02:34 -07:00