Aishwarya Pant [Fri, 10 Mar 2017 16:39:27 +0000 (22:09 +0530)]
staging: bcm2835-camera: remove anonymous field declarations
Anonymous field declarations are error prone. This patch replaces
anonymous declarations with explicit field declarations for typedef
SERVICE_CREATION_T in vchiq_mmal_init(..)
Aishwarya Pant [Fri, 10 Mar 2017 16:39:11 +0000 (22:09 +0530)]
staging: bcm2835-audio: remove anonymous field declarations
Anonymous field declarations are error prone. This patch replaces
anonymous declarations with explicit field declarations for typedef
SERVICE_CREATION_T in vc_vchi_audio_init(..)
Ian Abbott [Wed, 8 Mar 2017 18:44:32 +0000 (18:44 +0000)]
staging: comedi: jr3_pci: fix initial range[8] max value
`jr3_pci_alloc_spriv()` initializes `spriv->range[8]` to use a maximum
value of 65536, but that will be overwritten with 65535 at a later time
by `jr3_pci_poll_subdevice()` once the "set full scales" command is
complete. The initial setting looks like a mistake. This range is only
associated with a couple of dummy channels (channels 56 and 57) to read
back the model number and serial number, so no user code should be
attempting to convert those numbers to physical units. Just change the
initial value to 65535 to match the final value.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 8 Mar 2017 18:44:31 +0000 (18:44 +0000)]
staging: comedi: jr3_pci: check PCI BAR 0 size
The various supported boards have different numbers of subdevices from 1
to 4. Each subdevice needs a block of registers in PCI BAR 0. Check
the region is large enough for the required number of subdevices.
Return an error from `jr3_pci_auto_attach()` if it is too small.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 8 Mar 2017 18:44:30 +0000 (18:44 +0000)]
staging: comedi: jr3_pci: check sizes at compile time
The driver currently checks the size of `struct jr3_sensor` is correct
when a device is attached, returning an error if it is wrong. Replace
that with a compile-time check. We don't care too much about the size
of `struct jr3_sensor` as it is embedded in the larger `struct
jr3_block` and is followed by a lot of padding. We should care more
that the size of `struct jr3_block` is correct, as it describes the
overall register layout of a block, and there is an array of such blocks
(one per subdevice). Check its size at compile-time using the
`BUILD_BUG_ON()` macro.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 8 Mar 2017 18:44:29 +0000 (18:44 +0000)]
staging: comedi: jr3_pci: omit pointless debug info
`jr3_pci_open()` outputs several debug log messages containing serial
numbers of the sensors (one per subdevice) along with a pointer to the
subdevice private data structure. The latter is of no use, so reformat
the debug log to omit it.
`jr3_pci_alloc_spriv()` outputs a debug log message containing more
useless information about the remapped base address of the board
registers, the sensor registers, and the difference between them. Get
rid of it.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 8 Mar 2017 18:44:28 +0000 (18:44 +0000)]
staging: comedi: jr3_pci: use struct jr3_block instead of jr3_t
`struct jr3_t` contains a single array member `block` of member type
`struct jr3_block`. Rather than using pointers to `struct jr3_t`, just
use pointers to `struct jr3_block` instead and treat it as an array.
Replace the local variables `struct jr3_t __iomem *iobase` with `struct
jr3_block __iomem *block`. Remove the definition of `struct jr3_t` as
it is no longer needed.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 8 Mar 2017 18:44:27 +0000 (18:44 +0000)]
staging: comedi: jr3_pci: separate out block type
`struct jr3_t` contains a single array member `block` of a tag-less
`struct` type. Rename the tag-less `struct` type to `struct jr3_block`
and move its definition outside of `struct jr3_t`. This will allow us
to use pointers of this type.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 8 Mar 2017 18:44:26 +0000 (18:44 +0000)]
staging: comedi: jr3_pci: rename 'channel' to 'block'
The term "channel" is overloaded in this driver. Rename the `channel`
member of `struct jr3_t` to `block` to reduce confusion. `block` is an
array of an anonymous `struct` type, with each element covering the
registers for one subdevice.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 8 Mar 2017 18:44:25 +0000 (18:44 +0000)]
staging: comedi: jr3_pci: rename data to sensor
Rename the `channel[x].data` member of `struct jr3_t` to
`channel[x].sensor` to match its type `struct jr3_sensor`. Also rename
local variable `ch0data` in `jr3_pci_show_copyright()` to `sensor0` for
consistency. It points to the `struct jr3_sensor` embedded in the
registers for "channel" 0.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 8 Mar 2017 18:44:24 +0000 (18:44 +0000)]
staging: comedi: jr3_pci: rename channel to sensor
The driver overloads the term "channel" a lot. To help reduce
confusion, rename the `channel` member of `struct
jr3_pci_subdev_private` to `sensor` as it points to a `struct
jr3_sensor`. Also rename the various function parameters and local
variables called `channel` that point to a `struct jr3_sensor` to
`sensor`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Alan Cox [Fri, 10 Mar 2017 11:34:41 +0000 (11:34 +0000)]
atomisp: tidy firmware loading code a little
The FWNAME define is never used so can be removed. The option to skip firmware
loading isn't really Cherrytrail specific so remove this and complete the
merging of the two driver versions for this file.
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Alan Cox [Fri, 10 Mar 2017 11:34:27 +0000 (11:34 +0000)]
atomisp: eliminate intel_mid_pm.h
We can do this because the only thing it is used for is identifying the
platform for power management purposes. The driver only supports Baytrail
and Cherrytrail and both of those always need the IPU to be power managed
directly not via PCI D3 states.
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gargi Sharma [Sat, 11 Mar 2017 14:57:20 +0000 (20:27 +0530)]
staging: rtl8192e: Remove multiple assignments
This patch removes multiple assignments by factorizing them.
This was done with Coccinelle for the if branch. For the else part
the change was done manually. Braces were also added to the
else part to remove the checkpatch warning, "braces should be
on all arms of if-else statements".
TODO file contains task to verify and correct function return
sites. Need to check for and implement correct usage of goto's when
there is work to be done before returning.
Remove task from TODO list after already having completed audit of
directory drivers/staging/dgnc.
Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Zoran [Fri, 10 Mar 2017 07:41:10 +0000 (23:41 -0800)]
staging: vchi: Remove ARM64 from TODO list
ARM64 for core vchiq which is the core of vc04_services should
now be work complete. The driver compiles without any errors
or warnings, and works just as well as 32 bit mode. The
necessary compatibility wrappers for the 32 bit ioctls have been
written and merged.
Since no more ARM64 specific changes should be needed, perhaps
it's best to remove it from the TODO list.
Signed-off-by: Michael Zoran <mzoran@crowfest.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Zoran [Fri, 10 Mar 2017 05:08:59 +0000 (21:08 -0800)]
staging: bcm2835-camera: remove depends on ARM
Since all the arm64 specific issues have been fixed now
and the camera is working fine with a arm64 kernel, the
depends on ARM can be removed from Kconfig.
Signed-off-by: Michael Zoran <mzoran@crowfest.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Zoran [Fri, 10 Mar 2017 05:08:57 +0000 (21:08 -0800)]
staging: bcm2835-camera: Fix buffer overflow calculation on query of camera properties
The code that queries properties on the camera has a check
for buffer overruns if the firmware sends too much data. This
check is incorrect, and during testing I was seeing stack corruption.
I believe this error can actually happen in normal use, just for
some reason it doesn't appear on 32 bit as often. So perhaps
it's best for the check to be fixed.
Signed-off-by: Michael Zoran <mzoran@crowfest.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Zoran [Fri, 10 Mar 2017 05:08:56 +0000 (21:08 -0800)]
staging: bcm2835-camera: Convert spinlock to mutex in handle mapping code
The handle mapping code that converts context pointers to handles uses
a spinlock. Since the btree implementation can sleep while allocating
memory, turning on several kernel debugging options will result in
errors in the log.
Since this code path is never called in atomic context, perhaps it's
better to just use a mutex.
Signed-off-by: Michael Zoran <mzoran@crowfest.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Zoran [Fri, 10 Mar 2017 05:08:53 +0000 (21:08 -0800)]
staging: bcm2835-camera: Convert client_context field to a 32 bit handle
The client_context field is passed around which is really just a pointer
to a msg_context. A lookup table mechanism for msg_context was added
previously, so convert this field to a handle as well.
The firmware never interperates the client_context, just passed it back.
Signed-off-by: Michael Zoran <mzoran@crowfest.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Arushi Singhal [Thu, 9 Mar 2017 16:13:46 +0000 (21:43 +0530)]
staging: ks7010: removed code in comments.
Commenting Code Is a Bad Idea.
Comments are their to explain the code and how the code achieves its
goal and as codes in the comments does not explain what the code is
doing so there is no use of commenting them.
So in this patch codes in the comments are removed.
Varsha Rao [Thu, 9 Mar 2017 14:19:01 +0000 (19:49 +0530)]
staging: comedi: Remove useless cast.
Variable dac_data is already declared as of type u8. Again explicit type
casting of dac_data to u8, is not required. Hence this patch removes it
by using the following coccinelle script.
@@
type T;
T *ptr;
T p;
@@
(
- (T *)(&p)
+ &p
|
- (T *)ptr
+ ptr
|
- (T *)(ptr)
+ ptr
|
- (T)(p)
+ p
)
Gargi Sharma [Wed, 8 Mar 2017 17:06:22 +0000 (22:36 +0530)]
staging: vc04_services: Use ARRAY_SIZE macro
Use ARRAY_SIZE to calculate the size of an array.
The semantic patch used can be found here:
https://github.com/coccinelle/coccinellery/blob/master/arraysize/array.cocci
Aapo Vienamo [Tue, 7 Mar 2017 11:52:47 +0000 (13:52 +0200)]
staging: wlan-ng: add byte order annotation to struct p80211_caphdr
Fixes the following sparse warnings around line 3514 in hfa384x_usb.c:
warning: incorrect type in assignment (different base types)
expected unsigned int [unsigned] [usertype] version
got restricted __be32 [usertype] <noident>
simran singhal [Sat, 4 Mar 2017 15:30:52 +0000 (21:00 +0530)]
staging: rts5208: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T*)x)->f
|
- (T*)
e
)
Gargi Sharma [Tue, 7 Mar 2017 18:20:27 +0000 (23:50 +0530)]
staging: gdm724x: Replace ternary operator with min macro
Use macro min() to get the minimum of two values for
brevity and readability. The macro MUX_TX_MAX_SIZE
has a value of 2048 which is well within the integer
limits. This check was done manually.
Found using Coccinelle:
@@ type T; T x; T y; @@
(
- x < y ? x : y
+ min(x,y)
|
- x > y ? x : y
+ max(x,y)
)
Gargi Sharma [Wed, 8 Mar 2017 18:45:49 +0000 (00:15 +0530)]
staging: rtl8192e: Remove useless type conversion
Some type conversions like casting a pointer/non-pointer to a pointer of same type,
casting to the original type using addressof(&) operator, etc. are not needed.
Therefore, remove them. Done using coccinelle:
@@
type t;
t *p;
t a;
@@
(
- (t)(a)
+ a
|
- (t *)(p)
+ p
|
- (t *)(&a)
+ &a
)
Changed the structure tag 'struct cxd' with the variable '*ci' to fix the
following checkpath.pl issue: CHECK: Prefer kzalloc(sizeof(*ci)...) over
kzalloc(sizeof(struct cxd)).
simran singhal [Sat, 4 Mar 2017 15:30:51 +0000 (21:00 +0530)]
staging: lustre: lustre: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T*)x)->f
|
- (T*)
e
)
Signed-off-by: simran singhal <singhalsimran0@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
simran singhal [Sat, 4 Mar 2017 15:30:50 +0000 (21:00 +0530)]
staging: lustre: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T*)x)->f
|
- (T*)
e
)
Signed-off-by: simran singhal <singhalsimran0@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
simran singhal [Sat, 4 Mar 2017 15:30:53 +0000 (21:00 +0530)]
staging: rtl8712: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T*)x)->f
|
- (T*)
e
)
Heiner Kallweit [Thu, 2 Mar 2017 20:03:44 +0000 (21:03 +0100)]
staging: fbtft: fb_sh1106: use own implementation of write_register
The default implementation of write_register keeps DC low for the first
byte only. SH1106 requires DC to be low for all bytes of a multi-byte
command. To deal with this limitation we currently use a separate call
to write_reg for each single command byte what is not really efficient.
Therefore override the default implementation of write_register with an
own one which keeps DC low for all bytes.
Heiner Kallweit [Thu, 2 Mar 2017 19:48:53 +0000 (20:48 +0100)]
staging: fbtft: improve a syslog message in fbtft_register_framebuffer
There are drivers like fb_sh1106 which allocate a txbuf less than 1 KiB.
In this case the message would include "0 KiB buffer memory" what
doesn't make sense and in general I doubt that there is any benefit in
informing the user about allocation of a very small buffer.
Therefore omit this message part if the buffer has less than 1 KiB.
Samuel Thibault [Sat, 4 Mar 2017 14:01:57 +0000 (15:01 +0100)]
speakup: add unicode variant of /dev/softsynth
This adds /dev/softsynthu, along /dev/softsynth, which emits output in
UTF-8 encoding, thus allowing to support 16bit characters. Most of the
code is shared, only the read function has to behave differently in
latin1 and in unicode mode. Since Linux only supports 16bit characters,
we can just hardcode the UTF-8 encoding.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Chris Brannon <chris@the-brannons.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Samuel Thibault [Sat, 4 Mar 2017 14:01:56 +0000 (15:01 +0100)]
speakup: convert screen reading to 16bit characters
This adds 16bit character support to most of the screen reading by
extending characters to u16 throughout the code.
Non-latin1 characters are assumed to be alphabetic type for now.
non-latin1 vt_notifier_call-provided characters are not ignored any
more, and the 16bit character returned by get_char is not truncated any
more. For simplicity, speak_char still only supports latin1 characters.
Its direct mode however does support 16bit characters, so in practice
this will not be a limitation, non-latin1 languages will be handled by
the synthesizer. spelling words does not support direct mode yet, for
simplicity for now it will ignore 16bit characters.
For simplicity again, speakup messages are left in latin1 for now.
Samuel Thibault [Sat, 4 Mar 2017 14:01:55 +0000 (15:01 +0100)]
speakup: extend synth buffer to 16bit unicode characters
This extends the synth buffer slots to 16bit, so as to hold 16bit
unicode characters.
synth_buffer_getc and synth_buffer_peek now return 16bit characters.
Speech synthesizers which do not support characters beyond latin1 can
use the synth_buffer_skip_nonlatin1() helper to skip the non-latin1
characters before getting or peeking. All synthesizers are made to use
it for now.
This makes synth_buffer_add take a 16bit character. For simplicity for
now, synth_printf is left to using latin1 formats and strings.
synth_putwc, synth_putwc_s, synth_putws and synth_putws_s helpers are
however added to put 16bit characters and strings.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Chris Brannon <chris@the-brannons.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Varsha Rao [Wed, 8 Mar 2017 04:12:46 +0000 (09:42 +0530)]
staging: wilc1000: Remove useless cast.
Variable ip_addr is already declared as pointer to u8. Again explicit type
casting of ip_addr to u8, is not required. Hence this patch removes it
by using the following coccinelle script.
@@
type T;
T *ptr,p;
@@
(
- (T *)(&p)
+ &p
|
- (T *)ptr
+ ptr
|
- (T *)(ptr)
+ ptr
|
- (T)(p)
+ p
)
Tahia Khan [Wed, 8 Mar 2017 23:21:38 +0000 (18:21 -0500)]
staging: wilc1000: removes redundant 'continue' in while loop conditional blocks
Removing 6 continue statements from a while loop. The
continue statements are redundant here since control
already returns to the beginning of the loop upon exit
of any of the conditional blocks. Found using Coccinelle.