Commit graph

546856 commits

Author SHA1 Message Date
Raphaël Beamonte
4e0407b453 staging: rtl8192u: r8192U_core: fix use ether_addr_copy() over memcpy() code style issue
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)

The values used are stored as dev_addr in net_device (declared in
include/linux/netdevice.h) and sa_data in sockaddr (declared in
include/linux/socket.h). Both these elements are u16 aligned as
shown by using pahole (position must be a multiple of sizeof(u16)):
unsigned char *            dev_addr;             /*   888     8 */
char                       sa_data[14];          /*     2    14 */

It is thus safe to use ether_addr_copy() instead of memcpy() for
that call, as it is already done in multiple files in the Linux
kernel sources:
  drivers/net/ethernet/broadcom/genet/bcmgenet.c
  drivers/net/ethernet/brocade/bna/bnad.c
  drivers/net/ethernet/emulex/benet/be_main.c
  drivers/net/ethernet/ezchip/nps_enet.c
  drivers/net/ethernet/ibm/ibmveth.c
  drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
  drivers/net/ethernet/intel/i40e/i40e_main.c
  drivers/net/ethernet/mellanox/mlx5/core/en_main.c
  drivers/net/usb/lan78xx.c
  net/8021q/vlan_dev.c
  net/batman-adv/soft-interface.c
  net/dsa/slave.c

Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:54 -07:00
Sudip Mukherjee
c32bb25ee1 staging: gdm72xx: NULL comparison style
checkpatch complains if NULL comparison is done as if (var == NULL)

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:53 -07:00
Sudip Mukherjee
ea022df193 staging: gdm72xx: fix memory leak
We were successfully requesting the firmware but on error it was not
being released.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:53 -07:00
Sudip Mukherjee
fb7014df15 staging: fbtft: do not use magic numbers
Using magic numbers are not good coding practise. Use
FBTFT_GPIO_NAME_SIZE as defined in the header files.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:53 -07:00
Sudip Mukherjee
eb6a2dbf32 staging: fbtft: use strncpy instead of strcpy
Using strcpy() is a security risk as the destination buffer size is not
checked and we may over-run the buffer. Use strncpy() instead, while
mentioning the buffer size leaving place for the NULL termination.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:53 -07:00
Shraddha Barke
e1b32e1e89 Staging: rtl8192e: rtl_wx.c: Remove braces for single statement blocks
The linux kernel coding style discourages use of braces for single
statement blocks. This patch removes the unnecessary braces.

The warning was detected using checkpatch.pl. Coccinelle was used to
make the change.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:53 -07:00
Shraddha Barke
ca0b6fe173 Staging: speakup: Remove braces for single statement blocks
The linux kernel coding style discourages use of braces for single
statement blocks. This patch removes the unnecessary braces.

The warning was detected using checkpatch.pl. Coccinelle was used to
make the change.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:53 -07:00
Shraddha Barke
7273773c2c Staging: android: Remove unnecessary braces.
The linux kernel coding style discourages use of braces for single
statement blocks. This patch removes the unnecessary braces.

The warning was detected using checkpatch.pl. Coccinelle was used
to make the change.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:53 -07:00
Shraddha Barke
12d273767a Staging: rtl8723au: hal: Remove braces for single statement blocks
The linux kernel coding style discourages use of braces for single
statement blocks. This patch removes the unnecessary braces.

The error was detected using checkpatch.pl. Coccinelle was used
to make the change.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:53 -07:00
Anish Bhatt
242850f48a staging/wlan-ng : Remove duplicated defines from p80211
ETH_ALEN/ETH_HLEN can be  used instead of
WLAN_ETHADDR_LEN & WLAN_ETHHDR_LEN, replace directly or
use eth_addr* functions where applicable.

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:52 -07:00
Nayeemahmed Badebade
a2f9ff6c75 Staging: fsl-mc/bus: mc-bus.c: Fixed coding style issues
Fixed coding style issues where kernel types u16,u64,u32 should
be preferred over uint16_t,uint64_t,uint32_t

Signed-off-by: Nayeemahmed Badebade <itachi.opsrc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:52 -07:00
Ravi Teja Darbha
f2b29165c5 staging: emxx_udc: Remove unused parameter from function parameter list parameter list
struct nbu2ss_ep *ep parameter in functions _nbu2ss_ep0_in_transfer()
and _nbu2ss_ep0_out_transfer() is not used anywhere inside. Hence,
removed.

Signed-off-by: Ravi Teja Darbha <ravi2j@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:52 -07:00
Ravi Teja Darbha
c648a57ae5 staging: emxx_udc: Remove cleanup1 label
The cleanup1 label does nothing but return. Better way is to return
immediately instead of using goto. Hence, removed.

Signed-off-by: Ravi Teja Darbha <ravi2j@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:52 -07:00
Ravi Teja Darbha
706eb8cfb1 staging: emxx_udc: Fix NULL comparison style
Fixed NULL comparison style as suggested by checkpatch.pl

