[PATCH 1/2] char/tpm: Remove duplicated lookup table

2012-11-12 Thread Peter Huewe
The entries in tpm_protected_ordinal_duration are exactly the same as the first 12 in tpm_ordinal_duration, so we can simply remove this one, and save some bytes. This does not change the behavior of the driver. Signed-off-by: Peter Huewe peterhu...@gmx.de --- This patch reflects only my opinion

[PATCH 2/2] char/tpm: simplify duration calculation and eliminate sparse warning.

2012-11-12 Thread Peter Huewe
/tpm.c:360 tpm_calc_ordinal_duration() error: buffer overflow 'tpm_protected_ordinal_duration' 12 = 243 Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/char/tpm/tpm.c | 13 ++--- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/char/tpm/tpm.c b/drivers/char

[PATCH v2] tpm: Add support for new Infineon I2C TPM (SLB 9645 TT 1.2 I2C)

2013-03-04 Thread Peter Huewe
retained as a compatible id as a fallback to slb9635 protocol. The driver was tested on Beaglebone. Signed-off-by: Peter Huewe peter.hu...@infineon.com --- Please apply on top of char/tpm: Convert struct i2c_msg initialization to C99 format by Shubhrajyoti Datta .../devicetree/bindings/i2c/trivial

[PATCH] tpm/tpm_i2c_infineon.c: Add OF attributes type and name to the of_device_id table entries

2013-03-04 Thread Peter Huewe
As the subject says. It's probably a good idea to have these fields populated. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/char/tpm/tpm_i2c_infineon.c | 21 ++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b

[PATCH] tpm/tpm_i2c_infineon: Add small comment about return value of __i2c_transfer

2013-03-04 Thread Peter Huewe
Kent Yoder indicated that the code might be a bit clearer with a comment here, so this patch adds a small explanation of the code. CC: Kent Yoder shpedoi...@gmail.com Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/char/tpm/tpm_i2c_infineon.c | 9 + 1 file changed, 9 insertions

[PATCH v3] char/tpm: Use true and false for bools

2012-11-29 Thread Peter Huewe
patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Peter Huewe peterhu...@gmx.de --- v3 for this tiny patch... shame on me. drivers/char/tpm/tpm_tis.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm

[PATCH] staging/goldfish: Add MTD dependency to KCONFIG

2013-02-07 Thread Peter Huewe
': goldfish_nand.c:(.text+0x6e8ba2): undefined reference to `mtd_erase_callback' drivers/built-in.o: In function `goldfish_nand_init_device': goldfish_nand.c:(.text+0x6e8eba): undefined reference to `mtd_device_parse_register' Reported-by: Randy Dunlap rdun...@infradead.org Signed-off-by: Peter Huewe peterhu

[PATCH] staging/goldfish: Use %zx for printing size_t variables

2013-02-07 Thread Peter Huewe
': goldfish_nand.c:239:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'size_t' [-Wformat] - As defined in the printk-formats use %zx for size_t variables Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/goldfish/goldfish_nand.c |8

[PATCH] tpm: Add support for new Infineon I2C TPM (SLB 9645 TT 1.2 I2C)

2013-02-08 Thread Peter Huewe
retained as a compatible id as a fallback to slb9635 protocol. The driver was tested on Beaglebone. Signed-off-by: Peter Huewe peter.hu...@infineon.com --- Patch against Kent's tpmdd-02-05-13 branch You might get an out-of-office reply, but I'm monitoring this email address nevertheless. Thanks, Peter

[PATCH 1/9] staging/rtl8187se: Remove code without effect

2013-02-12 Thread Peter Huewe
Local variable AcmCtrl is never read/used after assignment so we can remove all assignments to it and the related code around the assignments. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/rtl8187se/r8185b_init.c | 49 +-- 1 files changed, 1

[PATCH 8/9] staging/rtl8187se: Remove duplicated code by using an offset

2013-02-12 Thread Peter Huewe
In SetAntennaConfig87SE both branches of if (bAntDiversity) do exactly the same, except that there is an offset of 0x80 for the register values if bAntDiversity is true. - Consolidate both branches and assign the offset if necessary. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers

[PATCH 5/9] staging/rtl8187se: Reuse ReadBBPortUchar to avoid duplicated code

