platform/kernel/linux-starfive.git
9 years agostaging: rtl8723au: Eliminate ODM_GetBBReg()
Jes Sorensen [Thu, 5 Mar 2015 19:24:48 +0000 (14:24 -0500)]
staging: rtl8723au: Eliminate ODM_GetBBReg()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Get rid of ODM_Read4Byte()
Jes Sorensen [Thu, 5 Mar 2015 19:24:47 +0000 (14:24 -0500)]
staging: rtl8723au: Get rid of ODM_Read4Byte()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Remove various ODM_* register access wrappers
Jes Sorensen [Thu, 5 Mar 2015 19:24:46 +0000 (14:24 -0500)]
staging: rtl8723au: Remove various ODM_* register access wrappers

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Eliminate ODM_Write1Byte()
Jes Sorensen [Thu, 5 Mar 2015 19:24:45 +0000 (14:24 -0500)]
staging: rtl8723au: Eliminate ODM_Write1Byte()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: odm_ConfigBB_PHY_8723A() always issues 32 bit writes
Jes Sorensen [Thu, 5 Mar 2015 19:24:44 +0000 (14:24 -0500)]
staging: rtl8723au: odm_ConfigBB_PHY_8723A() always issues 32 bit writes

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: odm_ConfigBB_AGC_8723A() always does 32 bit writes
Jes Sorensen [Thu, 5 Mar 2015 19:24:43 +0000 (14:24 -0500)]
staging: rtl8723au: odm_ConfigBB_AGC_8723A() always does 32 bit writes

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: odm.c: Use rtl8723au_{read, write}32() for 32 bit register access
Jes Sorensen [Thu, 5 Mar 2015 19:24:42 +0000 (14:24 -0500)]
staging: rtl8723au: odm.c: Use rtl8723au_{read, write}32() for 32 bit register access

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: usb_halinit.c: Use rtl8723au_{read,write}32()
Jes Sorensen [Thu, 5 Mar 2015 19:24:41 +0000 (14:24 -0500)]
staging: rtl8723au: usb_halinit.c: Use rtl8723au_{read,write}32()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: rtl8723a_phycfg.c: Use proper register read/write functions
Jes Sorensen [Thu, 5 Mar 2015 19:24:40 +0000 (14:24 -0500)]
staging: rtl8723au: rtl8723a_phycfg.c: Use proper register read/write functions

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: writeOFDMPowerReg() use rtl8723au_write32()
Jes Sorensen [Thu, 5 Mar 2015 19:24:39 +0000 (14:24 -0500)]
staging: rtl8723au: writeOFDMPowerReg() use rtl8723au_write32()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Clean up PHY_{Query,Set}BBReg() 32 bit read/writes
Jes Sorensen [Thu, 5 Mar 2015 19:24:38 +0000 (14:24 -0500)]
staging: rtl8723au: Clean up PHY_{Query,Set}BBReg() 32 bit read/writes

This switches pure 32 bit read/writes to use the
rtl8723au_{read,write}32() functions directly.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Reduce the usage of ODM_[GS]et_BBReg()
Jes Sorensen [Thu, 5 Mar 2015 19:24:37 +0000 (14:24 -0500)]
staging: rtl8723au: Reduce the usage of ODM_[GS]et_BBReg()

The vendor code has at least three different APIs for accessing
registers. One more ugly than the other. This is the start to move
away from ODM_[GS]et_BBReg()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Remove pointless wrappers around odm_TXPowerTrackingInit()
Jes Sorensen [Thu, 5 Mar 2015 19:24:36 +0000 (14:24 -0500)]
staging: rtl8723au: Remove pointless wrappers around odm_TXPowerTrackingInit()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Remove a number of unused entries from struct dm_odm_t
Jes Sorensen [Thu, 5 Mar 2015 19:24:35 +0000 (14:24 -0500)]
staging: rtl8723au: Remove a number of unused entries from struct dm_odm_t

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Remove unused struct rx_hp
Jes Sorensen [Thu, 5 Mar 2015 19:24:34 +0000 (14:24 -0500)]
staging: rtl8723au: Remove unused struct rx_hp

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: iio: hmc5843: Set iio name property in sysfs
Marek Belisko [Sat, 28 Feb 2015 20:54:42 +0000 (21:54 +0100)]
staging: iio: hmc5843: Set iio name property in sysfs

Without this change file name for hmc5843 is empty in
/sys/bus/iio/devices/iio\:device*/name

With this change name is reported correctly:
cat /sys/bus/iio/devices/iio\:device*/name
hmc5843

Signed-off-by: Marek Belisko <marek@goldelico.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: dgap: Avoid name collision
Fabio Estevam [Tue, 3 Mar 2015 12:55:43 +0000 (09:55 -0300)]
staging: dgap: Avoid name collision

Building for ARM64 leads to the following build warning:

In file included from drivers/staging/dgap/dgap.c:66:0:
drivers/staging/dgap/dgap.h:124:0: warning: "PCI_IO_SIZE" redefined
 #define PCI_IO_SIZE  0x00200000
 ^
In file included from ./arch/arm64/include/asm/page.h:66:0,
                 from include/linux/mm_types.h:15,
                 from include/linux/sched.h:27,
                 from ./arch/arm64/include/asm/compat.h:25,
                 from ./arch/arm64/include/asm/stat.h:23,
                 from include/linux/stat.h:5,
                 from include/linux/module.h:10,
                 from drivers/staging/dgap/dgap.c:47:
