Commit graph

31 commits

Author SHA1 Message Date
Bo YU cd3d9ecebf Staging: bcm2835-audio: fixed a code style issue:
Missing a blank line after declarations

Signed-off-by: Bo YU <tsu.yubo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-16 10:20:07 -08:00
Dan Carpenter f5e2199ae5 staging: bcm2835-audio: allocate enough data for work queues
We accidentally allocate sizeof(void *) bytes instead of 112 bytes.  It
results in memory corruption.

Fixes: 23b028c871 ("staging: bcm2835-audio: initial staging submission")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-16 10:19:45 -08:00
Dan Carpenter 021fbaa5fb Staging: bcm2835-audio: && vs & typo
We intended to mask away the upper bits but there is a "&&" vs "&" typo
so it's broken.

Fixes: 23b028c871 ("staging: bcm2835-audio: initial staging submission")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-16 10:19:44 -08:00
Hendrik v. Raven ebd6228609 staging: bcm2835-audio: remove unused macro
The VC_AUDIO_MAX_MSG_LEN macro is not used by anything in the
bcm2835-audio driver.

Signed-off-by: Hendrik v. Raven <hendrik@consetetur.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-14 09:14:29 -08:00
Abhijit Naik 65ab7c2410 staging: bcm2835-audio: Fixed checkpatch warning due to line spacing
bcm2835-vchiq.c:
fixing ERROR: Checkpatch warnings due to extra blank lines or absence of blank
lines where needed.

Signed-off-by: Abhijit Naik <abhijitnaik27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-14 09:14:29 -08:00
AbdAllah-MEZITI d54b1bdaa3 staging: bcm2835-audio: fix trailing statements
Trailing statements should be on next line.

Signed-off-by: AbdAllah-MEZITI <abdallah.meziti.pro@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:22:08 +01:00
Simon Sandström 9d3352a3fe staging: bcm2835-audio: Make internal symbols static
Fixes sparse warnings:
warning: symbol 'xxx' was not declared. Should it be static?

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-10 15:06:45 +01:00
Abhijit Naik 626eea7df9 staging: bcm2835-audio: Fixed initialization of global to "false"
bcm2835-vchiq.c:
fixing ERROR: do not initialise globals to false

Instead of explicitly initializing global variable force_bulk to "false",
declared force_bulk as static variable.

Signed-off-by: Abhijit Naik <abhijitnaik27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-10 15:06:44 +01:00
Dan Carpenter c3103a3617 Staging: bcm2835-audio: remove unneeded NULL check
We just dereferenced "instance" on the line before so checking it here
is pointless.  Anyway, it can't be NULL here so let's remove the check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:16:45 +01:00
Dan Carpenter 0afad91356 Staging: bcm2835-audio: fix an uninitialized return value
"ret" isn't necessarily initialized on the success path.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:16:45 +01:00
Dan Carpenter 84472ecd70 staging: bcm2835-audio: off by one in snd_bcm2835_playback_open_generic()
The > should be >= otherwise we write beyond the end of the array when
we do:

	chip->alsa_stream[idx] = alsa_stream;