2013-02-12 Thread Peter Huewe
variables UCharData and RegisterContent in WriteBBPortUchar as they are not used / without effect. Both functions are only 'local' so we can mark them as static. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/rtl8187se/r8185b_init.c | 30 +++--- 1 files

[PATCH 7/9] staging/rtl8187se: Remove unused functions PlatformIORead2Byte / PlatformIORead4Byte

2013-02-12 Thread Peter Huewe
These two functions PlatformIORead2Byte and PlatformIORead4Byte are unused and thus can be removed. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/rtl8187se/r8185b_init.c | 20 1 files changed, 0 insertions(+), 20 deletions(-) diff --git a/drivers

[PATCH 9/9] staging/rtl8187se: Mark functions as static to silence sparse

2013-02-12 Thread Peter Huewe
' was not declared. Should it be static? - Add the static keyword. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/rtl8187se/r8185b_init.c | 34 +++--- 1 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/rtl8187se/r8185b_init.c

[PATCH 6/9] staging/rtl8187se: Remove temporary variable for return value

2013-02-12 Thread Peter Huewe
to read_nic_byte but is kept for readability. Since this functions is local only we can mark it as static. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/rtl8187se/r8185b_init.c | 17 + 1 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/staging

[PATCH 2/9] staging/rtl8187se: Remove code without effect

2013-02-12 Thread Peter Huewe
The local variable u4bAcParam is never read/used after assignment, thus we can remove the declaration, assignment and any related code. - the local variables u1bAIFS, eACI and pAcParam can also be removed. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/rtl8187se/r8185b_init.c

[PATCH 3/9] staging/rtl8187se: Remove code without effect

2013-02-12 Thread Peter Huewe
The local variable AcParam is only assigned to but not read/used afterwards, thus it and all related code can be removed. The bFollowLegacySetting variable and check can also be removed as it is always true. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/rtl8187se

[PATCH 4/9] staging/rtl8187se: Remove unused/unnecessary variables

2013-02-12 Thread Peter Huewe
The local variables priv and ieee are not used and thus can be removed. The local variable u1bAIFS is not used/read after assignment and thus can be removed. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/rtl8187se/r8185b_init.c |5 - 1 files changed, 0 insertions(+), 5

[PATCH 1/9] staging/rtl8187se: Remove code without effect

2013-02-12 Thread Peter Huewe
Local variable AcmCtrl is never read/used after assignment so we can remove all assignments to it and the related code around the assignments. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/rtl8187se/r8185b_init.c | 49 +-- 1 files changed, 1

[PATCH 3/9] staging/rtl8187se: Remove code without effect

2013-02-12 Thread Peter Huewe
The local variable AcParam is only assigned to but not read/used afterwards, thus it and all related code can be removed. The bFollowLegacySetting variable and check can also be removed as it is always true. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/rtl8187se

[PATCH 4/9] staging/rtl8187se: Remove unused/unnecessary variables

2013-02-12 Thread Peter Huewe
The local variables priv and ieee are not used and thus can be removed. The local variable u1bAIFS is not used/read after assignment and thus can be removed. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/rtl8187se/r8185b_init.c |5 - 1 files changed, 0 insertions(+), 5

[PATCH 2/9] staging/rtl8187se: Remove code without effect

2013-02-12 Thread Peter Huewe
The local variable u4bAcParam is never read/used after assignment, thus we can remove the declaration, assignment and any related code. - the local variables u1bAIFS, eACI and pAcParam can also be removed. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/rtl8187se/r8185b_init.c

[PATCH 6/9] staging/rtl8187se: Remove temporary variable for return value

2013-02-12 Thread Peter Huewe
to read_nic_byte but is kept for readability. Since this functions is local only we can mark it as static. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/rtl8187se/r8185b_init.c | 17 + 1 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/staging

[PATCH 7/9] staging/rtl8187se: Remove unused functions PlatformIORead2Byte / PlatformIORead4Byte

2013-02-12 Thread Peter Huewe
These two functions PlatformIORead2Byte and PlatformIORead4Byte are unused and thus can be removed. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/rtl8187se/r8185b_init.c | 20 1 files changed, 0 insertions(+), 20 deletions(-) diff --git a/drivers

[PATCH 8/9] staging/rtl8187se: Remove duplicated code by using an offset