./arch/arm64/include/asm/memory.h:39:0: note: this is the location of the previous definition
 #define PCI_IO_SIZE  SZ_16M
 ^

Use PCI_IO_SIZE_DGAP to avoid the name collision.

Reported-by: Olof's autobuilder <build@lixom.net>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agovme: tsi148: Master windows support USERx and CR/CSR accesses, not slaves
Martyn Welch [Thu, 26 Feb 2015 15:53:11 +0000 (18:53 +0300)]
vme: tsi148: Master windows support USERx and CR/CSR accesses, not slaves

The tsi148 driver is registering the slave images as supporting the "USER"
access modes and CR/CSR access mode rather than the master images as it
should.

Remove the incorrect case entries for these modes from the
tsi148_slave_set() function, stop registering slave_images as supporting
these modes and instead register master windows as supporting these modes.

Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Acked-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vme: mmap() support for vme_user
Dmitry Kalinkin [Thu, 26 Feb 2015 15:53:10 +0000 (18:53 +0300)]
staging: vme: mmap() support for vme_user

We also make sure that user won't be able to reconfigure the window while it is
mmap'ed.

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Cc: Martyn Welch <martyn.welch@ge.com>
Cc: Igor Alekseev <igor.alekseev@itep.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vme: use image mutex for ioctl()
Dmitry Kalinkin [Thu, 26 Feb 2015 15:53:09 +0000 (18:53 +0300)]
staging: vme: use image mutex for ioctl()

This implements more granular locking in vme_user_ioctl() by using separate
locks for each devfs device.

This also provides a synchronization between vme_user_read(), vme_user_write()
and vme_user_ioctl().

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Cc: Martyn Welch <martyn.welch@ge.com>
Cc: Igor Alekseev <igor.alekseev@itep.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192e: remove assignment of function parameter
Matteo Semenzato [Wed, 4 Mar 2015 18:53:10 +0000 (19:53 +0100)]
Staging: rtl8192e: remove assignment of function parameter

This patch removes the assignment of a function parameter that has no
effect.

Signed-off-by: Matteo Semenzato <mattew8898@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove unnecessary OOM message
Quentin Lambert [Thu, 5 Mar 2015 13:12:15 +0000 (14:12 +0100)]
staging: rtl8192e: Remove unnecessary OOM message

This patch reduces the kernel size by removing error messages that duplicate
the normal OOM message.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr)

@@
identifier f,print,l;
expression e;
constant char[] c;
@@

e = \(kzalloc\|kmalloc\|devm_kzalloc\|devm_kmalloc\)(...);
if (e == NULL) {
  <+...
-  print(...,c,...);
  ... when any
(
  goto l;
|
  return ...;
)
  ...+> }

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192x: Remove use of seq_printf return value
Joe Perches [Sun, 22 Feb 2015 02:53:45 +0000 (18:53 -0800)]
staging: rtl8192x: Remove use of seq_printf return value

The seq_printf return value, because it's frequently misused,
will eventually be converted to void.

See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to
     seq_has_overflowed() and make public")

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192u: ieee80211: dot11d: added parenthesis to RESET_CIE_WATCHDOG macro
Tolga Ceylan [Sat, 21 Feb 2015 02:14:24 +0000 (18:14 -0800)]
Staging: rtl8192u: ieee80211: dot11d: added parenthesis to RESET_CIE_WATCHDOG macro

Added parenthesis to RESET_CIE_WATCHDOG macro to resolve checkpatch
error.

Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl9182u: r819xU_firmware: Replaced C99 comments with C89
Tolga Ceylan [Fri, 20 Feb 2015 05:54:10 +0000 (21:54 -0800)]
Staging: rtl9182u: r819xU_firmware: Replaced C99 comments with C89

Replaced C99 comments with C89.

Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192u: r819xU_firmware: removed commented out assert
Tolga Ceylan [Fri, 20 Feb 2015 05:54:09 +0000 (21:54 -0800)]
Staging: rtl8192u: r819xU_firmware: removed commented out assert

Removed an assert that was commented out. The comment provides
no documentation value as rt_status is properly handled.

Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192u: r819xU_firmware: removed commented out variable
Tolga Ceylan [Fri, 20 Feb 2015 05:54:08 +0000 (21:54 -0800)]
Staging: rtl8192u: r819xU_firmware: removed commented out variable

Removed commented out variable

Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192u: r8192U_core: Fix driver_info dereference as a null pointer
Rickard Strandqvist [Sat, 7 Feb 2015 14:56:10 +0000 (15:56 +0100)]
staging: rtl8192u: r8192U_core: Fix driver_info dereference as a null pointer

Fix possible use of use of driver_info as a null pointer in
query_rxdesc_status()
This could happen if stats->RxIs40MHzPacket still has the
default value of zero.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove LOGWRN() macros and uniklog.h
Benjamin Romer [Wed, 4 Mar 2015 17:14:26 +0000 (12:14 -0500)]
staging: unisys: remove LOGWRN() macros and uniklog.h

Remove the last set of macros from uniklog.h. Without LOGWRN() and
friends, uniklog.h is empty so we can delete the file itself as well.

This macro was not used a lot but the file was included in many places.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove ERRDEV macros
Benjamin Romer [Wed, 4 Mar 2015 17:14:25 +0000 (12:14 -0500)]
staging: unisys: remove ERRDEV macros

Remove the LOGERR, LOGERRDEV, LOGERRDEVX, LOGERRNAME, LOGORDUMPERR
macros from all the drivers.