Fixes: 23b028c871 ("staging: bcm2835-audio: initial staging submission")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:16:45 +01:00
Victor Vaschenko 1605cda06b Staging: bcm2835-audio: Fixed that open brace should be on previous line error in bcm2835-ctl.c
Fixed ERROR: that open brace { should be on the previous line.
One coding style correction for better readable code.

Signed-off-by: Victor Vaschenko <vicmos89@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:16:09 +01:00
Simon Sandström b715b51e18 staging: bcm2835-audio: Remove unnecessary space after cast
Fixes checkpatch check "No space is necessary after a cast".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:14:30 +01:00
Simon Sandström ab601be466 staging: bcm2835-audio: Rewrite comparison to NULL
Fixes checkpatch check "Comparison to NULL could be written '!chip'".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:14:30 +01:00
Simon Sandström 2b48e88571 staging: bcm2835-audio: Fix argument indentation
Fixes checkpatch CHECK: "Alignment should match open parenthesis".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:14:30 +01:00
Simon Sandström be36cefeca staging: bcm2835-audio: Simplify bcm2835_alsa_device_init()
Fixes checkpatch warning "Missing a blank line after declarations".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:14:30 +01:00
Simon Sandström 99f36b1810 staging: bcm2835-audio: Move open brace to correct line
Fixes checkpatch error "open brace { should be on the previous line".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:14:30 +01:00
Simon Sandström ab7cfdbb74 staging: bcm2835-audio: Remove whitespace before quoted newline
Fixes checkpatch warning "unnecessary whitespace before a quoted
newline".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:14:30 +01:00
Simon Sandström 0042755fed staging: bcm2835-audio: Remove incorrect whitespace
According to the coding style, "bcm2835_ship ** rchip" should be
"bcm2835 **rchip".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:14:30 +01:00
Simon Sandström 69c429864e staging: bcm2835-audio: Remove static initialisation
Static pointers are explicility initialised to NULL.

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:14:30 +01:00
Michael Rupprecht 75ce077cc0 Staging: bcm2835-audio: removed spaces around parenthesis
Removed unnecessary spaces around parenthesis as reported by checkpatch.pl

Signed-off-by: Michael Rupprecht <mail.michaelrupprecht@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-05 11:41:39 +01:00
Seraphime Kirkovski 0f06feba91 staging: bcm2835: cleanup: remove deprecated <asm/uaccess.h> include
This replaces the last occurrence of the deprecated <asm/uaccess.h> include
in the staging directory with the newer <linux/uaccess.h>

Signed-off-by: Seraphime Kirkovski <kirkseraph@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03 13:01:39 +01:00
Miquel Raynal a8e39c57c1 staging: bcm2835-audio: fix style problem in vc_vchi_audioserv_defs.h
Remove spaces around parenthesized expression to conform to the
kernel coding style. Issue found by checkpatch.pl script.

Signed-off-by: Miquel Raynal <raynal.miquel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:05:06 +01:00
Colin Ian King 7dd551e20e staging: bcm2835-audio: use | instead of || otherwise result is just boolean 1
The incorrect or operator is being used resulting in cookies being
set to 1 (true) rather than the intended hex value.  Fix this by
using | instead of ||.

Issue found with static analysis with cppcheck

Fixes: 0cec463e39 ("staging: bcm2835-audio: Simplify callback structure for write data")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:05:06 +01:00
Arnd Bergmann b07525b89f staging: bcm2835-audio: fix empty-body warning
gcc-7 warns about debug statements being left out here:

drivers/staging/bcm2835-audio/bcm2835-vchiq.c: In function 'bcm2835_audio_set_ctls':
drivers/staging/bcm2835-audio/bcm2835-vchiq.c:572:54: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]

It's better to use no_printk(), which has the added advantage of checking
the format strings.

Fixes: 23b028c871 ("staging: bcm2835-audio: initial staging submission")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:01:32 +01:00
Arnd Bergmann fe822dc6c1 staging: bcm2835-audio: remove incorrect include path
The driver introduces a new instance of the missing-include-dirs warning that
is enabled at the "make W=1" level but has no other output:

cc1: error: /git/arm-soc/drivers/staging/vc04_services/interface/vcos/linuxkernel: No such file or directory [-Werror=missing-include-dirs]

In order to let us enable the warning by default in the future, we should
just remove the incorrect argument here.

Fixes: 23b028c871 ("staging: bcm2835-audio: initial staging submission")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:01:32 +01:00
Michael Zoran c07acb97fd staging: bcm2835-audio: Replace call to vchi_msg_queue with vchi_queue_kernel_message
The function vchi_msg_queue was made static in vc04_services
and replaced with vchi_queue_kernel_message.

Change the call to vchi_msg_queue to vchi_queue_kernel_message

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-02 13:01:31 +01:00
Michael Zoran 0cec463e39 staging: bcm2835-audio: Simplify callback structure for write data
The device sends data to the audio devices by sending a message with
the data through VC04_SERVICES/VCHIQ.  This message contains a
callback pointer that is always filled in with the same function.
This is prone to corruption issues.

Instead fill the callback fields with a fixed cookie value to perforam
some validation on the message response and call the handler function
directly instead of through the callback pointer.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-31 10:47:00 +01:00
Michael Zoran 9c4f728693 staging: bcm2835-audio: Remove code for non device tree init
The bcm2835-audio driver has a legacy code path for initializing
devices without a device tree.  Delete this code path and remove
the non device tree devices.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-31 10:47:00 +01:00
Michael Zoran 6c07499d63 staging: bcm2835-audio: Add TODO list
Add a TODO list of possible cleanup items.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-31 10:47:00 +01:00
Michael Zoran 23b028c871 staging: bcm2835-audio: initial staging submission
Initial cleanup of bcm2835-audio driver for the
bcm2535(Raspberry PI)

Driver provides HDMI audio through ALSA and is built
on top of the vc04_services driver.

Original version of the driver is available at:
http://www.github.com/raspberry/linux

Driver compiles without any build errors or warnings.

Tested on a RPI 3 running in ARM64 mode with the
vlc player and alsautils.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-27 09:44:31 +01:00