2013-02-12 Thread Peter Huewe
In SetAntennaConfig87SE both branches of if (bAntDiversity) do exactly the same, except that there is an offset of 0x80 for the register values if bAntDiversity is true. - Consolidate both branches and assign the offset if necessary. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers

[PATCH 5/9] staging/rtl8187se: Reuse ReadBBPortUchar to avoid duplicated code

2013-02-12 Thread Peter Huewe
variables UCharData and RegisterContent in WriteBBPortUchar as they are not used / without effect. Both functions are only 'local' so we can mark them as static. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/rtl8187se/r8185b_init.c | 30 +++--- 1 files

[PATCH 9/9] staging/rtl8187se: Mark functions as static to silence sparse

2013-02-12 Thread Peter Huewe
' was not declared. Should it be static? - Add the static keyword. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/rtl8187se/r8185b_init.c | 34 +++--- 1 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/rtl8187se/r8185b_init.c

[PATCH] staging/comedi: Fix undefined array subscript

2013-02-12 Thread Peter Huewe
VMK8061_MODEL and VMK8055_MODEL it's safe to assume that VMK8055_DO_REG was meant as an initial value. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/comedi/drivers/vmk80xx.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/staging/comedi/drivers/vmk80xx.c b

[PATCH v2] staging/comedi: Fix undefined array subscript

2013-02-13 Thread Peter Huewe
VMK8061_MODEL and VMK8055_MODEL it's safe to assume that VMK8055_DO_REG was meant as an initial value. And to avoid duplication we can move the assignments to the top. Acked-by: Ian Abbott abbo...@mev.co.uk Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/comedi/drivers/vmk80xx.c | 17

[PATCH 1/5] staging/xgifb: Replace XGI340_CR6B table with simple if/else

2013-02-04 Thread Peter Huewe
can simply replace the whole lookup table with a simple if/else assignment. Tested-by: Aaro Koskinen aaro.koski...@iki.fi Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/vb_init.c |2 +- drivers/staging/xgifb/vb_table.h | 11 --- 2 files changed, 1 insertions

[PATCH 2/5] staging/xgifb: Move duplicated code for dram to helper function

2013-02-04 Thread Peter Huewe
XGINew_SetDRAMDefaultRegister340 uses the same code fragment 4 times with only a slight variation each time. - Move this code to a helper function - this saves some lines and ~450bytes in the .o / .ko Tested-by: Aaro Koskinen aaro.koski...@iki.fi Signed-off-by: Peter Huewe peterhu...@gmx.de

[PATCH 5/5] staging/xgifb: Consolidate if branches with similar conditions

2013-02-04 Thread Peter Huewe
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

[PATCH 4/5] staging/xgifb: Consolidate if/else for 'identical' branches

2013-02-04 Thread Peter Huewe
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 peterhu...@gmx.de --- drivers/staging/xgifb

[PATCH 3/5] staging/xgifb: Don't write the same values x times

2013-02-04 Thread Peter Huewe
are unnecessary. - we can safely remove them. Tested-by: Aaro Koskinen aaro.koski...@iki.fi Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/vb_init.c | 19 ++- 1 files changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/staging/xgifb/vb_init.c b

[PATCH] staging/xgifb: Remove unused variable

2013-02-05 Thread Peter Huewe
’ [-Wunused-variable] This patch fixes this Signed-off-by: Peter Huewe peterhu...@gmx.de --- Sorry that I missed that one in the patch series. drivers/staging/xgifb/vb_init.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb

[PATCH 1/6] staging/xgifb: Remove unused values in XGI340_cr41 and XGI27_cr41

2013-02-05 Thread Peter Huewe
of XGINew_GetXG20DRAMType which can only be 0, 1 or 2 - pVBInfo-CR40 is assigned to either XGI340_cr41 or XGI27_cr41 in vb_setmode.c - only the first three values are used. This becomes also evident as values 3-7 are all 0. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/vb_struct.h |2

[PATCH 2/6] staging/xgifb: Remove unused values in XG27_SR13 and XGI340_SR13

2013-02-05 Thread Peter Huewe
of XGINew_GetXG20DRAMType which can only be 0, 1 or 2 - pVBInfo-SR15 is assigned to either XG27_SR13 or XGI340_SR13 in vb_setmode.c - only the first three values are used. This becomes also evident as values 3-7 are all 0. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/vb_struct.h |2

