Const qualifier added to struct declaration to avoid data overwrite
during runtime and improve security.
Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Const qualifier added to struct declaration to avoid data overwrite
during runtime and improve security.
Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The dma_buf_ops structure is stored in the ops field of a
dma_buf_export_info structure and also used as a condition inside the
if() statement. The if condition does not modify its value and the
ops field is of type const struct *dma_buf_ops, so dma_buf_ops
structures having this property can be declared as const.
File size before:
text data bss dec hex filename
14471 819 224 15514 3c9a
drivers/staging/android/ion/ion.o
File size after:
text data bss dec hex filename
14599 707 224 15530 3caa
drivers/staging/android/ion/ion.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Declare tty_port_operations structure as const as it is only stored in
the ops field of a tty_port structure which is a field of a gb_tty
structure. The ops field is of type const struct tty_port_operations *,
so tty_port_operations structures having this property can be
declared as const.
Done using Coccinelle:
@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct tty_port_operations i@p = {...};
@ok1@
identifier r1.i;
position p;
struct gb_tty q;
@@
q.port.ops=&i@p
@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct tty_port_operations i={...};
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct tty_port_operations i;
File size before:
text data bss dec hex filename
7646 512 56 8214 2016 drivers/staging/greybus/uart.o
File size after:
text data bss dec hex filename
7710 448 56 8214 2016 drivers/staging/greybus/uart.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Johan Hovold <johan@kernel.org>
Reviewed-by: David Lin <dtwlin@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch replaces kmalloc and memcpy with kmemdup for duplication of
memory.
Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
gb_audio_manager_module_descriptor's cport field is actually used to
manage and pass interface id to user space.
Thus rename gb_audio_manager_module_descriptor's 'cport' field and
few other things to avoid confusion.
Signed-off-by: Pankaj Bharadiya <pankaj.bharadiya@gmail.com>
Reviewed-by: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This if statement wasn't intended.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixes checkpatch.pl warning: do not add new typedefs in
ks_wlan_net.c
Signed-off-by: Sabitha George <sabitha.george@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixes checkpatch.pl warning: __aligned(size) is preferred over
__attribute__((aligned(size)) in ks7010_sdio.h
Signed-off-by: Sabitha George <sabitha.george@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove function comments that only restate the function name.
Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Replace CamelCase function names with underscores to comply with
the standard kernel coding style.
Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove return statement that is immediately followed by the function
closing bracket.
Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Simplify function returns by merging assignment and return into
one command line.
Delete unnecesarry return variable.
Found with Coccinelle
@@
expression e, ret;
@@
-ret =
+return
e;
-return ret
Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Simplify function returns by merging assignment and return into
one command line.
Found with Coccinelle
@@
expression e, ret;
@@
-ret =
+return
e;
-return ret;
Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Simplify function returns by merging assignment and return into
one command line.
Found with Coccinelle
@@
expression e, ret;
@@
-ret =
+return
e;
-return ret;
Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes the macros BBvClearFOE and BBvSetFOE. As they are not
used anywhere else.
Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the checkpatch issue by adding space around '<<'.
Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the checkpatch issue by adding space around the
operator '+'.
Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Block comments should align the * on each line as reported by checkpatch.pl
Signed-off-by: Mikhail Golubev <golubev.mikhail@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixes the following checkpatch output:
./pcbit/capi.c:39: WARNING: Use #include <linux/io.h> instead of <asm/io.h>
./pcbit/capi.c:40: WARNING: Use #include <linux/string.h> instead of <asm/string.h>
./pcbit/callbacks.c:25: WARNING: Use #include <linux/io.h> instead of <asm/io.h>
./pcbit/layer2.c:39: WARNING: Use #include <linux/io.h> instead of <asm/io.h>
./pcbit/drv.c:34: WARNING: Use #include <linux/string.h> instead of <asm/string.h>
./pcbit/drv.c:35: WARNING: Use #include <linux/io.h> instead of <asm/io.h>
./pcbit/edss1.c:26: WARNING: Use #include <linux/io.h> instead of <asm/io.h>
Signed-off-by: Alexander Alemayhu <alexander@alemayhu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Removed a checkpatch warning for braces on single argument if and else
statement.
Signed-off-by: Chase Metzger <chasemetzger15@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix checkpatch warning:
WARNING: Block comments use a trailing */ on a separate line
Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix checkpatch warning:
WARNING: Prefer kcalloc over kzalloc with multiply
kcalloc is designed to allocate memory for arrays, its use is
preferable than kzalloc in these cases.
Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Line goes too long when aligned with parenthesis, so moved to a new line
Signed-off-by: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix lines that go over 80 characters to stop warnings from checkpatch
Signed-off-by: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Move comments above long definitions so they don't go over 80 characters
Signed-off-by: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aligning with parenthesis causes lines to go too long, so the
parenthesis are on a new line
Signed-off-by: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change label to not use camel case per checkpatch
Signed-off-by: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add braces to all arms of if statement
Signed-off-by: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix checkpatch messages: Alignment should match open parenthesis
Signed-off-by: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix alignment to match open parenthesis
Signed-off-by: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add spaces around operator for readability
Signed-off-by: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix multiple assignments found by checkpatch
Signed-off-by: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix to match open parenthesis in order to satisfy checkpatch
Signed-off-by: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove parentheses found by checkpatch
Signed-off-by: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Adding space around operator for better readability and to stop
checkpatch check messages
Signed-off-by: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove parentheses found by checkpatch
Signed-off-by: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Replace all instances of (1 << x) with BIT(x) to satisfy checkpatch
check messages
Signed-off-by: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>