In one case the removal of the ERRDRV() changed things such that a macro which
returned a value was needed, but the return value was no longer being used. In
this case the macro was replaced with the contents of the macro, but with the
truth calculation removed so that it would not generate a warning.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove LOGVER macro
Benjamin Romer [Wed, 4 Mar 2015 17:14:24 +0000 (12:14 -0500)]
staging: unisys: remove LOGVER macro

Remove the LOGVER macro from the drivers entirely.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove ASSERT() macro
Benjamin Romer [Wed, 4 Mar 2015 17:14:23 +0000 (12:14 -0500)]
staging: unisys: remove ASSERT() macro

Remove the ASSERT macro from timskmod.h, and replace its single use with
WARN_ON() instead.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove LOGINF macros
Benjamin Romer [Wed, 4 Mar 2015 17:14:22 +0000 (12:14 -0500)]
staging: unisys: remove LOGINF macros

Remove the LOGINF, LOGINFDEV, LOGINFDEVX, LOGINFNAME, PRINTKDRV, and
INFODRV macros entirely from the driver set.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove DBGINF, DBGVER, DEBUGDEV, and DEBUGDRV macros
Benjamin Romer [Wed, 4 Mar 2015 17:14:21 +0000 (12:14 -0500)]
staging: unisys: remove DBGINF, DBGVER, DEBUGDEV, and DEBUGDRV macros

The messages put out by these macros are for driver debugging and aren't needed
any more, so just remove all use of them, and the macros too.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: fbtft: add header for internal functions
Drew Fustini [Wed, 4 Mar 2015 08:10:11 +0000 (02:10 -0600)]
Staging: fbtft: add header for internal functions

Remove extern keyword from function prototypes to suppress warning from
checkpatch.pl with --strict option: https://lkml.org/lkml/2013/7/23/422

fbtft maintainer Noralf Tronnes advised these functions are internal to
this module & suggested moving these prototypes to new internal.h file.
He also advised fbtft.h file will eventually live in include/linux/fbtft.h

Suggested-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Drew Fustini <pdp7pdp7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoMAINTAINERS: update for sm750fb driver
Sudip Mukherjee [Tue, 3 Mar 2015 10:51:07 +0000 (16:21 +0530)]
MAINTAINERS: update for sm750fb driver

add myself and Teddy Wang as the Maintainer of the sm750
frame buffer driver.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: add sm750 to staging
Sudip Mukherjee [Tue, 3 Mar 2015 10:51:06 +0000 (16:21 +0530)]
staging: sm750fb: add sm750 to staging

sm750 of Silicon Motion is pci-e display controller device and has
features like dual display and 2D acceleration. This patch adds the
driver to staging.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm7xxfb: make vgamode static
Sudip Mukherjee [Tue, 10 Feb 2015 12:08:40 +0000 (17:38 +0530)]
staging: sm7xxfb: make vgamode static

the variable vgamode is used only in this file and hence can be
safely made as static.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: i2o: Remove use of seq_printf return value
Joe Perches [Sun, 22 Feb 2015 02:53:44 +0000 (18:53 -0800)]
staging: i2o: Remove use of seq_printf return value

The seq_printf return value, because it's frequently misused,
will eventually be converted to void.

See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to
     seq_has_overflowed() and make public")

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8188eu: Fix trivial typos in comments
Yannick Guerrini [Thu, 26 Feb 2015 16:36:33 +0000 (17:36 +0100)]
staging: rtl8188eu: Fix trivial typos in comments

Change 'disabed' and 'disabel' to 'disabled'
Change 'inviation' to 'invitation'
Change 'negoitation' to 'negotiation'

Signed-off-by: Yannick Guerrini <yguerrini@tomshardware.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: panel: initialize lcd if lcd enabled
Sudip Mukherjee [Wed, 11 Feb 2015 11:27:08 +0000 (16:57 +0530)]
staging: panel: initialize lcd if lcd enabled

initialiaze lcd parameters only if lcd is enabled.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Acked-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: panel: register driver after checking device
Sudip Mukherjee [Tue, 10 Feb 2015 11:56:02 +0000 (17:26 +0530)]
staging: panel: register driver after checking device

register the driver only if lcd or keypad has been enabled and if
both are disabled then just exit.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Acked-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: vt6655: fix C99 comments
Matteo Semenzato [Sat, 28 Feb 2015 14:28:15 +0000 (15:28 +0100)]
Staging: vt6655: fix C99 comments

This patch fixes the following warning:
do not use C99 // comments

Signed-off-by: Matteo Semenzato <mattew8898@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: Cleanup C99 comments
Alex W Slater [Thu, 26 Feb 2015 20:09:26 +0000 (20:09 +0000)]
staging: vt6655: Cleanup C99 comments

Fix checkpatch.pl errors:

"ERROR: do not use C99 // comments"

Signed-off-by: Alex W Slater <alex.slater.dev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: vt6655 fix C99 style comments
Matt [Sat, 21 Feb 2015 09:40:02 +0000 (10:40 +0100)]
Staging: vt6655 fix C99 style comments

Signed-off-by: Matteo Semenzato <mattew8898@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: fix coding style issues in channel.c
Ivan Stankovic [Thu, 12 Feb 2015 21:08:26 +0000 (22:08 +0100)]
staging: vt6655: fix coding style issues in channel.c

Observe the line length limit to make checkpatch.pl happy.