[PATCH 3/6] staging/xgifb: Remove unused entries in XGI340New_MCLKData and XGI27New_MCLKData

2013-02-05 Thread Peter Huewe
which can only be 0, 1 or 2 - pVBInfo-MCLKData is assigned to either XGI340New_MCLKData or XGI27New_MCLKData in vb_setmode.c - only the first three values are used, the rest can be removed. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/vb_table.h | 10 -- 1

[PATCH 5/6] staging/xgifb: Remove unneeded conditional assignment

2013-02-05 Thread Peter Huewe
pVBInfo-ram_type is assigned the return value of XGINew_GetXG20DRAMType which can only be 0, 1 or 2 - The conditional assignment is not needed here as it always evaluates to true. - remove Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/vb_init.c |2 +- 1 files

[PATCH 6/6] staging/xgifb: Remove always false if statement

2013-02-05 Thread Peter Huewe
MCLKData does not contain any 0x1C value for its field SR28 nor does XGI340_ECLKData contain any 0x1C or 0x22 value for its field SR2E. - the statement always evaluates to false. - remove Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/vb_init.c | 16 1

[PATCH 4/6] staging/xgifb: Remove unused values in XGI340_ECLKData

2013-02-05 Thread Peter Huewe
or 2 - only the first three values are used. - remove the remeining entries. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/vb_table.h |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/drivers/staging/xgifb/vb_table.h b/drivers/staging/xgifb

[PATCH] staging/vt6656: Fix sparse warning constant 0xffffffff00000000U is so big it is unsigned long

2013-02-05 Thread Peter Huewe
-by: Fengguang Wu fengguang...@intel.com Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/vt6656/card.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c index 7d725bb..f988f07 100644 --- a/drivers

[PATCH] i2c/i2c-mxs: use devm_request_and_ioremap

2013-02-02 Thread Peter Huewe
/devm_request_and_ioremap.cocci. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/i2c/busses/i2c-mxs.c |7 +-- 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c index d6abaf2..4ca92b6 100644 --- a/drivers/i2c/busses/i2c-mxs.c +++ b

[PATCH 1/6] staging/xgifb: Remove unused variables and dead assignments

2013-02-02 Thread Peter Huewe
assignment a few lines later. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/XGI_main_26.c | 35 +++ 1 files changed, 3 insertions(+), 32 deletions(-) diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c index

[PATCH 3/6] staging/xgifb: Remove unused variable and dead assignment

2013-02-02 Thread Peter Huewe
assignment - remove the dead assignment. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/vb_setmode.c | 46 1 files changed, 10 insertions(+), 36 deletions(-) diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb

[PATCH 6/6] staging/xgifb: remove unused variables

2013-02-02 Thread Peter Huewe
XGI_P3cc is unused and the assignment without side effects - remove; Data can be simply replaced by the Temp variable, which was changed to temp in order to make checkpatch happy. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/vb_setmode.c | 19 --- 1

[PATCH 2/6] staging/xgifb: Remove unused variable

2013-02-02 Thread Peter Huewe
Index is not used here - remove. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/vb_setmode.c |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 53b5557..a7fb52f 100644

[PATCH 4/6] staging/xgifb: Remove unused variables

2013-02-02 Thread Peter Huewe
Pindex and Pdata are unused - remove tempbx is unused - remove Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/vb_setmode.c |7 +-- 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb

[PATCH 5/6] staging/xgifb: Remove redundant if statement

2013-02-02 Thread Peter Huewe
The code checks twice for if (pVBInfo-VBInfo SetCRT2ToTV) without any changes in between - we can remove the second check. And while at it we can also save the temp variable and use tempbx directly. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/vb_setmode.c | 34

[PATCH 02/10] staging/xgifb: Remove always false comparisons

2013-02-03 Thread Peter Huewe
This patch removes some comparisons that always evaluate to false since xoffset and yoffset are defined as __u32 in fb_var_screeninfo in include/linux/fb.h and thus can never be negative. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/XGI_main_26.c |9 + 1

[PATCH 03/10] staging/xgifb: mttr must be (signed) int

2013-02-03 Thread Peter Huewe
The mttr field must be declared as signed int (as in every other fb driver) for the mttr functions to work properly. Moreover the value should be initialized with -1. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/XGI_main_26.c |2 +- drivers/staging/xgifb/XGIfb.h

