Change to unsigned to allow removal of negative value check in
init section. Use smaller data type since the max possible
value currently is 48.
Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Checkpatch emits WARNING: Comparisons should place the constant on the
right side of the test.
Move comparison constant to the right side of the test.
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Checkpatch emits various warnings/errors pointing to misplaced
spaces.
- trailing whitespace
- please, no spaces at the start of a line
- please, no space before tabs
- Unnecessary space before function pointer arguments
- unnecessary whitespace before a quoted newline
- code indent should use tabs where possible
Remove all undesirable whitespace.
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Split lines to have less than 80 characters.
Fix the checkpatch.pl warning:
WARNING: line over 80 characters.
Signed-off-by: Tamara Diaconita <diaconita.tamara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Unnecessary parentheses are removed as reported by checkpatch.pl
to make coder nicer and to improve readability.
Also coding style is improved as it's often nicer to read if
&(foo[0]) is converted to foo like:
memcpy(&(ap->bssid[0]), &(ap_info->bssid[0]), ETH_ALEN);
memcpy(ap->bssid, ap_info->bssid, ETH_ALEN);
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Lowmemory killer is sitting in the staging tree since 2008 without any
serious interest for fixing issues brought up by the MM folks. The main
objection is that the implementation is basically broken by design:
- it hooks into slab shrinker API which is not suitable for this
purpose. lowmem_count implementation just shows this nicely.
There is no scaling based on the memory pressure and no
feedback to the generic shrinker infrastructure.
Moreover lowmem_scan is called way too often for the heavy
work it performs.
- it is not reclaim context aware - no NUMA and/or memcg
awareness.
As the code stands right now it just adds a maintenance overhead when
core MM changes have to update lowmemorykiller.c as well. It also seems
that the alternative LMK implementation will be solely in the userspace
so this code has no perspective it seems. The staging tree is supposed
to be for a code which needs to be put in shape before it can be merged
which is not the case here obviously.
Signed-off-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
vc04_services has an ioctl interface to dump arbitrary memory
to a custom debug log. This is typically only needed by
diagnostic tools, and can potentially be a security issue
if the devtmpfs node doesn't have adequate permissions set.
Since the ability to dump memory still has debugging value,
create a new build configuration and disable the feature
by default.
Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch adds compatibility wrappers for the ioctls
exposed by vchiq/vc04_services. The compat ioctls are
completely implemented on top of the native ioctls. No
existing lines are modified.
While the ideal approach would be to cleanup the existing
code, this path is simplier and easier to review. While
it does have a small runtime performance penality vs
seperating the existing code into wrapper+worker functions,
the penality is small since only the metadata is copied
back onto the 32 bit user mode stack.
The on top of approach is the approach used by several
existing performance critical subsystems of Linux such
as the DRM 3D graphics subsystem.
Testing:
1. A 32 bit chroot was created on a RPI 3 and vchiq_test
was built for armhf. The usual tests were run such as
vchiq_test -f 10 and vchiq_test -p.
2. This patch was copied onto the shipping version of
the Linux kernel used for the RPI and that kernel was
built for arm64. That kernel was used to boot Raspbian.
Many of the builtin features are now functional such
as the "hello_pi" examples, and minecraft_pi.
Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The camera driver passes messages back and forth between the firmware with
requests and replies. One of the fields of the message header called
context is a pointer so the size changes between 32 bit and 64 bit.
The context field is used to pair reply messages from the firmware with
request messages from the kernel. The simple solution would be
to use the padding field for the upper 32 bits of pointers, but this
would rely on the firmware always copying the pad field.
So instead handles are generated that are 32 bit numbers and a mapping
stored in a btree as implemented by the btree library in the kernel lib
directory. The mapping pairs the handle with the pointer to the actual
data. The btree library was chosen since it's very easy to use and
red black trees would be overkill.
The camera driver also now forces in the btree library if the camera is
included in the build. The btree library is a hidden configuration
option.
Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The camera driver passes messages back and forth between the firmware with
requests and replies. One of the fields of the message header called
control_service is a pointer so the size changes between 32 bit and 64 bit.
Luckly, the field is not interperated by the driver, so it can be changed
to a u32 which has a fixed size.
Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This cuts it back to what is basically a few wrapper functions. At some point
we can kill most of these too by changing the callers.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the content that is guarded by this define
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Once we are a bit more sure of their obsolescence they will be deleted
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The camera code has an explicit cache flush operation
which is not portable. Now that vc04_services is using portable
DMA APIs that already do the cache flushing, explicit flushes
should no longer be needed.
The one call to __cpuc_flush_dcache_area has been removed.
Testing:
The offical V2 camera for the RPI was tested on a RPI 3
running in 32 bit mode(armhf). The cheese application
and ffmpeg was used to view and stream video from the
camera. Nothing new seems to be broken without the
cache flushing.
Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sparse generates two warnings related to incorrect type in assignment.
This patch changes the types in the struct defined in unisys
Signed-off-by: Andrea Ghittino <aghittino@gmail.com>
Acked-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch replace "the the " with "the". The replacement couldn't be
automated because sometimes the first "the" was meant to be another
word.
Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch replace "the the " with "the". The replacement couldn't be
automated because sometimes the first "the" was meant to be another
word.
Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch replace "the the " with "the". The replacement couldn't be
automated because sometimes the first "the" was meant to be another
word.
Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Acked-by: David Kershner <david.kershner@unisys.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Use macro min_t to get the minimum of two values for readability.
Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch replace "is is " with "is". The replacement couldn't be
automated because sometimes the first "is" was meant to be another
word.
Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch replace "is is " with "is". The replacement couldn't be
automated because sometimes the first "is" was meant to be another
word.
Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The structures and the macros in the header file are not used
anywhere inside the kernel (verified by using grep). The structures
and macros were leftover from the patch
341f1f0aff "staging: lustre: remove
remote client support". Also, removed the include statements for
lustre_eacl.h.
Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The structure is used as an argument to module_param macro. This
macro calls a bunch of other macros and finally assigns the instance
of the kernel_param_ops structure to the const struct
kernel_param_ops* field of a variable of type kernel_param. Hence,
const can be added to the structure.
Coccinelle Script:
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct kernel_param_ops i@p = { ... };
@ok1@
identifier r.i;
expression e;
position p;
@@
e = i@p
@script:python s@
i << r.i;
t;
@@
coccinelle.t = i[10:];
@ok2@
declarer name module_param;
expression e1,e2;
position p;
@@
module_param(e1,s.t@p,e2);
@bad@
position p != {r.p,ok1.p,ok2.p};
identifier r.i;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct kernel_param_ops i = { ... };
Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Using LINUXINCLUDE is a very old hack, and doesn't play well with
building objects in a different directory than the kernel source is in.
So fix up the include file references to be relative to make it obvious
we are pulling in local include files, which need to get fixed up.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch replace "is is " with "is". The replacement couldn't be
automated because sometimes the first "is" was meant to be another
word.
Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
udelay is impelmented using a busy-wait loop and consumes CPU cycles
while usleep_range is implemented using interrupts.cls_flush_uart_write()
is called after a channel lock is acquired i.e. an atomic context.
Hence delay in this method should use udelay instead of usleep_range.
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The ktermios structure is a local default termios struct. All ports
are initially created with this termios. Since, the structure is
never modified, it can be declared as const.
Coccinelle Script:
@r disable optional_qualifier@
identifier s,i;
position p;
@@
static struct ktermios i@p = { ... };
@ok1@
identifier r.i;
expression e;
position p;
@@
e = i@p
@bad@
position p != {r.p,ok1.p};
identifier r.i;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct ktermios i = { ... };
File Size before:
text data bss dec hex filename
25469 2048 256 27773 6c7d drivers/staging/dgnc/dgnc_tty.o
File Size after:
text data bss dec hex filename
25636 2016 256 27908 6d04 drivers/staging/dgnc/dgnc_tty.o
Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the checkpatch issue:
CHECK: Logical continuations should be on the previous line.
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
function prototype argument should have an identifier name as reported
by checkpatch.pl.
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
use min_t() macro in place of min() to replace the two typecasts of min.
Change suggested by checkpatch script.
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix the following checkpatch warning issued on bcm2835-vchiq.c:
CHECK: Alignment should match open parenthesis
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add braces on all arms of the if-else statements in bcm2835-vchiq.c to
comply with kernel coding style.
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove instances of unnecessary blank space after cast in bcm2835-vchiq.c
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Use dev_err(... in place of printk(KERN_ERR ...
Problem found by checkpatch
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix the warning: Blank lines aren't necessary after an open brace
'{' issued by checkpatch on bcm2835-ctl.c
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix block comment formatting to suppress the following warning thrown by
checkpatch: Block comments use a trailing */ on a separate line
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Keep logical continuations on the same line to improve code readability
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove instances of unnecessary blank space after cast in bcm2835-ctl.c
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change the camera's dependency on BCM2835_VCHIQ to a select
since camera support is typically more important to people
then base VCHIQ(which they may not even know what it's for).
Also, with a dependency the camera support would not be
visiable until VCHIQ is selected first, and that may
not be what most people would expect.
Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change the audio's dependency on BCM2835_VCHIQ to a select
since audio support is typically more important to people
then base VCHIQ(which they may not even know what it's for).
Also, with a dependency the audio support would not be
visiable until VCHIQ is selected first, and that may
not be what most people would expect.
Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>