Signed-off-by: Ivan Stankovic <pokemon@fly.srk.fer.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6656: Fix possible leak in vnt_download_firmware()
Christian Engelmayer [Wed, 11 Feb 2015 19:33:15 +0000 (20:33 +0100)]
staging: vt6656: Fix possible leak in vnt_download_firmware()

When failing to allocate buffer memory, function vnt_download_firmware() goes
through the wrong exit path and fails to release the already requested
firmware. Thus use the correct cleanup. Detected by Coverity CID 1269128.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Reviewed-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: ozwpan: Move code from success handling to error handling
Quentin Lambert [Tue, 10 Feb 2015 10:42:08 +0000 (11:42 +0100)]
staging: ozwpan: Move code from success handling to error handling

The original version was success handling rather than error handling,
therefore this patch reduces nesting.

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: ozwpan: Remove allocation from delaration line
Quentin Lambert [Tue, 10 Feb 2015 09:24:12 +0000 (10:24 +0100)]
staging: ozwpan: Remove allocation from delaration line

This patch removes allocation from declaration line because
people are known to gloss over declarations.

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: dgnc: Fix checking return value of register_chrdev
Salah Triki [Thu, 5 Mar 2015 02:50:24 +0000 (03:50 +0100)]
Staging: dgnc: Fix checking return value of register_chrdev

The failure code is negative. So check <0 instead of <=0.
Return the failure code instead of -ENXIO.

Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: dgnc: fix braces {} are not necessary for single statement blocks
Salah Triki [Sun, 1 Mar 2015 22:18:50 +0000 (23:18 +0100)]
staging: dgnc: fix braces {} are not necessary for single statement blocks

This patch fixes the following checkpatch.pl warning:
braces {} are not necessary for single statement blocks

Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging:lustre:libcfs: Merge linux-proc.c into module.c
Matthew Tyler [Fri, 6 Mar 2015 10:09:27 +0000 (18:09 +0800)]
staging:lustre:libcfs: Merge linux-proc.c into module.c

module.c was previously the sole exporter of symbols from linux-proc.c
This patch removes the global symbols by merging the two files

Signed-off-by: Matthew Tyler <matt.tyler@flashics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: space prohibited between function name and open parenthesis '('
Alberto Pires de Oliveira Neto [Tue, 3 Mar 2015 00:09:48 +0000 (21:09 -0300)]
staging: lustre: space prohibited between function name and open parenthesis '('

This patch fixes checkpatch.pl warning.
WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Alberto Pires de Oliveira Neto <mrpenguin2005@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/libcfs: replace deprecated cpus_ calls with cpumask_
Oleg Drokin [Mon, 2 Mar 2015 06:01:47 +0000 (01:01 -0500)]
staging/lustre/libcfs: replace deprecated cpus_ calls with cpumask_

Rusty Russel advises that cpus_* functions are deprecated to work
on cpumasks and cpumask_* functions should be called instead,
otherwise problems with CPUMASK_OFFSTACK arise.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/ptlrpc: Do not use deprecated cpus_* functions
Oleg Drokin [Mon, 2 Mar 2015 06:01:46 +0000 (01:01 -0500)]
staging/lustre/ptlrpc: Do not use deprecated cpus_* functions

As per Rusty Russel, cpus_* functions are deprecated.
When mixing cpumask_copy with cpus_weight, they operate on different
sized masks if CPUMASK_OFFSTACK is enabled, causing an
immediate assertion failure.
Copying of cpumasks by assignment is also not allowed now.

Additionally, in ptlrpc/service.c avoid the cpumask copies,
since we only use it to check how many siblings are there for
core #0 and nothing else.