[PATCH 06/10] staging/xgifb: rewrite XGIfb_get_cmap_len

2013-02-03 Thread Peter Huewe
We don't need to use this switch-case here for a simple two case if-else. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/XGI_main_26.c | 16 ++-- 1 files changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers

[PATCH 07/10] staging/xgifb: remove unnecessary temp variable in XGIfb_mode_rate_to_ddata

2013-02-03 Thread Peter Huewe
Instead of subtracting one and then assign a different name and add 1 again we simply use HDE directly. HDE wasn't used directly before, so no change in functionality. Same applies to VDE. - now we can remove the variable with the very descriptive name E ;) Signed-off-by: Peter Huewe peterhu

[PATCH 09/10] staging/xgifb: Consolidate XGI_EnableChISLCD and XGI_DisableChISLCD

2013-02-03 Thread Peter Huewe
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 peterhu...@gmx.de --- drivers/staging/xgifb/vb_setmode.c | 48 +-- 1 files changed, 13

[PATCH 05/10] staging/xgifb: Simplify XGI_SetSeqRegs

2013-02-03 Thread Peter Huewe
the assignment to SR1 into the loop, which I prefer to start at 0. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/vb_setmode.c | 23 ++- drivers/staging/xgifb/vb_table.h |2 +- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/drivers/staging

[PATCH 10/10] staging/xgifb: Simplify XGISetModeNew

2013-02-03 Thread Peter Huewe
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 peterhu...@gmx.de --- drivers/staging/xgifb/vb_setmode.c | 18 +++--- 1 files changed, 3 insertions(+), 15

[PATCH 08/10] staging/xgifb: Remove unnecessary bitshifts in XGI_SetCRT1ModeRegs

2013-02-03 Thread Peter Huewe
Since data can only be 0x, 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 peterhu...@gmx.de --- drivers/staging/xgifb

[PATCH 04/10] staging/xgifb: Fix return of uninitialized variable

2013-02-03 Thread Peter Huewe
the variable in this case. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/XGI_main_26.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c index fa351f9..106abc8 100644

[PATCH 01/10] staging/xgifb: Simplify XGI_GetRatePtrCRT2

2013-02-03 Thread Peter Huewe
-of-bounds access I changed the mask from 0x0F to 0x07 and added a dummy value. Signed-off-by: Peter Huewe peterhu...@gmx.de --- Please apply this series after my previous one [PATCH 1/6] staging/xgifb: Remove unused variables and dead assignments [PATCH 2/6] staging/xgifb: Remove unused variable

Re: [PATCH] staging/comedi: Move comedi_pci_auto_unconfig to drivers.c

2013-01-24 Thread Peter Huewe
Am Donnerstag, 24. Januar 2013, 11:02:35 schrieb Ian Abbott: On 2013-01-22 23:03, Peter Huewe wrote: Since comedi_pci_auto_unconfig cannot be inlined anymore after staging/comedi: Use comedi_pci_auto_unconfig directly for pci_driver.remove is applied, it makes sense to move

[PATCH] staging/media/solo6x10: Use PTR_RET rather than if(IS_ERR(...)) + PTR_ERR

2013-01-25 Thread Peter Huewe
Found with coccicheck. The semantic patch that makes this change is available in scripts/coccinelle/api/ptr_ret.cocci. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/media/solo6x10/v4l2.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH] staging/csr: Use kmemdup rather than duplicating its implementation

2013-01-25 Thread Peter Huewe
Found with coccicheck. The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/csr/drv.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/csr/drv.c

[PATCH] staging/media/go7007: Use kmemdup rather than duplicating its implementation

2013-01-25 Thread Peter Huewe
Found with coccicheck. The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/media/go7007/go7007-driver.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH] staging/omapdrm: Use kmemdup rather than duplicating its implementation

2013-01-25 Thread Peter Huewe
Found with coccicheck. The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/omapdrm/omap_gem.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging

[PATCH] staging/comedi/adl_pci8164: Don't assign string

2013-01-28 Thread Peter Huewe
Assigning a string is really bad, and since we only have 1 char strings here we can simply use a char to store the value and change the format specifier. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/comedi/drivers/adl_pci8164.c | 28 +- 1 files