Signed-off-by: Ravi Teja Darbha <ravi2j@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:52 -07:00
Ravi Teja Darbha
b68ff8f61e staging: emxx_udc: Avoid using multiple blank lines
Fixed multiple blank lines warning by checkpatch.pl

Signed-off-by: Ravi Teja Darbha <ravi2j@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:51 -07:00
Ravi Teja Darbha
446be1b553 staging: emxx_udc: Remove FSF mailing address
FSF mailing address is no longer required to be specified. Hence
removed.

Signed-off-by: Ravi Teja Darbha <ravi2j@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:51 -07:00
Sudip Mukherjee
4cba1972bb staging: lustre: lov: remove always false condition
The member qc_idx of struct if_quotactl is unsigned and hence it can
never be less than zero.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:51 -07:00
Sudip Mukherjee
d0f69b5a66 staging: lustre: lov: fix dereference of ERR_PTR
If lov_sub_get() fails then it returns the error code in ERR_PTR, but
here we were dereferencing sub without checking if lov_sub_get() has
actually succeeded or not. And on error we can directly return the error
code from lov_io_fault_start() as it return 0 on success and the error
code on error.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:51 -07:00
Anders Fridlund
2ced12a7f8 staging: lustre: ptlrpc: include ptlrpc_internal.h
Remove sparse warning "symbol 'sptlrpc_plain_init' was not declared"
by including ptlrpc_internal.h, which includes sptlrpc_plain_init.

Signed-off-by: Anders Fridlund <anders.fridlund@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:50 -07:00
Mike Rapoport
b45024edc4 staging: lustre: use linux/statfs.h instead of asm/statfs.h
Fix the following checkpatch warning:

drivers/staging/lustre/lustre/include/linux/lustre_lite.h:46:
WARNING:INCLUDE_LINUX: Use #include <linux/statfs.h> instead of <asm/statfs.h>

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:50 -07:00
Matthew Needes
ddb4e76743 staging: lustre/obdclass/linux/linux-module.c
Fixed sparse warning by removing unused variable "proc_version".

Signed-off-by: Matthew Needes <mneedes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:50 -07:00
Shraddha Barke
e03b80cfc2 Staging: lustre: lnet: Remove braces for single statement blocks
The linux kernel coding style discourages use of braces for single
statement blocks. This patch removes the unnecessary braces.

The warning was detected using checkpatch.pl. Coccinelle was used
to make the change.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:50 -07:00
Shraddha Barke
9d927bc51b Staging: lustre: llite: llite_lib.c: Remove unnecessary braces
The linux kernel coding style discourages use of braces for single
statement blocks. This patch removes the unnecessary braces.

The warning was detected using checkpatch.pl. Coccinelle was used to
make the change.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:50 -07:00
Shraddha Barke
d9ec18cf14 Staging: lustre: llite: llite_close.c: Remove unnecessary braces
The linux kernel coding style discourages use of braces for single
statement blocks. This patch removes the unnecessary braces.

The warning was detected using checkpatch.pl. Coccinelle was used to
make the change.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:49 -07:00
Shraddha Barke
451a377d10 Staging: lustre: obdclass: Remove braces for single statement blocks
The linux kernel coding style discourages use of braces for single
statement blocks. This patch removes the unnecessary braces.

The warning was detected using checkpatch.pl. Coccinelle was used to
make the change.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:49 -07:00
Shraddha Barke
bd2909f759 Staging: lustre: libcfs: Remove braces for single statement blocks
The linux kernel coding style discourages use of braces for single
statement blocks. This patch removes the unnecessary braces.

The warning was detected using checkpatch.pl. Coccinelle was used to
make the change.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:49 -07:00
Shraddha Barke
1b779d2e1b Staging: lustre: ptlrpc: Remove braces for single statement blocks
The linux kernel coding style discourages use of braces for single
statement blocks. This patch removes the unnecessary braces.

The warning was detected using checkpatch.pl. Coccinelle was used to
make the change.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:49 -07:00
Shraddha Barke
e72f36e22c Staging: lustre: osc: Space prohibited between function name and open parenthesis
This patch fixes the checkpatch.pl warning:

WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:49 -07:00
Shraddha Barke
fd6f9a4b08 Staging: lustre: obdclass: Insert blank line from declarations
This patch fixes the checkpatch.pl warning

WARNING: Missing a blank line after declarations

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:49 -07:00
Shraddha Barke
d4d34a5f5d Staging: lustre: obdclass: Remove unnecessary return statements
This patch removes return statement which are not required.
The warning was detected by checkpatch.pl

WARNING: void function return statements are not generally useful

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:48 -07:00
Shraddha Barke
3cf8e32d6d Staging: lustre: mdc: Remove useless cast on void pointer
void pointers do not need to be cast to other pointer types.

The semantic patch used to find this:

@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:48 -07:00
Shraddha Barke
91b4e64bfe Staging: lustre: lnet: Remove useless cast on void pointer
void pointers do not need to be cast to other pointer types.

The semantic patch used to find this:

@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:48 -07:00
Shraddha Barke
222a7e9166 Staging: lustre: obdclass: Use kasprintf instead of kzalloc and sprintf
This patch uses kasprintf which combines kzalloc and sprintf.

