Fix 2 checkpatch errors:
-Block comments use * on subsequent lines,
-Block comments use a trailing */ on a separate line
to conform to block commenting style.
Signed-off-by: Elizabeth Ferdman <gnudevliz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: greybus: light: check the correct value of delay_on
When checking the value of delay_on to set the channel as active, it was
checked the pointer and not the value, as it should be.
Fixes: cc43368a3c ("greybus: lights: Control runtime pm suspend/resume on AP side") Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: greybus: light: check delay_{on|off} before use
Even though we trust leds core that the pointers should be valid, we are
safer to check delay_{on|off} before use.
Also, this avoid a smatch warning:
drivers/staging/greybus/light.c:484 gb_blink_set()
warn: variable dereferenced before check 'delay_on' (see line 476)
Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: popcornmix <popcornmix@gmail.com>
vchiq: create_pagelist copes with vmalloc memory
Signed-off-by: Daniel Stone <daniels@collabora.com>
vchiq: fix the shim message release
Signed-off-by: Daniel Stone <daniels@collabora.com>
vchiq: export additional symbols
Signed-off-by: Daniel Stone <daniels@collabora.com>
VCHIQ: Make service closure fully synchronous (drv)
This is one half of a two-part patch, the other half of which is to
the vchiq_lib user library. With these patches, calls to
vchiq_close_service and vchiq_remove_service won't return until any
associated callbacks have been delivered to the callback thread.
VCHIQ: Add per-service tracing
The new service option VCHIQ_SERVICE_OPTION_TRACE is a boolean that
toggles tracing for the specified service.
This commit also introduces vchi_service_set_option and the associated
option VCHI_SERVICE_OPTION_TRACE.
vchiq: Make the synchronous-CLOSE logic more tolerant
vchiq: Move logging control into debugfs
vchiq: Take care of a corner case tickled by VCSM
Closing a connection that isn't fully open requires care, since one
side does not know the other side's port number. Code was present to
handle the case where a CLOSE is sent immediately after an OPEN, i.e.
before the OPENACK has been received, but this was incorrectly being
used when an OPEN from a client using port 0 was rejected.
(In the observed failure, the host was attempting to use the VCSM
service, which isn't present in the 'cutdown' firmware. The failure
was intermittent because sometimes the keepalive service would
grab port 0.)
This case can be distinguished because the client's remoteport will
still be VCHIQ_PORT_FREE, and the srvstate will be OPENING. Either
condition is sufficient to differentiate it from the special case
described above.
vchiq: Avoid high load when blocked and unkillable
vchiq: Include SIGSTOP and SIGCONT in list of signals not-masked by vchiq to allow gdb to work
vchiq_arm: Complete support for SYNCHRONOUS mode
vchiq: Remove inline from suspend/resume
vchiq: Allocation does not need to be atomic
vchiq: Fix wrong condition check
The log level is checked from within the log call. Remove the check in the call.
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
BCM270x: Add vchiq device to platform file and Device Tree
Prepare to turn the vchiq module into a driver.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
bcm2708: vchiq: Add Device Tree support
Turn vchiq into a driver and stop hardcoding resources.
Use devm_* functions in probe path to simplify cleanup.
A global variable is used to hold the register address. This is done
to keep this patch as small as possible.
Also make available on ARCH_BCM2835.
Based on work by Lubomir Rintel.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
vchiq: Change logging level for inbound data
vchiq_arm: Two cacheing fixes
1) Make fragment size vary with cache line size
Without this patch, non-cache-line-aligned transfers may corrupt
(or be corrupted by) adjacent data structures.
Both ARM and VC need to be updated to enable this feature. This is
ensured by having the loader apply a new DT parameter -
cache-line-size. The existence of this parameter guarantees that the
kernel is capable, and the parameter will only be modified from the
safe default if the loader is capable.
2) Flush/invalidate vmalloc'd memory, and invalidate after reads
vchiq: fix NULL pointer dereference when closing driver
The following code run as root will cause a null pointer dereference oops:
int fd = open("/dev/vc-cma", O_RDONLY);
if (fd < 0)
err(1, "open failed");
(void)close(fd);
..the fix is to ensure that we have actually initialized the queue before we attempt
to push any items onto it. This occurs if we do an open() followed by a close() without
any activity in between.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
vchiq_arm: Sort out the vmalloc case
Zach Brown [Tue, 27 Sep 2016 21:51:49 +0000 (16:51 -0500)]
staging: rtl8712: Change _LED_STATE enum in rtl871x driver to avoid conflicts with LED namespace
Adding led support for phy causes namespace conflicts for some
phy drivers.
The rtl871 driver declared an enum for representing LED states. The enum
contains constant LED_OFF which conflicted with declaration found in
linux/leds.h. LED_OFF changed to LED_STATE_OFF
In order to avoid a possible future collision LED_ON was changed to
LED_STATE_ON as well.
Signed-off-by: Zach Brown <zach.brown@ni.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tim Sell [Tue, 27 Sep 2016 18:42:22 +0000 (14:42 -0400)]
staging: unisys: visorbus: fix vbus info generated for s-Par livedumps
Previously, the lines describing devices controlled by the visorinput,
visornic, and visorhba drivers (keyboard, mouse, ultravnic, sparvhba) would
be missing from the vbus channel header. This is important info that is
collected as part of s-Par livedumps, and can be examined via
/sys/bus/visorbus/devices/visorbus<n>/client_bus_info, e.g.:
Tim Sell [Tue, 27 Sep 2016 18:42:21 +0000 (14:42 -0400)]
staging: unisys: visorbus: fix sloppy unsigned/signed int conversions
Several implicit unsigned --> signed int conversions were corrected.
No runtime effects were observed here, nevertheless implicit conversions
between integral types can lead to unexpected behavior.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Matthew Kilgore [Wed, 28 Sep 2016 03:07:54 +0000 (23:07 -0400)]
Fixes: 3d44a78f0d8b ("staging: rtl8712: Remove unnecessary 'else'")
An "unnecessary" 'else' was removed due to complains from checkpatch.pl
as it is preceded by a 'return', however the 'else' branch is necessary
as an earlier branch of the 'if' falls through. By removing the 'else',
that route now hits the 'break' and the 'while' loop exits prematurely.
This commit reverts that change and puts the original 'else' back in
place.
Signed-off-by: Matthew Kilgore <mattkilgore12@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CHECK: Alignment should match open parenthesis
+ pr_info("%s: id %d type %d name %s align %lx\n", __func__,
+ heap->id, heap->type, heap->name, heap->align);
CHECK: Alignment should match open parenthesis
+struct ion_platform_data *ion_parse_dt(struct platform_device *pdev,
+ struct ion_of_heap *compatible)
CHECK: Alignment should match open parenthesis
+ heaps = devm_kzalloc(&pdev->dev,
+ sizeof(struct ion_platform_heap)*num_heaps,
CHECK: Alignment should match open parenthesis
+ data = devm_kzalloc(&pdev->dev, sizeof(struct ion_platform_data),
+ GFP_KERNEL);
CHECK: Alignment should match open parenthesis
+ heap_pdev = of_platform_device_create(node, heaps[i].name,
+ &pdev->dev);
CHECK: Alignment should match open parenthesis
+ pr_debug("%s: heap %s base %pa size %pa dev %p\n", __func__,
+ heap->name, &rmem->base, &rmem->size, dev);
CHECK: Alignment should match open parenthesis
+static void rmem_ion_device_release(struct reserved_mem *rmem,
+ struct device *dev)
It was used to get a board structure with dgnc_BoardsByMajor array.
But this driver already has the array for managing initialized board
as dgap_board[]. It can be used for searching the board structure
by major number.
The dgnc_major_serial_registered and dgnc_major_serial_registered
do not need to use to check whether the tty driver is registered or not.
These variables are used only in dgnc_cleanup_tty() function,
This function will be called normally with initialized board structure.
It means the dgnc_cleanup_tty() cannot be called with unregistered tty.
staging: dgnc: kfree for board structure in dgnc_found_board()
The board structure should be freed when any function was failed
in dgnc_found_board(). And the board strucure will be stored
into dgnc_board array when the dgnc_found_board() function has no error.
staging: dgnc: missing NULL check for ioremap in dgnc_do_remap()
The ioremap() function can be failed, so it need to have error
handling in dgnc_do_remap(). And also the return type of
dgnc_do_remap() should be changed from "void" to "int"
staging: dgnc: remove redundant initialization for channel array
The channel array in board_t was initialized in dgnc_found_board()
with NULL. But the channel is going to initialize in dgnc_tty_init().
So the channel array doesn't need to set NULL for initailization.
Check for v4l2_file_operations structures that are only stored in the
fops field of video_device structures. As this field is constant, so
v4l2_file_operations structures having this property can also be
declared constant.
Done using coccinelle:
Check for snd_pcm_ops structures that are only passed as the third
argument to the function snd_pcm_set_ops. As this argument is
constant, so snd_pcm_ops structures having this property can also be
made constant.
Done using coccinelle:
David Binder [Mon, 26 Sep 2016 15:03:49 +0000 (11:03 -0400)]
staging: unisys: visorbus: Convert visorchannel_signalinsert() return val
Per Documentation/CodingStyle, function names that convey an action or an
imperative command should return an integer. This commit converts the
visorbus API function, visorchannel_signalinsert(), to returning integer
values. All uses of this function are updated accordingly.
Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Binder [Mon, 26 Sep 2016 15:03:48 +0000 (11:03 -0400)]
staging: unisys: visorbus: Convert visorchannel_signalremove() return val
Per Documentation/CodingStyle, function names that convey an action or an
imperative command should return an integer. This commit converts the
visorbus API function, visorchannel_signalremove(), to returning integer
values. All uses of this function are updated accordingly.
Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Binder [Mon, 26 Sep 2016 15:03:47 +0000 (11:03 -0400)]
staging: unisys: visorbus: Change support functions to integer return vals
Per Documentation/CodingStyle, function names that convey an action or an
imperative command should return an integer value. This commit changes
several functions and a macro, internal to visorchannel.c, to follow this
paradigm. These changes will be necessary later on to change other
functions in this file, which are part of the visorbus API, to return
integer values in lieu of a boolean.
Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jon Frisch [Mon, 26 Sep 2016 15:03:41 +0000 (11:03 -0400)]
staging: unisys: remove driver version from struct visor_driver
This patch removes the all instances of the driver version from
struct visor_driver. This includes removing version, vertag
(a human readable version string of the driver version) and
version_attr from struct visor_driver. This resulted in removing the
bus attributes and driver attributes which only contained the driver
version. The utsname function is used to replace the driver version
with the kernel version in bus_device_info_init().
Signed-off-by: Jon Frisch <jon.frisch@unisys.com> Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Matt Kilgore [Tue, 27 Sep 2016 06:05:44 +0000 (02:05 -0400)]
staging: ks7010: Use __packed over __attribute__((packed))
This replaces uses of __attribute__((packed)) with __packed, which is
recommended to be used over the direct __attribute__. This patch then
includes <linux/compiler.h> as necessary to use __packed.
Signed-off-by: Matthew Kilgore <mattkilgore12@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sabitha George [Mon, 26 Sep 2016 17:10:16 +0000 (22:40 +0530)]
staging: ks7010: Fix warnings on printk() usage
This patch fixes the following warnings on ks7010_sdio.c
1. printk() should include KERN_ facility level
2. Prefer [subsystem eg: netdev]_err([subsystem]dev, ...
then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...
Signed-off-by: Sabitha George <sabitha.george@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Check for attribute_group structures that are only stored in the
attrs filed of iio_info structure. As the attrs field of iio_info
structures is constant, so these attribute_group structures can also be
declared constant.
Done using coccinelle
Check for attribute_group structures that are only stored in the
attrs filed of iio_info structure. As the attrs field of iio_info
structures is constant, so these attribute_group structures can also be
declared constant.
Done using coccinelle:
Check for cfg80211_ops structures that are only passed as the first
argument to the function wiphy_new. As this argument is constant, so
cfg80211_ops structures having this property can also be declared
constant.
Done using coccinelle:
wang di [Mon, 26 Sep 2016 14:50:50 +0000 (10:50 -0400)]
staging: lustre: llite: add missing LMV_MAGIC_V1 case
The port to upstream dropped handling the LMV_MAGIC_V1
case for ll_dir_getstripe. This adds it back.
Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-on: http://review.whamcloud.com/7228 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: greybus/timesync: avoid divide by zero on X86 Qemu
A system configured without CONFIG_CPUFREQ will return 0 for cpufreq_get().
greybus-timesync can subsequently then do a divide-by-zero as result. This
patch fixes by checking for a zero return value from cpufreq_get() and
setting to a default value of 19.2MHz.
greybus: audio: fix uninitialized variable errors found by cppcheck
Currently, if info is null, the dev_err message is dereferencing an
uninitialized module pointer. Instead, it should use codec->dev pointer
in dev_err call and better align with other err msg in this function.
Also, ret variable might be used uninitialized in a specific case.
Avoid using it this way.
Found using static analysis with cppcheck:
Checking drivers/staging/greybus/audio_topology.c...
[drivers/staging/greybus/audio_topology.c:175]: (error) Uninitialized
variable: module
[drivers/staging/greybus/audio_topology.c:495]: (error) Uninitialized
variable: ret
Reported-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Vaibhav Agarwal <vaibhav.sr@gmail.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Move the extern declaration to a header file common to all users of the
variable. This fixes the following sparse warning:
symbol 'ldlm_cancel_unused_locks_before_replay' was not declared.
Should it be static?
Signed-off-by: Imre Deak <imre.deak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>