[PATCH] staging/comedi: Use bool initializations

2013-01-21 Thread Peter Huewe
Found with coccicheck. The semantic patch that makes this output is available in scripts/coccinelle/misc/boolinit.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/comedi/comedi_fops.c

[PATCH 1/2] staging/comedi: Add pci_driver.name to skel driver

2013-01-21 Thread Peter Huewe
This patch adds the comedi_driver.name to pci_driver.name to the skel driver, so we can remove the workaround in drivers.c Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/comedi/drivers/skel.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers

[PATCH 2/2] staging/comedi: remove workaround for !pci_driver.name

2013-01-21 Thread Peter Huewe
All pci drivers in drivers/ have the pci_driver.name field set, so we can remove this workaround and the accompanying todo. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/comedi/drivers.c |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH] staging/iio: Use correct argument for sizeof

2013-01-21 Thread Peter Huewe
-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/iio/iio_hwmon.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/iio/iio_hwmon.c b/drivers/staging/iio/iio_hwmon.c index c7a5f97..97ad645 100644 --- a/drivers/staging/iio/iio_hwmon.c +++ b/drivers/staging

[PATCH v2] staging/comedi: Add pci_driver.name to skel driver

2013-01-21 Thread Peter Huewe
This patch adds the comedi_driver.name to pci_driver.name to the skel driver, so we can remove the workaround in drivers.c Signed-off-by: Peter Huewe peterhu...@gmx.de --- missed a comma, sorry drivers/staging/comedi/drivers/skel.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff

[PATCH] staging/comedi: use comedi_usb_driver_(un)register for init/deinit

2013-01-22 Thread Peter Huewe
Instead of coding calling comedi_driver_(un)register and usb_(de)register directly we can use the comedi_usb_driver_(un)register wrapper. This removes some boilerplate and is less error prone. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/comedi/drivers/dt9812.c | 25

[PATCH] staging/comedi: Use comedi_pci_auto_unconfig directly for pci_driver.remove

2013-01-22 Thread Peter Huewe
code and saves some bytes. Signed-off-by: Peter Huewe peterhu...@gmx.de --- Maybe we should move the implementation now to drivers.c, because now it cannot be inlined anymore. This would save some more bytes in the .kos but comedi_pci_auto_unconfig then has to become an exported symbol. drivers

[PATCH] staging/comedi: Move comedi_pci_auto_unconfig to drivers.c

2013-01-22 Thread Peter Huewe
Since comedi_pci_auto_unconfig cannot be inlined anymore after staging/comedi: Use comedi_pci_auto_unconfig directly for pci_driver.remove is applied, it makes sense to move it drivers.c Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/comedi/comedidev.h |5 + drivers

[PATCH] staging/wlan-ng: Fix 'Branch condition evaluates to a garbage value' in p80211netdev.c

2013-02-13 Thread Peter Huewe
!= WLAN_DEVICE_OPEN) evaluates to true. the execution flow then continues at the 'failed' label where p80211_wep.data is used without being initialized first. - Initialize the data field to NULL to fix this issue. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/wlan-ng/p80211netdev.c |2

[PATCH] staging/rtl8192u/ieee80211: Fix buffer overflow in ieee80211_softmac_wx.c

2013-02-13 Thread Peter Huewe
. This is done in a similar fashion in staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c While at it cleaned some whitespace issues. Signed-off-by: Peter Huewe peterhu...@gmx.de --- .../rtl8192u/ieee80211/ieee80211_softmac_wx.c | 29 ++- 1 files changed, 15 insertions(+), 14 deletions

[PATCH] staging/comedi: Use instead of for logical comparision

2013-02-14 Thread Peter Huewe
sparse complains that: drivers/staging/comedi/drivers/adl_pci9118.c:813 pci9118_calc_divisors() warn: maybe use instead of usessh is used as a boolean flag (0 and 1) and is compared to a boolean value so we should use here. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging

[PATCH] staging/comedi: Fix if(); by adding proper code

2013-02-14 Thread Peter Huewe
Smatch warns about: staging/comedi/drivers/cb_pcidas64.c:3304 prep_ao_dma() warn: if(); So the check currently does nothing and could be removed, but the better alternative is to activate the check again and return -1; if it evaluates to true. Signed-off-by: Peter Huewe peterhu...@gmx.de