Reported-by: Tyson Whitehead <twhitehead@gmail.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: drivers/*.c: add missing braces {} to if/else branches
H Hartley Sweeten [Thu, 5 Mar 2015 20:21:18 +0000 (13:21 -0700)]
staging: comedi: drivers/*.c: add missing braces {} to if/else branches

According to the CodingStyle, braces should  be used on all branches
if thet are used on any branch,

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: drivers/*.c: remove unnecessary blank lines
H Hartley Sweeten [Thu, 5 Mar 2015 20:21:17 +0000 (13:21 -0700)]
staging: comedi: drivers/*.c: remove unnecessary blank lines

Blank lines are not needed before a close brace '}' or after an
open brace '{'. Also remove any multiple blank lines.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: drivers/*.c: alignment should match open parenthesis
H Hartley Sweeten [Thu, 5 Mar 2015 20:21:16 +0000 (13:21 -0700)]
staging: comedi: drivers/*.c: alignment should match open parenthesis

Fix the alignment issues in all the comedi drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: drivers/*.c: fix common misspellings
H Hartley Sweeten [Thu, 5 Mar 2015 20:21:15 +0000 (13:21 -0700)]
staging: comedi: drivers/*.c: fix common misspellings

Fix these common misspellings:
  s/dependancy/dependency
  s/occured/occurred
  s/informations/information
  s/intialize/initialize
  s/serveral/several
  s/interrups/interrupts
  s/acknowledgement/acknowledgment
  s/suppport/support
  s/writting/writing

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: s626: remove unnecessary 'cmd' pointer checks
H Hartley Sweeten [Wed, 4 Mar 2015 19:15:42 +0000 (12:15 -0700)]
staging: comedi: s626: remove unnecessary 'cmd' pointer checks

The local variable 'cmd' is a pointer to the address of a member variable
of a struct. It will always be valid. Remove the unnecessary checks.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: kcomedilib_main: (!foo) preferred over (foo == NULL)
H Hartley Sweeten [Wed, 4 Mar 2015 19:15:41 +0000 (12:15 -0700)]
staging: comedi: kcomedilib_main: (!foo) preferred over (foo == NULL)

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: ni_mio_common: (!foo) preferred over (foo == NULL)
H Hartley Sweeten [Wed, 4 Mar 2015 19:15:40 +0000 (12:15 -0700)]
staging: comedi: ni_mio_common: (!foo) preferred over (foo == NULL)

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: ni_tiocmd: (!foo) preferred over (foo == NULL)
H Hartley Sweeten [Wed, 4 Mar 2015 19:15:39 +0000 (12:15 -0700)]
staging: comedi: ni_tiocmd: (!foo) preferred over (foo == NULL)

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: ni_pcimio: (!foo) preferred over (foo == NULL)
H Hartley Sweeten [Wed, 4 Mar 2015 19:15:38 +0000 (12:15 -0700)]
staging: comedi: ni_pcimio: (!foo) preferred over (foo == NULL)

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: ni_pcidio: (!foo) preferred over (foo == NULL)
H Hartley Sweeten [Wed, 4 Mar 2015 19:15:37 +0000 (12:15 -0700)]
staging: comedi: ni_pcidio: (!foo) preferred over (foo == NULL)

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: ni_labpc_common: (!foo) preferred over (foo == NULL)
H Hartley Sweeten [Wed, 4 Mar 2015 19:15:36 +0000 (12:15 -0700)]
staging: comedi: ni_labpc_common: (!foo) preferred over (foo == NULL)

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: ni_atmio: (!foo) preferred over (foo == NULL)
H Hartley Sweeten [Wed, 4 Mar 2015 19:15:35 +0000 (12:15 -0700)]
staging: comedi: ni_atmio: (!foo) preferred over (foo == NULL)

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: ni_660x: (!foo) preferred over (foo == NULL)
H Hartley Sweeten [Wed, 4 Mar 2015 19:15:34 +0000 (12:15 -0700)]
staging: comedi: ni_660x: (!foo) preferred over (foo == NULL)

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: mite: (!foo) preferred over (foo == NULL)
H Hartley Sweeten [Wed, 4 Mar 2015 19:15:33 +0000 (12:15 -0700)]
staging: comedi: mite: (!foo) preferred over (foo == NULL)

Also, clarify the 'ring' allocation failure by returning NULL instead
of 'ring' (which would be NULL).

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas64: (!foo) preferred over (foo == NULL)
H Hartley Sweeten [Wed, 4 Mar 2015 19:15:32 +0000 (12:15 -0700)]
staging: comedi: cb_pcidas64: (!foo) preferred over (foo == NULL)

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: amplc_pci230: (!foo) preferred over (foo == NULL)
H Hartley Sweeten [Wed, 4 Mar 2015 19:15:31 +0000 (12:15 -0700)]
staging: comedi: amplc_pci230: (!foo) preferred over (foo == NULL)

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: amplc_pci224: (!foo) preferred over (foo == NULL)
H Hartley Sweeten [Wed, 4 Mar 2015 19:15:30 +0000 (12:15 -0700)]
staging: comedi: amplc_pci224: (!foo) preferred over (foo == NULL)

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: drivers: (!foo) preferred over (foo == NULL)
H Hartley Sweeten [Wed, 4 Mar 2015 19:15:29 +0000 (12:15 -0700)]
staging: comedi: drivers: (!foo) preferred over (foo == NULL)

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: comedi_fops: (!foo) preferred over (foo == NULL)
H Hartley Sweeten [Wed, 4 Mar 2015 19:15:28 +0000 (12:15 -0700)]
staging: comedi: comedi_fops: (!foo) preferred over (foo == NULL)

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: ste_rmi4: clean dev_err logging
Haneen Mohammed [Fri, 6 Mar 2015 19:07:13 +0000 (22:07 +0300)]
Staging: ste_rmi4: clean dev_err logging

This patch removes  __func__ from dev_err. dev_err includes information about:
(devcice, driver, specific instance of device, etc) in the log printout.
This was done using Coccinelle, with the following semantic patch:

@a@
expression E, R;
expression  msg;
@@

dev_err(E, msg, __func__, R);

@script:python b@
e << a.msg;
y;
@@

if(e.find("%s: ") == True):
m = e.replace("%s: ", "", 1);
coccinelle.y = m;
elif(e.find("%s ") == True):
m = e.replace("%s ", "", 1);
coccinelle.y = m;
elif(e.find("%s:") == True):
m = e.replace("%s:", "", 1);
coccinelle.y = m;
else:
m = e.replace("%s", "",1);
coccinelle.y = m;

@c@
expression a.E, a.msg, a.R;
identifier  b.y;
@@

- dev_err(E, msg, __func__, R);
+ dev_err(E, y, R);

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: slicoss: clean dev_err logging
Haneen Mohammed [Fri, 6 Mar 2015 19:05:05 +0000 (22:05 +0300)]
Staging: slicoss: clean dev_err logging

This patch removes  __func__ from dev_err. dev_err includes information about:
(devcice, driver, specific instance of device, etc) in the log printout.
This was done using Coccinelle, with the following semantic patch:

@a@
expression E, R;
expression  msg;
@@

dev_err(E, msg, __func__, R);

@script:python b@
e << a.msg;
y;
@@

if(e.find("%s: ") == True):
m = e.replace("%s: ", "", 1);
coccinelle.y = m;
elif(e.find("%s ") == True):
m = e.replace("%s ", "", 1);
coccinelle.y = m;
elif(e.find("%s:") == True):
m = e.replace("%s:", "", 1);
coccinelle.y = m;
else:
m = e.replace("%s", "",1);
coccinelle.y = m;

@c@
expression a.E, a.msg, a.R;
identifier  b.y;
@@

- dev_err(E, msg, __func__, R);
+ dev_err(E, y, R);

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: clean dev_err logging
Haneen Mohammed [Fri, 6 Mar 2015 19:03:53 +0000 (22:03 +0300)]
Staging: iio: clean dev_err logging

This patch removes  __func__ from dev_err. dev_err includes information about:
(devcice, driver, specific instance of device, etc) in the log printout.
This was done using Coccinelle, with the following semantic patch:

@a@
expression E, R;
expression  msg;
@@

dev_err(E, msg, __func__, R);

@script:python b@
e << a.msg;
y;
@@

if(e.find("%s: ") == True):
m = e.replace("%s: ", "", 1);
coccinelle.y = m;
elif(e.find("%s ") == True):
m = e.replace("%s ", "", 1);
coccinelle.y = m;
elif(e.find("%s:") == True):
m = e.replace("%s:", "", 1);
coccinelle.y = m;
else:
m = e.replace("%s", "",1);
coccinelle.y = m;

@c@
expression a.E, a.msg, a.R;
identifier  b.y;
@@

- dev_err(E, msg, __func__, R);
+ dev_err(E, y, R);

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rts5208: clean dev_err logging
Haneen Mohammed [Fri, 6 Mar 2015 19:03:05 +0000 (22:03 +0300)]
Staging: rts5208: clean dev_err logging

This patch removes  __func__ from dev_err. dev_err includes information about:
(devcice, driver, specific instance of device, etc) in the log printout.
This was done using Coccinelle, with the following semantic patch:

@a@
expression E, R;
expression  msg;
@@

dev_err(E, msg, __func__, R);

@script:python b@
e << a.msg;
y;
@@

if(e.find("%s: ") == True):
m = e.replace("%s: ", "", 1);
coccinelle.y = m;
elif(e.find("%s ") == True):
m = e.replace("%s ", "", 1);
coccinelle.y = m;
elif(e.find("%s:") == True):
m = e.replace("%s:", "", 1);
coccinelle.y = m;
else:
m = e.replace("%s", "",1);
coccinelle.y = m;

@c@
expression a.E, a.msg, a.R;
identifier  b.y;
@@

- dev_err(E, msg, __func__, R);
+ dev_err(E, y, R);

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: comedi: clean dev_err logging
Haneen Mohammed [Fri, 6 Mar 2015 19:01:38 +0000 (22:01 +0300)]
Staging: comedi: clean dev_err logging

This patch removes  __func__ from dev_err. dev_err includes information about:
(devcice, driver, specific instance of device, etc) in the log printout.
This was done using Coccinelle, with the following semantic patch:

@a@
expression E, R;
expression  msg;
@@

dev_err(E, msg, __func__, R);

@script:python b@
e << a.msg;
y;
@@

if(e.find("%s: ") == True):
m = e.replace("%s: ", "", 1);
coccinelle.y = m;
elif(e.find("%s ") == True):
m = e.replace("%s ", "", 1);
coccinelle.y = m;
elif(e.find("%s:") == True):
m = e.replace("%s:", "", 1);
coccinelle.y = m;
else:
m = e.replace("%s", "",1);
coccinelle.y = m;

@c@
expression a.E, a.msg, a.R;
identifier  b.y;
@@

- dev_err(E, msg, __func__, R);
+ dev_err(E, y, R);

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: gdm72xx: clean dev_err logging
Haneen Mohammed [Fri, 6 Mar 2015 19:00:42 +0000 (22:00 +0300)]
Staging: gdm72xx: clean dev_err logging

This patch removes  __func__ from dev_err. dev_err includes information about:
(devcice, driver, specific instance of device, etc) in the log printout.
This was done using Coccinelle, with the following semantic patch:

@a@
expression E, R;
expression  msg;
@@

dev_err(E, msg, __func__, R);

@script:python b@
e << a.msg;
y;
@@

if(e.find("%s: ") == True):
m = e.replace("%s: ", "", 1);
coccinelle.y = m;
elif(e.find("%s ") == True):
m = e.replace("%s ", "", 1);
coccinelle.y = m;
elif(e.find("%s:") == True):
m = e.replace("%s:", "", 1);
coccinelle.y = m;
else:
m = e.replace("%s", "",1);
coccinelle.y = m;

@c@
expression a.E, a.msg, a.R;
identifier  b.y;
@@

- dev_err(E, msg, __func__, R);
+ dev_err(E, y, R);

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: media: clean dev_err logging
Haneen Mohammed [Fri, 6 Mar 2015 19:00:10 +0000 (22:00 +0300)]
Staging: media: clean dev_err logging

This patch removes  __func__ from dev_err. dev_err includes information about:
(devcice, driver, specific instance of device, etc) in the log printout.
This was done using Coccinelle, with the following semantic patch:

@a@
expression E, R;
expression  msg;
@@

dev_err(E, msg, __func__, R);

@script:python b@
e << a.msg;
y;
@@

if(e.find("%s: ") == True):
m = e.replace("%s: ", "", 1);
coccinelle.y = m;
elif(e.find("%s ") == True):
m = e.replace("%s ", "", 1);
coccinelle.y = m;
elif(e.find("%s:") == True):
m = e.replace("%s:", "", 1);
coccinelle.y = m;
else:
m = e.replace("%s", "",1);
coccinelle.y = m;

@c@
expression a.E, a.msg, a.R;
identifier  b.y;
@@

- dev_err(E, msg, __func__, R);
+ dev_err(E, y, R);

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: fbtft: clean dev_err() logging
Haneen Mohammed [Fri, 6 Mar 2015 18:59:04 +0000 (21:59 +0300)]
Staging: fbtft: clean dev_err() logging

This patch removes  __func__ from dev_err. dev_err includes information about:
(devcice, driver, specific instance of device, etc) in the log printout.
This was done using Coccinelle, with the following semantic patch:

@a@
expression E, R;
expression  msg;
@@

dev_err(E, msg, __func__, R);

@script:python b@
e << a.msg;
y;
@@

if(e.find("%s: ") == True):
m = e.replace("%s: ", "", 1);
coccinelle.y = m;
elif(e.find("%s ") == True):
m = e.replace("%s ", "", 1);
coccinelle.y = m;
elif(e.find("%s:") == True):
m = e.replace("%s:", "", 1);
coccinelle.y = m;
else:
m = e.replace("%s", "",1);
coccinelle.y = m;

@c@
expression a.E, a.msg, a.R;
identifier  b.y;
@@

- dev_err(E, msg, __func__, R);
+ dev_err(E, y, R);

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: media: Replace dev_err with pr_err to avoid null pointer derefrence
Haneen Mohammed [Fri, 6 Mar 2015 17:01:07 +0000 (20:01 +0300)]
Staging: media: Replace dev_err with pr_err to avoid null pointer derefrence

This patch replace dev_err with pr_err, for pointer is derefrenced after comparing it to NULL.
This was found using the following coccinelle script:

@disable is_null@
identifier f;
expression E;
identifier fld;
statement S;
@@

+ if(E == NULL) S
f(...,E->fld,...);
-if(E == NULL) S;

@@
identifier f;
expression E;
identifier fld;
statement S;
@@

+ if(!E) S
f(...,E->fld,...);
-if(!E) S;

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: comedi: Clean dev_err() logging
Haneen Mohammed [Thu, 5 Mar 2015 10:01:49 +0000 (13:01 +0300)]
Staging: comedi: Clean dev_err() logging

This patch removes  __func__ from dev_err. dev_err includes information about:
 (devcice, driver, specific instance of device, etc) in the log printout, so there is no need for  __func__.
This was done using Coccinelle, with the following semantic patch:

@a@
expression E;
expression  msg;
@@

dev_err(E, msg, __func__);

@script:python b@
e << a.msg;
y;
@@

if(e.find("%s: ") == True):
m = e.replace("%s: ", "");
coccinelle.y = m;
elif(e.find("%s ") == True):
m = e.replace("%s ", "");
coccinelle.y = m;
else:
m = e.replace("%s", "");

@c@
expression a.E, a.msg;
identifier  b.y;
@@

- dev_err(E, msg, __func__);
+ dev_err(E, y);

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192u: Replace TRUE with true
Ksenija Stanojevic [Wed, 4 Mar 2015 23:51:46 +0000 (00:51 +0100)]
Staging: rtl8192u: Replace TRUE with true

This patch replaces TRUE by true, since Linux kernel has already a
boolean type, bool, defined in linux/stddef.h

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8723au: Fixed error 'else should follow close brace '}".
Yeliz Taneroglu [Wed, 4 Mar 2015 21:15:16 +0000 (23:15 +0200)]
Staging: rtl8723au: Fixed error 'else should follow close brace '}".

This patch fixes error 'else should follow close brace '}"
found by checkpatch in driver rtl8723au.

Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: unisys: Remove unnecessary semicolon
Yeliz Taneroglu [Wed, 4 Mar 2015 19:32:49 +0000 (21:32 +0200)]
Staging: unisys: Remove unnecessary semicolon

This fixes the checkpatch.pl warning:
WARNING: macros should not use a trailing semicolon.

Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: drivers: Bool initializations should use true/false
Cristina Opriceana [Wed, 4 Mar 2015 10:37:28 +0000 (12:37 +0200)]
Staging: drivers: Bool initializations should use true/false

This patch replaces bool initializations of 1/0 with true/false in order
to increase readability and respect the standards. Warning found by
coccinelle.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove if conditions.
Navya Sri Nizamkari [Wed, 4 Mar 2015 08:45:05 +0000 (14:15 +0530)]
staging: rtl8192e: Remove if conditions.

This patch removes if conditions with no exececutable
statements in the bodies of those ifs and also no variable
assignments in the if conditional checks. The call to
rtllib_act_scanning in the condition doesn't have any side
effects as it too performs conditional checks without changing
any values. Hence, it's safe to remove the if condition.

Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8188eu: Remove unnecessary return statements
Somya Anand [Wed, 4 Mar 2015 08:40:46 +0000 (14:10 +0530)]
Staging: rtl8188eu: Remove unnecessary return statements

This patch removes unnecessary return statement from a void
function.

This issue is identified by checkpatch.pl

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8188eu: Remove redundant local variable
Somya Anand [Wed, 4 Mar 2015 08:40:44 +0000 (14:10 +0530)]
Staging: rtl8188eu: Remove redundant local variable

This patch removes a redundant variable "raid" and adds inline
return statements.

This issue is identified by the following coccinelle script:
@@
expression ret;
identifier f;
@@

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

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8712: replace memset(x,0,ETH_ALEN)
Aya Mahfouz [Wed, 4 Mar 2015 07:00:02 +0000 (09:00 +0200)]
staging: rtl8712: replace memset(x,0,ETH_ALEN)

eth_zero_addr() is a wrapper function for memset if 0 is going to
be assigned to a mac address. The aforementioned function replaces
memset. In addition, linux/etherdevice.h was included as a header
since it is the file that defines the inline function eth_zero_addr().
The changes were carried out using the following coccinelle script:

@header@
@@

#include <linux/etherdevice.h>

@eth_zero_addr@
expression e;
@@

-memset(e,0,ETH_ALEN);
+eth_zero_addr(e);

@eth_broadcast_addr@
identifier e;
@@

-memset(e,\(0xff\|0xFF\|255\),ETH_ALEN);
+eth_broadcast_addr(e);

@linux_header depends on !header && (eth_zero_addr || eth_broadcast_addr) @
@@

+ #include <linux/etherdevice.h>
+

@special_header depends on !header && !linux_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>
+

@custom_header depends on !header && !linux_header && !special_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8188eu: replace memset(x,0,ETH_ALEN)
Aya Mahfouz [Wed, 4 Mar 2015 06:56:45 +0000 (08:56 +0200)]
staging: rtl8188eu: replace memset(x,0,ETH_ALEN)

eth_zero_addr() is a wrapper function for memset if 0 is going to
be assigned to a mac address. The aforementioned function replaces
memset. In addition, linux/etherdevice.h was included as a header
since it is the file that define the inline function eth_zero_addr().
The changes were carried out using the following coccinelle script:

@header@
@@

#include <linux/etherdevice.h>

@eth_zero_addr@
expression e;
@@

-memset(e,0,ETH_ALEN);
+eth_zero_addr(e);

@eth_broadcast_addr@
identifier e;
@@

-memset(e,\(0xff\|0xFF\|255\),ETH_ALEN);
+eth_broadcast_addr(e);

@linux_header depends on !header && (eth_zero_addr || eth_broadcast_addr) @
@@

+ #include <linux/etherdevice.h>
+

@special_header depends on !header && !linux_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>
+

@custom_header depends on !header && !linux_header && !special_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: virthba: remove extra parentheses around left bit shift operations
Aya Mahfouz [Wed, 4 Mar 2015 06:20:14 +0000 (08:20 +0200)]
staging: unisys: virthba: remove extra parentheses around left bit shift operations

Removes extra parentheses around bitwise left shift operations.
The case handled is when resultant value is assigned to a variable.
The issue was detected and resolved using the following
coccinelle script:

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

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

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

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

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

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

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: slicoss: remove extra parentheses around left bit shift operations
Aya Mahfouz [Wed, 4 Mar 2015 06:19:50 +0000 (08:19 +0200)]
staging: slicoss: remove extra parentheses around left bit shift operations

Removes extra parentheses around bitwise left shift operations.
The case handled is when resultant value is assigned to a variable.
The issue was detected and resolved using the following
coccinelle script:

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

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

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

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

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

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

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rts5208: remove extra parentheses around left bit shift operation
Aya Mahfouz [Wed, 4 Mar 2015 06:19:24 +0000 (08:19 +0200)]
staging: rts5208: remove extra parentheses around left bit shift operation

Removes extra parentheses around bitwise left shift operations.
The case handled is when resultant value is assigned to a variable.
The issue was detected and resolved using the following
coccinelle script:

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

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

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

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

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

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

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: ozwpan: remove extra parentheses around left bit shift operations
Aya Mahfouz [Wed, 4 Mar 2015 06:18:47 +0000 (08:18 +0200)]
staging: ozwpan: remove extra parentheses around left bit shift operations

Removes extra parentheses around bitwise left shift operations.
The case handled is when resultant value is assigned to a variable.
The issue was detected and resolved using the following
coccinelle script:

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

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

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

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

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: remove extra parentheses around left bit shift operations
Aya Mahfouz [Wed, 4 Mar 2015 06:18:19 +0000 (08:18 +0200)]
staging: lustre: remove extra parentheses around left bit shift operations

Removes extra parentheses around bitwise left shift operations.
The cases handled here are when resultant values are assigned to
variables. The issue was detected and resolved using the following
coccinelle script:

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

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

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

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

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

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

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: xgifb: remove extra parentheses around right bit shift operations
Aya Mahfouz [Wed, 4 Mar 2015 05:35:48 +0000 (07:35 +0200)]
staging: xgifb: remove extra parentheses around right bit shift operations

Removes extra parentheses around bitwise right shift operations.
The cases handled here are when resultant values are assigned to
variables. The issue was detected and resolved using the following
coccinelle script:

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

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

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

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

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

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

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: speakup: remove extra parentheses around right bit shift operation
Aya Mahfouz [Wed, 4 Mar 2015 05:35:28 +0000 (07:35 +0200)]
staging: speakup: remove extra parentheses around right bit shift operation

Removes extra parentheses around bitwise right shift operation.
The case handled is  when the resultant value is assigned to
a variable. The issue was detected and resolved using the following
coccinelle script:

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

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

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

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

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

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

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>