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

2012-11-28 Thread Peter Huewe
antic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Peter Huewe --- 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/tpm_tis.c index 6bdf267..70d4ea5 100644 --- a/drivers/cha

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

2012-11-28 Thread Peter Huewe
antic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Peter Huewe --- v2: Removed/changed that silly itpm = (probe == 0) ? 0 : 1; since probe is here either 0 or 1 -- thanks Al for noticing. This section and the probing of the itpm can probably be improved anyway, but I'll wrap

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

2012-11-28 Thread Peter Huewe
Am Donnerstag, 29. November 2012, 01:25:19 schrieb Al Viro: > On Thu, Nov 29, 2012 at 01:20:37AM +0100, Peter Huewe wrote: > > - itpm = (probe == 0) ? 0 : 1; > > + itpm = (probe == 0) ? false : true; > > Charming. Not that original had been better, bu

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

2012-11-29 Thread Peter Huewe
antic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Peter Huewe --- 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/tpm_tis.c index 6b

[PATCH] i2c/i2c-mxs: use devm_request_and_ioremap

2013-02-02 Thread Peter Huewe
e/api/devm_request_and_ioremap.cocci. Signed-off-by: Peter Huewe --- 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/drivers/i2c/b

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

2013-02-02 Thread Peter Huewe
ferent assignment a few lines later. Signed-off-by: Peter Huewe --- 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 68a216f..c

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

2013-02-02 Thread Peter Huewe
sed before the next assignment -> remove the dead assignment. Signed-off-by: Peter Huewe --- 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/