[PATCH] staging/panel: Mark local functions as static (fix smatch warnings)

2013-02-14 Thread Peter Huewe
:1382:6: warning: symbol 'lcd_init' was not declared. Should it be static? panel.c:2181:5: warning: symbol 'panel_init' was not declared. Should it be static? Add the static keyword to silence these warnings and make smatch happy. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging

[PATCH 1/7] staging/ozwpan: Fix sparse warning Using plain integer as NULL pointer

2013-02-14 Thread Peter Huewe
This patch fixes the warning Using plain integer as NULL pointer, generated by sparse, by replacing the offending 0s with NULL. Signed-off-by: Peter Huewe peterhu...@gmx.de --- I split up this patch series on a per file basis so that review is easier. drivers/staging/ozwpan/ozpd.c | 68

[PATCH 2/7] staging/ozwpan: Fix sparse warning Using plain integer as NULL pointer

2013-02-14 Thread Peter Huewe
This patch fixes the warning Using plain integer as NULL pointer, generated by sparse, by replacing the offending 0s with NULL. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/ozwpan/ozusbsvc1.c | 20 ++-- 1 files changed, 10 insertions(+), 10 deletions

[PATCH 6/7] staging/ozwpan: Fix sparse warning Using plain integer as NULL pointer

2013-02-14 Thread Peter Huewe
This patch fixes the warning Using plain integer as NULL pointer, generated by sparse, by replacing the offending 0s with NULL. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/ozwpan/ozusbsvc.c | 22 +++--- 1 files changed, 11 insertions(+), 11 deletions

[PATCH 7/7] staging/ozwpan: Fix sparse warning Using plain integer as NULL pointer

2013-02-14 Thread Peter Huewe
This patch fixes the warning Using plain integer as NULL pointer, generated by sparse, by replacing the offending 0s with NULL. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/ozwpan/ozhcd.c | 135 1 files changed, 68 insertions(+), 67

[PATCH 4/7] staging/ozwpan: Fix sparse warning Using plain integer as NULL pointer

2013-02-14 Thread Peter Huewe
This patch fixes the warning Using plain integer as NULL pointer, generated by sparse, by replacing the offending 0s with NULL. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/ozwpan/ozproto.c | 78 +++--- 1 files changed, 39 insertions(+), 39

[PATCH 3/7] staging/ozwpan: Fix sparse warning Using plain integer as NULL pointer

2013-02-14 Thread Peter Huewe
This patch fixes the warning Using plain integer as NULL pointer, generated by sparse, by replacing the offending 0s with NULL. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/ozwpan/ozeltbuf.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git

[PATCH 5/7] staging/ozwpan: Fix sparse warning Using plain integer as NULL pointer

2013-02-14 Thread Peter Huewe
This patch fixes the warning Using plain integer as NULL pointer, generated by sparse, by replacing the offending 0s with NULL. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/ozwpan/ozcdev.c | 24 1 files changed, 12 insertions(+), 12 deletions

[PATCH v2] staging/comedi: Remove if(); statement without effect

2013-02-15 Thread Peter Huewe
Smatch warns about: staging/comedi/drivers/cb_pcidas64.c:3304 prep_ao_dma() warn: if(); So the check currently does nothing and can be removed, as indicated by Ian. Signed-off-by: Peter Huewe peterhu...@gmx.de --- v1 was staging/comedi: Fix if(); by adding proper code which was unfortunately

[PATCH v2] staging/panel: Mark local functions/structs static and add const if applicable (fix sparse warnings)

2013-02-15 Thread Peter Huewe
marked as const. CC: David Howells dhowe...@redhat.com Signed-off-by: Peter Huewe peterhu...@gmx.de --- v2: Included feedback about const by David Howells. Thanks David. drivers/staging/panel/panel.c | 31 --- 1 files changed, 16 insertions(+), 15 deletions(-) diff

[PATCH 1/7 v2] staging/ozwpan: Fix NULL vs zero in ozpd.c (sparse warning)

2013-02-15 Thread Peter Huewe
This patch fixes the warning Using plain integer as NULL pointer, generated by sparse, by replacing the offending 0s with NULL. If the initialization with NULL was unnecessary (due to unconditional assignment before first use) it was removed. Signed-off-by: Peter Huewe peterhu...@gmx.de

