Commit Graph

232 Commits

Author SHA1 Message Date
Gargi Sharma a33d506b72 staging: xgifb: fix alignment for if arguments
Reduce indentation of multi-line if-test arguments for better readability.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16 10:27:52 +02:00
Gargi Sharma e35bf9b44d staging: xgifb: remove blank line before closing brace
delete blank line before '}' to fix the checkpatch issue Blank lines
aren't necessary before a closing brace '}'.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16 10:27:52 +02:00
Gargi Sharma 4d09a43839 staging: xgifb: add spaces around |
insert spaces around '|' to fix the checkpatch issue
spaces preferred around that '|'.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16 10:27:52 +02:00
Gargi Sharma 909bb2b41f staging: xgifb: remove blank line after open brace
delete a blank line after an open brace to fix the check patch issue,
Blank lines aren't necessary after an open brace '{'.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16 10:27:52 +02:00
Gargi Sharma aa18660f62 staging: xgifb: remove unnecessary parentheses
! has higher priority than && or ||, so remove parentheses around
! expressions to make the code more readable.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16 10:27:52 +02:00
Gargi Sharma 13bfbf0edc staging: xgifb: move AND operator for logical continuation
Move && up to the previous line, to fix the checkpatch issue Logical
continuations should be on the previous line.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16 10:27:52 +02:00
Clifton Barnes 56e18f8cdf staging: xgifb: fix block comments
fix checkpatch.pl warning about 'Block comments use a trailing */ on a
separate line' and 'Block comments use * on subsequent lines'

Signed-off-by: Clifton Barnes <clifton.a.barnes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-30 21:34:55 -07:00
Clifton Barnes c3f0692aee staging: xgifb: fix code indent
fix checkpatch.pl warning about 'suspect code indent for conditional
statements'

Signed-off-by: Clifton Barnes <clifton.a.barnes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-29 12:40:20 -07:00
Nicholas Sim aaeb5e7f03 staging: xgifb: remove extra braces from if stmt (single branch)
Remove braces from one branch of if statement where both branches only
have a single line of code, as suggested in Documentation/CodingStyle

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Nicholas Sim 26b6943236 staging: xgifb: ensure braces on all arms of if stmt
Added braces on else arm of if statement where if arm already has braces
as suggested for clarity in Documentation/CodingStyle

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Rehas Sachdeva c7437f342d staging: xgifb: Avoid multiple blank lines
This patch removes the checkpatch.pl warnings regarding multiple blank
lines as single blank line is the preferred coding style.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Janani Ravichandran 7aa546e410 staging: xgifb: Remove unneeded parentheses
Remove unneeded parentheses around the right hand side of assignments as
they are not needed. Semantic patch:

@@
expression a, b, c;
@@

(
  a = (b == c)
|
  a =
- (
  b
- )
)

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:50:11 -08:00
Bhumika Goyal cb601424ba Staging: xgifb: Remove unnecessary blank lines
This patch removes unnecessary blank lines after { and before }.
Found using checkpatch.pl.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:50:11 -08:00
Bhumika Goyal 89322a09f2 Staging: xgifb: Remove space after type cast
This patch removes unnecessary space after type casts.
Found using checkpatch.pl.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:50:11 -08:00
Fabian Frederick 64746c0c6a staging: xgifb: use swap() in XGI_WriteDAC()
Use kernel.h macro definition.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 10:30:40 +09:00
Colin Cronin 3786a0f2bc Staging: xgifb: vb_setmode: Fixed spelling error
Fixed spelling error in comment.

Signed-off-by: Colin Cronin <colinpatrickcronin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 10:30:40 +09: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
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
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
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
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
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
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 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
Aaro Koskinen 597d96b63b staging: xgifb: rename SR15/SR13 arrays to SR18
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>
2013-03-28 16:10:16 -07:00
Peter Huewe 771f3eed63 staging/xgifb: Remove duplicated code in loops.
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>
2013-02-15 15:12:40 -08:00
Peter Huewe 053004b375 staging/xgifb: Consolidate return paths
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>
2013-02-15 15:12:40 -08:00