[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 --- drivers/staging/xgifb/vb_setmode.c | 19 --- 1 files changed

[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 --- 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 --- a/driv

[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 --- 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/vb_setmode.c

[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 --- drivers/staging/xgifb/vb_setmod

[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 --- drivers/staging/xgifb/XGI_main_26.c |9 + 1 files changed, 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 --- drivers/staging/xgifb/XGI_main_26.c |2 +- drivers/staging/xgifb/XGIfb.h |2 +- 2

[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 --- 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/staging/

[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: Pet

[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 --- drivers/staging/xgifb/vb_setmode.c | 48 +-- 1 files changed, 13 insertions(+), 35

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

2013-02-03 Thread Peter Huewe
e the assignment to SR1 into the loop, which I prefer to start at 0. Signed-off-by: Peter Huewe --- 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 --- drivers/staging/xgifb/vb_setmode.c | 18 +++--- 1 files changed, 3 insertions(+), 15 deletions(-) diff --git

[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 --- drivers/staging/xgifb/vb_s

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

2013-02-03 Thread Peter Huewe
return ret; This patch initializes the variable in this case. Signed-off-by: Peter Huewe --- 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 10

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

2013-02-03 Thread Peter Huewe
-bounds access I changed the mask from 0x0F to 0x07 and added a dummy value. Signed-off-by: Peter Huewe --- 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 [PATCH 3/6] staging

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

2013-02-04 Thread Peter Huewe
ine we can simply replace the whole lookup table with a simple if/else assignment. Tested-by: Aaro Koskinen Signed-off-by: Peter Huewe --- drivers/staging/xgifb/vb_init.c |2 +- drivers/staging/xgifb/vb_table.h | 11 --- 2 files changed, 1 insertions(+), 12 deletions(-) diff --gi

[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 Signed-off-by: Peter Huewe --- drivers/staging/xgifb/vb_ini

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

2013-02-04 Thread Peter Huewe
ned-off-by: Peter Huewe --- drivers/staging/xgifb/vb_setmode.c | 13 ++--- 1 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 131a267..bd81656 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drive

[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 --- drivers/staging/xgifb/vb_setmode.c | 31

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

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

[PATCH] staging/xgifb: Remove unused variable

2013-02-05 Thread Peter Huewe
sed variable ā€˜iā€™ [-Wunused-variable] This patch fixes this Signed-off-by: Peter Huewe --- 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
assigned the return value 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 --- drivers/staging/x

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

2013-02-05 Thread Peter Huewe
assigned the return value 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 --- drivers/staging/x

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

2013-02-05 Thread Peter Huewe
the return value of XGINew_GetXG20DRAMType 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 --- drivers/staging/xgifb/vb_table.h | 10 --

[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 --- drivers/staging/xgifb/vb_init.c |2 +- 1 files c

[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 --- drivers/staging/xgifb/vb_init.c | 16 1 files c

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

2013-02-05 Thread Peter Huewe
can only be 0, 1 or 2 -> only the first three values are used. -> remove the remeining entries. Signed-off-by: Peter Huewe --- 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/

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

2013-02-05 Thread Peter Huewe
the warning. Reported-by: Fengguang Wu Signed-off-by: Peter Huewe --- 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/staging/vt66

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

2013-02-07 Thread Peter Huewe
nand_erase': 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 Signed-off-by: Peter Huewe

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

2013-02-07 Thread Peter Huewe
d.c:215:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'size_t' [-Wformat] In function 'goldfish_nand_write': goldfish_nand.c:239:2: warning: format '%x' expects argument of type 'unsigned int',

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

2013-02-08 Thread Peter Huewe
device tree. tpm_i2c_infineon is also retained as a compatible id as a fallback to slb9635 protocol. The driver was tested on Beaglebone. Signed-off-by: Peter Huewe --- Patch against Kent's tpmdd-02-05-13 branch You might get an out-of-office reply, but I'm monitoring this email addres

[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 --- drivers/staging/rtl8187se/r8185b_init.c | 49 +-- 1 files changed, 1 insertions(+), 48

[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 --- drivers/staging/rtl818

[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 --- 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 --- drivers/staging/rtl8187se/r8185b_init.c | 20 1 files changed, 0 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8187se

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

2013-02-12 Thread Peter Huewe
Should it be static? 1011:6: warning: symbol 'SetRFPowerState' was not declared. Should it be static? 1115:6: warning: symbol 'InactivePowerSave' was not declared. Should it be static? -> Add the static keyword. Signed-off-by: Peter Huewe --- drivers/staging/rtl81

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

2013-02-12 Thread Peter Huewe
ls 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 --- drivers/staging/rtl8187se/r8185b_init.c | 17 + 1 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8

[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 --- 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 --- drivers/staging/rtl8187se/r8185b_init.c | 35

[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 --- drivers/staging/rtl8187se/r8185b_init.c |5 - 1 files changed, 0 insertions(+), 5 deletions

[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 --- drivers/staging/rtl8187se/r8185b_init.c | 49 +-- 1 files changed, 1 insertions(+), 48

[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 --- drivers/staging/rtl8187se/r8185b_init.c | 35

[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 --- drivers/staging/rtl8187se/r8185b_init.c |5 - 1 files changed, 0 insertions(+), 5 deletions

[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 --- drivers/staging/rtl8187se/r8185b_init.c |

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

2013-02-12 Thread Peter Huewe
ls 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 --- drivers/staging/rtl8187se/r8185b_init.c | 17 + 1 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8

[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 --- drivers/staging/rtl8187se/r8185b_init.c | 20 1 files changed, 0 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8187se

[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 --- drivers/staging/rtl818

[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 --- 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
Should it be static? 1011:6: warning: symbol 'SetRFPowerState' was not declared. Should it be static? 1115:6: warning: symbol 'InactivePowerSave' was not declared. Should it be static? -> Add the static keyword. Signed-off-by: Peter Huewe --- drivers/staging/rtl81

[PATCH] staging/comedi: Fix undefined array subscript

2013-02-12 Thread Peter Huewe
etween 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 --- drivers/staging/comedi/drivers/vmk80xx.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/staging/comedi/drivers/vmk80xx.c

[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 --- drivers/staging/comedi/drivers/adl_pci8164.c | 28 +- 1 files changed, 14 insertions

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 > >

[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 --- drivers/staging/media/solo6x10/v4l2.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media

[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 --- drivers/staging/csr/drv.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/csr/drv.c b/drivers

[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 --- drivers/staging/media/go7007/go7007-driver.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media

[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 --- drivers/staging/omapdrm/omap_gem.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/omapdrm/omap_gem.c

[PATCH] staging/sm7xxfb: Convert to SIMPLE_DEV_PM_OPS

2013-02-18 Thread Peter Huewe
Instead of assigning the pm_ops fields individually we can simply use SIMPLE_DEV_PM_OPS. Signed-off-by: Peter Huewe --- drivers/staging/sm7xxfb/sm7xxfb.c | 10 +- 1 files changed, 1 insertions(+), 9 deletions(-) diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging

[PATCH 1/5] staging/slicoss: Check pointer before dereferencing

2013-02-18 Thread Peter Huewe
Smatch complains that the variable adapter is dereferenced before it is checked: slicoss.c:906 slic_timer_load_check() warn: variable dereferenced before check 'adapter' (see line 904) -> move the assignment after the check. Signed-off-by: Peter Huewe --- drivers/staging/slic

[PATCH 2/5] staging/slicoss: Remove always true if statement

2013-02-18 Thread Peter Huewe
skbtype is assigned once to NORMAL_ETHFRAME and then checked if it is NORMAL_ETHFRAME -> remove the checks. This also gets rid of the (false positive) smatch warning: slicoss.c:2829 slic_xmit_start() error: potential NULL dereference 'hcmd'. Signed-off-by: Peter Huewe --- dr

[PATCH 5/5] staging/slicoss: Use ether_crc for mac hash calculation

2013-02-18 Thread Peter Huewe
different mac addresses, changing the vendor bits of the mac address first. Signed-off-by: Peter Huewe --- drivers/staging/slicoss/slicoss.c | 69 ++-- 1 files changed, 4 insertions(+), 65 deletions(-) diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging

[PATCH 3/5] staging/slicoss: Fix operation may be undefined warning

2013-02-18 Thread Peter Huewe
gcc complains about an undefined operation: slicoss.c:1417:19: warning: operation on 'rspq->pageindex' may be undefined [-Wsequence-point] The intended operation was (probably) to retrieve the pageindex + 1 and let it wrap around if it reaches the num_pages. Signed-off-by

[PATCH 4/5] staging/slicoss: Fix buffer possible overflow in slic_card_locate

2013-02-18 Thread Peter Huewe
pter. -> Add check for this condition and simplify the if statement by inverting the condition. Signed-off-by: Peter Huewe --- drivers/staging/slicoss/slicoss.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/sta

[PATCH 1/2] staging/sep: Fix smatch false positive about potential NULL dereference in sep_main.c

2013-02-19 Thread Peter Huewe
s warning and make it more robust in regard to code changes. Signed-off-by: Peter Huewe --- drivers/staging/sep/sep_main.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/sep/sep_main.c b/drivers/staging/sep/sep_main.c index 30e8d25..366d56b 100644

[PATCH 2/2] staging/sep: Check pointers before dereferencing (fix smatch warning)

2013-02-19 Thread Peter Huewe
#x27; (see line 2885) -> Move the checks to the top, but keep the semantics. Signed-off-by: Peter Huewe --- drivers/staging/sep/sep_main.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/sep/sep_main.c b/drivers/staging/sep/sep_main.c index 366d56b..f5b73

[PATCH 1/3] staging/gdm72xx: Include corresponding header file (fix sparse warning)

2013-02-19 Thread Peter Huewe
ng: symbol 'netlink_init' was not declared. Should it be static? netlink_k.c:109:6: warning: symbol 'netlink_exit' was not declared. Should it be static? netlink_k.c:114:5: warning: symbol 'netlink_send' was not declared. Should it be static? -> Add the include files an

[PATCH 2/3] staging/gdm72xx: Remove unused variable in gdm_qos.c

2013-02-19 Thread Peter Huewe
len is never read after assignment, thus can be removed. Signed-off-by: Peter Huewe --- drivers/staging/gdm72xx/gdm_qos.c |9 ++--- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/gdm72xx/gdm_qos.c b/drivers/staging/gdm72xx/gdm_qos.c index 1e63031

[PATCH 3/3] staging/gdm72xx: Remove duplicated code in gdm_qos.c

2013-02-19 Thread Peter Huewe
The first branch of the if statement is ended with a return thus there is no need for an else if, and thus we can move the duplicated code to the top and use it for the other two branches. Signed-off-by: Peter Huewe --- drivers/staging/gdm72xx/gdm_qos.c | 42

[PATCH 1/2] extcon: Unregister compat class at module unload to fix oops

2012-09-21 Thread Peter Huewe
l_chain+0x0/0x20 9f451e58: [<6007e3c3>] sys_init_module+0xa3/0x280 9f451e88: [<6001e2ad>] handle_syscall+0x8d/0x90 9f451ea8: [<60033370>] userspace+0x405/0x531 9f451ee8: [<6001e380>] copy_chunk_to_user+0x0/0x40 9f451ef8: [<6001e5cd>] do_op_one_page+0x14d/0x220 9f4

[PATCH 2/2] extcon: unregister compat link on cleanup

2012-09-21 Thread Peter Huewe
Since extcon registers this compat link at device registration (extcon_dev_register), we should probably remove them at deregistration/cleanup. Cc: sta...@vger.kernel.org Signed-off-by: Peter Huewe --- drivers/extcon/extcon_class.c |5 + 1 files changed, 5 insertions(+), 0 deletions

[PATCH] net/phy/bcm87xx: Add MODULE_LICENSE("GPL") to GPL driver

2012-09-21 Thread Peter Huewe
terms and conditions of the GNU General * Public License. See the file "COPYING" in the main directory of this * archive for more details. I think it's safe to add the MODULE_LICENSE("GPL") macro and thus remove the kernel taint. Cc: sta...@vger.kernel.org Signed-off-by

[PATCH] char/tpm: Use struct dev_pm_ops for power management

2012-12-05 Thread Peter Huewe
This patch converts the suspend and resume functions for tpm_i2c_stm_st33 to the new dev_pm_ops. Signed-off-by: Peter Huewe --- Note: I'm sending this patch on behalf of myself only and nobody else, especially not my employer - and I'm doing this in my spare time. I have to inform yo

[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 --- This patch reflects only my opinion and work, and

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

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

[PATCH net-next/master] ethernet/broadcom/tg3: Fix sparse warning: constant 0x7fffffffffffffff is so big it is long long

2013-01-03 Thread Peter Huewe
Sparse complains that: drivers/net/ethernet/broadcom/tg3.c:5670:55: sparse: constant 0x7fff is so big it is long long (on x86/32 bit) so we suffix the constant with LL in the header file. Reported-by: Fengguang Wu Signed-off-by: Peter Huewe --- drivers/net/ethernet/broadcom/tg3.h

[PATCH] fs/autofs: Fix sparse warning: context imbalance in 'autofs4_d_automount' - different lock contexts for basic block

2013-01-03 Thread Peter Huewe
t with the (&sbi->fs_lock) held if sbi->version <= 4 and simple_empty(dentry) == false so the warning seems valid. --> Add an spin_unlock in this case before we jump to done Unfortunately compile tested only. Reported-by: Fengguang Wu Signed-off-by: Peter Huewe --- fs/autofs4/r

[PATCH v2] char/tpm: simplify duration calculation and eliminate smatch warning.

2012-11-15 Thread Peter Huewe
r/tpm/tpm.c:360 tpm_calc_ordinal_duration() error: buffer overflow 'tpm_protected_ordinal_duration' 12 <= 243 Signed-off-by: Peter Huewe --- v2: Smatch not sparse and TSC instead of TCS ;) drivers/char/tpm/tpm.c | 13 ++--- 1 files changed, 6 insertions(+), 7 deletion

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

2013-03-04 Thread Peter Huewe
device tree. tpm_i2c_infineon is also retained as a compatible id as a fallback to slb9635 protocol. The driver was tested on Beaglebone. Signed-off-by: Peter Huewe --- Please apply on top of "char/tpm: Convert struct i2c_msg initialization to C99 format" by Shubhrajyoti Datta

[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 --- 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/drivers/cha

[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 Signed-off-by: Peter Huewe --- drivers/char/tpm/tpm_i2c_infineon.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/char/tpm

[PATCH] staging/comedi: Add VIRT_TO_BUS dependency to 'fix' build failure

2013-05-12 Thread Peter Huewe
If the platform does not provide virt_to_bus the ni_labpc.c driver fails to compile. In order not to break these builds we have to add a depends on CONFIG_VIRT_TO_BUS to the affected drivers. Reported-by: Geert Uytterhoeven Signed-off-by: Peter Huewe --- drivers/staging/comedi/Kconfig | 3

[PATCH 1/5] staging/xgifb: Remove uneccessary/simply if in XGINew_GetXG20DRAMType

2013-05-13 Thread Peter Huewe
Instead of storing the value in a temp variable, anding it with 1 and assign data conditionally we can assign the value directly. Signed-off-by: Peter Huewe --- drivers/staging/xgifb/vb_init.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/staging/xgifb

[PATCH 5/5] staging/xgifb: Fix always false condition in vb_setmode.c (smatch)

2013-05-13 Thread Peter Huewe
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 --- drivers/staging/xg

[PATCH 4/5] staging/xgifb: Remove unnecessary binary calculation in GetXG27FPBits

2013-05-13 Thread Peter Huewe
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 --- drivers/staging/xgifb/vb_init.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging

[PATCH 2/5] staging/xgifb: Remove unnecessary cases in XGINew_SenseLCD

2013-05-13 Thread Peter Huewe
ame value as the switch for comparison, and includes the code into the switch. Signed-off-by: Peter Huewe --- drivers/staging/xgifb/vb_init.c | 51 - 1 file changed, 15 insertions(+), 36 deletions(-) diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/stag

[PATCH 3/5] staging/xgifb: Consolidate function almost identical calls in XGINew_GetXG21Sense

2013-05-13 Thread Peter Huewe
ion we don't need the Temp variable, so we can use the value directly). Signed-off-by: Peter Huewe --- drivers/staging/xgifb/vb_init.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c index

[PATCH 1/2] staging/btmtk_usb: use module_usb_driver to register driver

2013-05-17 Thread Peter Huewe
Removing some boilerplate by using module_usb_driver instead of calling register and unregister in the otherwise empty init/exit functions Signed-off-by: Peter Huewe --- drivers/staging/btmtk_usb/btmtk_usb.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a

[PATCH 2/2] staging/btmtk_usb: Mark local functions as static

2013-05-17 Thread Peter Huewe
static? -> add the static keyword Signed-off-by: Peter Huewe --- drivers/staging/btmtk_usb/btmtk_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/btmtk_usb/btmtk_usb.c b/drivers/staging/btmtk_usb/btmtk_usb.c index 772c49e..a7539df 100644 --- a/dr

[PATCH] staging/xgifb: Remove dead assignments/increments

2013-05-17 Thread Peter Huewe
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 --- The patch did not remove occurences where a register from the device is read. If the device d

[PATCH] mfd/adp5520: Use module_i2c_driver to register driver

2013-05-20 Thread Peter Huewe
Removing some boilerplate by using module_i2c_driver instead of calling register and unregister in the otherwise empty init/exit functions Signed-off-by: Peter Huewe --- drivers/mfd/adp5520.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/mfd/adp5520.c

[PATCH] usb/misc/usb3503: Use module_i2c_driver to register driver

2013-05-20 Thread Peter Huewe
Removing some boilerplate by using module_i2c_driver instead of calling register and unregister in the otherwise empty init/exit functions Signed-off-by: Peter Huewe --- drivers/usb/misc/usb3503.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/usb

[PATCH] video/matrox/matroxfb_maven: Use module_i2c_driver to register driver

2013-05-20 Thread Peter Huewe
Removing some boilerplate by using module_i2c_driver instead of calling register and unregister in the otherwise empty init/exit functions Signed-off-by: Peter Huewe --- drivers/video/matrox/matroxfb_maven.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a

[PATCH] powerpc/platforms/83xx/mcu_mpc8349emitx: Use module_i2c_driver to register driver

2013-05-20 Thread Peter Huewe
Removing some boilerplate by using module_i2c_driver instead of calling register and unregister in the otherwise empty init/exit functions Signed-off-by: Peter Huewe --- arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff

[PATCH] net/can/mcp251x: Use module_spi_driver to register driver

2013-05-20 Thread Peter Huewe
Removing some boilerplate by using module_spi_driver instead of calling register and unregister in the otherwise empty init/exit functions Signed-off-by: Peter Huewe --- drivers/net/can/mcp251x.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/net/can

[PATCH] net/wireless/ti/wlcore/spi: Use module_spi_driver to register driver

2013-05-20 Thread Peter Huewe
Removing some boilerplate by using module_spi_driver instead of calling register and unregister in the otherwise empty init/exit functions Signed-off-by: Peter Huewe --- drivers/net/wireless/ti/wlcore/spi.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a

  1   2   3   4   >