high is a bool type variable.
bool variable should be assigned true, false not 1 or 0.
This patch assigns high to true, replacing 1.
Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Variable whose value is initialized but never used is unnecessary. The following Coccinelle semantic patch removed the unused variable.
@e@
identifier i;
position p;
type T;
@@
extern T i@p;
@@
type T;
identifier i;
constant C;
position p != e.p;
@@
- T i@p;
<+... when != i
- i = C;
...+>
Signed-off-by: Jiayi Ye <yejiayily@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Replaced calls to kzalloc followed by memcpy with a single call to
kmemdup.
Patch found using coccicheck.
Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Casting rhe return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language, as mentioned in
Documentation/CodingStyle, Chap 14.
Removed the cast on kzalloc return value.
Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes following checkpatch.pl warning:
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
Signed-off-by: Jiayi Ye <yejiayily@gmail.comi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch error:j
ERROR: switch and case should be at the same indent
105: FILE: drivers/staging/lustre/lustre/libcfs/fail.c:105:
Signed-off-by: Tina Ruchandani <ruchandani.tina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl
error: "Macros with complex values should be enclosed
in parentheses."
Signed-off-by: Tina Ruchandani <ruchandani.tina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes misc. spacing errors reported by
checkpatch.pl for lustre/llite/file.c
Signed-off-by: Tina Ruchandani <ruchandani.tina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The GOTO macro is not standard in Linux. The following Coccinelle semantic patch was used to expand the GOTO macro.
@@
identifier lbl;
identifier rc;
constant c;
@@
- GOTO(lbl,\(rc\|c\));
+ goto lbl;
@@
identifier lbl;
expression rc;
@@
- GOTO(lbl,rc);
+ rc;
+ goto lbl;
Signed-off-by: Jiayi Ye <yejiayily@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The linux kernel coding style guidelines suggest not using typedefs
for structure types. This patch gets rid of the typedef for
ldlm_ns_hash_def_t. Also, the name of the struct is changed to drop
the _t, to make the name look less typedef-like.
This is done using Coccinelle. Semantic patch used to detect this
case is as follows:
@tn1@
type td;
@@
typedef struct { ... } td;
@script:python tf@
td << tn1.td;
tdres;
@@
coccinelle.tdres = td;
@@
type tn1.td;
identifier tf.tdres;
@@
-typedef
struct
+ tdres
{ ... }
-td
;
@@
type tn1.td;
identifier tf.tdres;
@@
-td
+ struct tdres
Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch makes functions proc_lnet_routes, proc_lnet_routers,
proc_lnet_peers and proc_lnet_nis static in file router_proc.c
as they are used only in this file.
This problem is detected by sparse.
Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch adds the missing IIO modifiers in event_is_known function
and iio_modifier_names vector.
Additionally, it removes duplicate name entries of IIO_MOD_LIGHT_BOTH
and IIO_MOD_LIGHT_IR in iio_modifier_names.
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The output written by dgnc_sniff_nowait_nolock() is never used
anywhere since commit 35cf904593 ("staging: dgnc: removes proc code")
deleted the code that used to copy it to user space.
dgnc_sniff_nowait_nolock() uses 'timeval' to create header timestamps for
the data dump.
32-bit systems using 'struct timeval' will break in the year 2038,
This patch removes dgnc_sniff_nowait_nolock() and all ch_sniff_* members
of struct channel_t defined in "dgnc_driver.h". It also removes their usage
from the driver files and hence y2038 issue is also resolved.
Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following warning generated by checkpatch.pl
for the file wcmd.c
WARNING: printk() should include KERN_ facility level
printk was replaced by netdev_err since providing printk with the
facility level KERN_ERR generated the printing priority warning.
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reorganizes file to remove #defines from middle of functions. Also
removes #if'd loop declarations and adds ternary if driven loops.
Signed-off-by: Eric Rost <eric.rost@mybabylon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Pretties up multiline #defines and many other whitespace issues
Signed-off-by: Eric Rost <eric.rost@mybabylon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
binder.h isn't needed to just include a uapi file and set a single
define, so move it into binder.c to save a few lines of code.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The Android binder code has been "stable" for many years now. No matter
what comes in the future, we are going to have to support this API, so
might as well move it to the "real" part of the kernel as there's no
real work that needs to be done to the existing code.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The Beceem WiMAX driver was barely function in its current state
and was non-functional on 64 bit systems. Based on repeated
statements from Greg KH that he wanted the driver removed, I am
removing the driver.
CC: Matthias Beyer <mail@beyermatthias.de>
CC: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch focuses on fixing the following warning generated
by checkpatch.pl for the file dpc.c :
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)
The changes were applied using the following coccinelle rule:
@@ expression e1, e2; @@
- memcpy(e1, e2, ETH_ALEN);
+ ether_addr_copy(e1, e2);
According to ether_addr_copy() description and functionality,
all Ethernet addresses should align to the u16 datatype.
Here is the output of pahole for the relevant datastructures:
struct tagS802_11Header {
short unsigned int wFrameCtl; /* 0 2 */
short unsigned int wDurationID; /* 2 2 */
unsigned char abyAddr1[6]; /* 4 6 */
unsigned char abyAddr2[6]; /* 10 6 */
unsigned char abyAddr3[6]; /* 16 6 */
short unsigned int wSeqCtl; /* 22 2 */
unsigned char abyAddr4[6]; /* 24 6 */
/* size: 30, cachelines: 1, members: 7 */
/* last cacheline: 30 bytes */
};
struct iw_michaelmicfailure {
__u32 flags; /* 0 4 */
struct sockaddr src_addr; /* 4 16 */
__u8 tsc[8]; /* 20 8 */
/* size: 28, cachelines: 1, members: 3 */
/* last cacheline: 28 bytes */
};
struct sockaddr {
sa_family_t sa_family; /* 0 2 */
char sa_data[14]; /* 2 14 */
/* size: 16, cachelines: 1, members: 2 */
/* last cacheline: 16 bytes */
};
There is one thing to note though, sa_data is a char array of size 14.
And the number of bytes copied using memcpy() or ether_addr_copy()
is 6.
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch focuses on fixing the following warning generated
by checkpatch.pl for the file rxtx.c :
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)
The changes were applied using the following coccinelle rule:
@@ expression e1, e2; @@
- memcpy(e1, e2, ETH_ALEN);
+ ether_addr_copy(e1, e2);
According to ether_addr_copy() description and functionality,
all Ethernet addresses should align to the u16 datatype.
Here is the output of pahole for the relevant datastructures:
struct pmkid_candidate {
NDIS_802_11_MAC_ADDRESS BSSID; /* 0 6 */
/* XXX 2 bytes hole, try to pack */
long unsigned int Flags; /* 8 4 */
/* size: 12, cachelines: 1, members: 2 */
/* sum members: 10, holes: 1, sum holes: 2 */
/* last cacheline: 12 bytes */
};
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
We don't do anything with these, so get rid of them
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Half the entries of struct wlan_phy_info weren't used and this makes
the code a little cleaner
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Be consistent in the use of enum VCS_TYPE
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Make sure struct eeprom_priv->mac_addr is 2 byte aligned to work with
ether_addr_copy()
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
It's never enabled, so we can safely remove it.
Signed-off-by: Vladimir A. Nazarenko <naszar@ya.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes dead code in private_ioctl function and
iwctl_siwmode function, in file ioctl.c.
Inside switch, for a case no code gets executed
after break.
This was detected by smatch.
Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This fixes the following checkpatch.pl errors:
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c:1290 error: "foo* bar"
should be "foo *bar"
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c:1305 error: "foo * bar"
should be "foo *bar"
Signed-off-by: John Ledbetter <john@throttle.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Wrapping two too long lines in two files of the imx-drm driver.
Signed-off-by: Rene Kolarik <rene.kolarik@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
There is code encapsulated in #if 1, let's remove it.
Signed-off-by: Vladimir A. Nazarenko <naszar@ya.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The dgap_init_module() need to unwind for cleanup variables properly.
Because dgap_init_module() calls dgap_cleanup_module() for freeing
variables but this function is possible to free variables
which are not allocated.
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Custom ioctl 0xff is legacy code that was used for
patched version of wpa_supplicant, where function
wpa_authen_Status_transfer() called this ioctl to
tell authentication status to the driver. While
from upstream was added only driver code to the
kernel but not patches to the wpa_supplicant we
can safely remove this unused ioctl.
Signed-off-by: Vladimir A. Nazarenko <naszar@ya.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The following patch fixes the checkpatch.pl warning:
drivers/staging/rtl8723au/core/rtw_ap.c WARNING: void function return statements are not generally useful
Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>