kasprintf also takes care of the size calculation.

Semantic patch used is as follows:

@@
expression a,flag;
expression list args;
statement S;
@@

 a =
- \(kmalloc\|kzalloc\)(...,flag)
+ kasprintf (flag,args)
  <... when != a
  if (a == NULL || ...) S
  ...>
- sprintf(a,args);

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:48 -07:00
Shraddha Barke
2de5855cf9 Staging: lustre: obdclass: Remove typedefs for struct
The Linux kernel coding style guidelines suggest not using typedefs for
structure and enum types. This patch gets rid of the typedefs for
lu_site_stats_t.

The following Coccinelle semantic patch detects the cases for struct type:

@tn@
identifier i;
type td;
@@

-typedef
 struct i { ... }
-td
 ;

@@
type tn.td;
identifier tn.i;
@@

-td
+ struct i

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:47 -07:00
Shraddha Barke
a8fff8bf6b Staging: lustre: libcfs: Remove typedefs for struct
The Linux kernel coding style guidelines suggest not using typedefs for
structure and enum types. This patch gets rid of the typedefs for
cfs_wi_sched_t.

The following Coccinelle semantic patch detects the cases for struct type:

@tn@
identifier i;
type td;
@@

-typedef
 struct i { ... }
-td
 ;

@@
type tn.td;
identifier tn.i;
@@

-td
+ struct i

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:47 -07:00
Leo Kim
780eb03eba staging: wilc1000: remove unused PLAT_RK3026_TCHIP
This patch removes the preprocessor definition, PLAT_RK3026_TCHIP which
is not used anymore.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:47 -07:00
Kim, Leo
721c985947 staging: wilc1000: delete definition USE_WIRELESS
The preprocessor definition, USE_WIRELESS is always in use.
So, this patch deletes the definitions from the makefile and source codes.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:46 -07:00
Kim, Leo
e89419bc9c staging: wilc1000: remove unused NM73131_0_BOARD
This patch removes the preprocessor definition, NM73131_0_BOARD which is
not used anymore.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:46 -07:00
Tony Cho
06b548638b staging: wilc1000: add maintainers for Atmel 802.11 driver
This patch adds new maintainers who develops new design for Atmel 802.11
link controller and deletes Dean Lee who cannot maintain the wireless
driver anymore.

Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:46 -07:00
Johnny Kim
3441847ee2 staging: wilc1000: remove meaningless line
The current driver is calling skb_reserve function to align memory in
frmw_to_linux function. However, the wrong value is used as the input argument.
Besides, the process is not necessary because the address already is algined
in dev_alloc_skb function. So, this patch removes the line for dummy headroom.

Signed-off-by: Johnny Kim <johnny.kim@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:46 -07:00
Johnny Kim
c590b9a4c0 staging: wilc1000: define undefined operation mode
This patch adds new define, IDLE_MODE to change comparison statement which
is wrong due to typecasting to null.

Signed-off-by: Johnny Kim <johnny.kim@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:45 -07:00
Chaehyun Lim
ac61ef86f9 staging: wilc1000: linux_wlan.c: add kzalloc error check
This patch adds error check if kzalloc is failed.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:45 -07:00
Chaehyun Lim
d9998a91fe staging: wilc1000: wilc_msgqueue.c: use kmalloc with GFP_ATOMIC
This patch use kmalloc with GFP_ATOMIC instead of WILC_MALLOC.
It is inside the spin lock region.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:45 -07:00
Chaehyun Lim
8c589c2401 staging: wilc1000: linux_wlan.c: use kzalloc instead of WILC_MALLOC
This patch replaces WILC_MALLOC with kzalloc.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:45 -07:00
Tony Cho
f638dd3918 staging: wilc1000: fix potential memory leak
This patch adds kfree(mgmt_tx) when memory allocation of mgmt_tx->buff
fails in the second calls of kmalloc() to avoid the memory leak from mgmt_tx
first allocated before the second calls of kmalloc().

Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Chris Park <chirs.park@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:45 -07:00
Tony Cho
700db05372 staging: wilc1000: remove unused preprocessor definition
This patch removes a preprocessor definition, SWITCH_LOG_TERMINAL,
which is not used. Enabling this definition affects the performance.

Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:44 -07:00
Tony Cho
1f39e10872 staging: wilc1000: remove dead codes
This patch removes the preprocessor definition from the codes, as shown in the
following, which is not used anymore.
- WILC_FULLY_HOSTING_AP

Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:44 -07:00
Sudip Mukherjee
ec58d2a872 staging: most: style of bool comparison
BOOLEAN tests do not need any comparison to TRUE or FALSE.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:44 -07:00
Sudip Mukherjee
0834be6c52 staging: most: remove unneeded NULL check
The loop cursor of list_for_each_entry_safe() can never be NULL.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:44 -07:00
Sudip Mukherjee
983e83cc17 staging: most: remove driver owner
The platform driver core will set the owner value, we do not need to do
it in the module.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:44 -07:00