[PATCH 2/7 v2] staging/ozwpan: Fix NULL vs zero in ozusbsvc1.c (sparse warning)

2013-02-15 Thread Peter Huewe
This patch fixes the warning Using plain integer as NULL pointer, generated by sparse, by replacing the offending 0s with NULL. If the initialization with NULL was unnecessary (due to unconditional assignment before first use) it was removed. Signed-off-by: Peter Huewe peterhu...@gmx.de

[PATCH 5/7 v2] staging/ozwpan: Fix NULL vs zero in ozcdev.c (sparse warning)

2013-02-15 Thread Peter Huewe
This patch fixes the warning Using plain integer as NULL pointer, generated by sparse, by replacing the offending 0s with NULL. If the initialization with NULL was unnecessary (due to unconditional assignment before first use) it was removed. Signed-off-by: Peter Huewe peterhu...@gmx.de

[PATCH 4/7 v2] staging/ozwpan: Fix NULL vs zero in ozproto.c (sparse warning)

2013-02-15 Thread Peter Huewe
This patch fixes the warning Using plain integer as NULL pointer, generated by sparse, by replacing the offending 0s with NULL. If the initialization with NULL was unnecessary (due to unconditional assignment before first use) it was removed. Signed-off-by: Peter Huewe peterhu...@gmx.de

[PATCH 7/7] staging/ozwpan: Fix NULL vs zero in ozhcd.c (sparse warning)

2013-02-15 Thread Peter Huewe
This patch fixes the warning Using plain integer as NULL pointer, generated by sparse, by replacing the offending 0s with NULL. If the initialization with NULL was unnecessary (due to unconditional assignment before first use) it was removed. Signed-off-by: Peter Huewe peterhu...@gmx.de

[PATCH 6/7] staging/ozwpan: Fix NULL vs zero in ozusbsvc.c (sparse warning)

2013-02-15 Thread Peter Huewe
This patch fixes the warning Using plain integer as NULL pointer, generated by sparse, by replacing the offending 0s with NULL. If the initialization with NULL was unnecessary (due to unconditional assignment before first use) it was removed. Signed-off-by: Peter Huewe peterhu...@gmx.de

[PATCH 3/7 v2] staging/ozwpan: Fix NULL vs zero in ozeltbuf.c (sparse warning)

2013-02-15 Thread Peter Huewe
This patch fixes the warning Using plain integer as NULL pointer, generated by sparse, by replacing the offending 0s with NULL. If the initialization with NULL was unnecessary (due to unconditional assignment before first use) it was removed. Signed-off-by: Peter Huewe peterhu...@gmx.de

[PATCH 3/5] staging/xgifb: Remove code without effect

2013-02-15 Thread Peter Huewe
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 peterhu...@gmx.de --- drivers/staging/xgifb/vb_setmode.c |9 + 1 files changed, 1 insertions(+), 8 deletions

[PATCH 4/5] staging/xgifb: Consolidate return paths

2013-02-15 Thread Peter Huewe
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 peterhu...@gmx.de --- drivers/staging/xgifb/vb_setmode.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git

[PATCH 1/5] staging/xgifb: Consolidate if/else if with identical code branches

2013-02-15 Thread Peter Huewe
Both branches of this if statement execute the same code. Thus we can || them together and remove code duplication Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/xgifb/vb_setmode.c |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging

[PATCH 5/5] staging/xgifb: Remove duplicated code in loops.

2013-02-15 Thread Peter Huewe
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 peterhu...@gmx.de --- drivers/staging/xgifb/vb_setmode.c | 11 +++ 1 files

[PATCH 2/5] staging/xgifb: Remove unnecessary casts

2013-02-15 Thread Peter Huewe
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 peterhu...@gmx.de --- drivers/staging/xgifb/vb_init.c|2 +- drivers/staging/xgifb/vb_setmode.c | 66

[PATCH] staging/usbip: Mark local functions as static (fix sparse warnings)

2013-02-15 Thread Peter Huewe
happy. Signed-off-by: Peter Huewe peterhu...@gmx.de --- drivers/staging/usbip/stub_dev.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c index ca5de9d..67556ac 100644 --- a/drivers/staging/usbip

  1   2   3   4   5   6   7   8   >