staging: rtl8192e: Replace RT_TRACE(COMP_ERR, ...) with netdev_*
- Use netdev_* with log level depending on how serious error is
- Rework some messages to be more readable
- Pass net_device where needed for pretty prints
Remove the following private variables:
- force_mic_error - changes force_mic_error that is not used
- radio - changes sw_radio_on that is not used
- adhoc_peer_list - unimplemented
- firm_ver - unimplemented
Fix most of simple LONG_LINE warnings. None of the changes should affect
behaviour of code, so several modifications are included in this patch:
- Code is reindented where needed
- Local variable names are compacted (priv -> p)
- Unnecessary casts are removed
- Nested ifs are replaced with logical and
- a = b = c = d expressions are split
- Replace if/then series with clamp_t()
- Removed unneeded scopes
- Use netdev_dbg or netdev_vdbg instead of RTLLIB_DEBUG()
- Reformat some messages for better readability
- Remove RTLLIB_DEBUG messages that make no sense
- Pass extra argument (rtllib_device) to rtllib_parse_qos_info_param_IE()
and update_network()
- Replace RTLLIB_DEBUG_QOS() with netdev_dbg()
- Remove RTLLIB_DEBUG_QOS()
- Extract frame_ctl once and use it as variable.
- Drop endian conversion in is_beacon() function
(used in simplified function only)
- Simplify debug messages
- Invert STYPE checks in debug messages - it is valid
as only BEACON and PROBE_RESP are allowed
staging: rtl8192e: Replace RTLLIB_DEBUG(DL_ERR) with netdev_*()
Replace all RTLLIB_DEBUG(RTLLIB_DL_ERR, *) calls with netdev_err()
for errors that really should be reported to user.
Use netdev_warn() for the rest.
Rephrase some of the messages to make them more readable/compact.
staging: rtl8192e: Fix DEEP_INDENTATION warning in rtllib_parse_info_param()
Move MFIE_TYPE_GENERIC handler to rtllib_parse_mife_generic() function.
Code was not altered significantly, therefore in some places it generates
LONG_LINE checkpatch.pl warnings.
Replace memcpy() with ether_addr_copy() where possible to make
checkpatch.pl happy.
Change was target tested (download 1Mb file over WPA2 network)
with BUG trap for unaligned addresses in ether_addr_copy()
staging: rtl8192e: Make ethernet addresses properly aligned
Reorder ethernet addresses allocated on stack or in non-packed
structures to keep them aligned(2).
Use ETH_ALEN as array length in places where it was hardcoded to 6.
Alignment verified using pahole where possible and target-tested
with BUG_ON() trap in ether_addr_copy.
Heiner Kallweit [Sun, 31 May 2015 12:44:54 +0000 (14:44 +0200)]
staging: fbtft: Add support for Himax HX8357D controller
The Himax HX8357D is used e.g. by the Adafruit PITFT Plus 3.5".
Adafruit added HX8357D support to an own fork of fbtft and support
Raspbian only (https://github.com/adafruit/adafruit-rpi-fbtft/).
They don't intend to push it upstream but gave me the ok to do so.
Original author: Sean Cross <xobs@kosagi.com>
I just applied small changes to the driver to align it with the other
fbtft drivers.
- add "compatible" argument to FBTFT_REGISTER_DRIVER call
- add missing MODULE_ALIAS declarations
Tested successfully with this display on an RPI2 under Arch Linux ARM
(kernel 3.18.13).
lustre_ext_acl_xattr_reduce_space() declares old_size, but never uses it
and gcc 5.x likes to complain about this, so remove it as it's not used
at all.
staging: panel: use schedule_timeout_interruptible()
API consolidation with coccinelle found:
./drivers/staging/panel/panel.c:782:2-18:
consolidation with schedule_timeout_*() recommended
This is a 1:1 conversion with respect to schedule_timeout() to the
schedule_timeout_interruptible() helper only - so only an API
consolidation to improve readability. The timeout was being passed
as (ms * HZ + 999) / 1000 but that simply looks wrong - rather than
"manual" converting to jiffies, msecs_to_jiffies which handles all
corner-cases correctly, was used.
Patch was compile tested with x86_64_defconfig + CONFIG_STAGING=y,
CONFIG_PARPORT=m, CONFIG_PANEL=m
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: me_daq: use schedule_timeout_interruptible()
API consolidation with coccinelle found:
./drivers/staging/comedi/drivers/me_daq.c:177:1-17:
consolidation with schedule_timeout_*() recommended
This is a 1:1 conversion of the current calls to an available helper
only - so only an API consolidation to improve readability.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: sm750fb: remove duplicate from fb_videomode
As suggested by Sudip this patch removes the redundant 1360x768@60
option from the fb_videomode struct array.
The removed option and the option one it differ in a typo and a flag.
Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Luca Ceresoli [Tue, 19 May 2015 09:35:26 +0000 (11:35 +0200)]
staging: rtl8188eu: return an error code, not a boolean
"If the name of a function is an action or an imperative command,
the function should return an error-code integer." (Documentation/CodingStyle)
Several action-like functions in this driver return a boolean: _SUCCESS = 1 on
success, _FAIL = 0 on error, defined in
drivers/staging/rtl8188eu/include/osdep_service.h.
Change rtw_start_drv_threads() to return a proper 0-or-error value.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> Cc: Greg Kroah-Hartman <gregkh@linux.com> Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Haggai Eran [Sat, 23 May 2015 20:13:51 +0000 (23:13 +0300)]
staging: rtl8712: prevent buffer overrun in recvbuf2recvframe
With an RTL8191SU USB adaptor, sometimes the hints for a fragmented
packet are set, but the packet length is too large. Allocate enough
space to prevent memory corruption and a resulting kernel panic [1].
Sudip Mukherjee [Fri, 15 May 2015 09:19:39 +0000 (14:49 +0530)]
staging: rtl8712: fix stack dump
del_timer_sync() is not to be called in the interrupt context unless
the timer is irqsafe. but most of the functions where commits 6501c8e7d86cca5f and 382d020f4459cd77 touched were called in interrupt
context. And as a result the WARN_ON was getting triggered. Changed
to del_timer() in places which were called from interrupt.
Fixes: 382d020f4459cd77 ("Staging: rtl8712: Eliminate use of _cancel_timer" Fixes: 6501c8e7d86cca5f ("Staging: rtl8712: Eliminate use of _cancel_timer_ex") Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=97711 Reported-by: Arek Rusniak <arek.rusi@gmail.com> Tested-by: Arek Rusniak <arek.rusi@gmail.com> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the leak, which was present in fwserial driver in the
init function. In case the tty driver allocation failed the function
returned error, leaving debugfs entry in the filesystem.
To fix the issue additional error label was added, so that the code will
jump to it in case of allocation failure, and free debugfs entries.
Signed-off-by: Vladimirs Ambrosovs <rodriguez.twister@gmail.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jagan Teki [Mon, 18 May 2015 16:32:45 +0000 (22:02 +0530)]
staging: rtl8712: Use ether_addr_copy() instead of memcpy()
Fixes Warning encounter this by applying checkpatch.pl against this file:
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)
- pnetdev->dev_addr
dev_addr is interface address infor from generic net_device structure
which is properly aligned and have some patches with this change as well.
"staging: rtl8712: fix Prefer ether_addr_copy() over memcpy()"
(sha1: 36e4d8826b317080e283e4edd08bf8d5ac706f38)
Signed-off-by: Jagan Teki <jteki@openedev.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Tue, 19 May 2015 12:25:24 +0000 (15:25 +0300)]
staging: slicoss: restore IRQs correctly after slic_cmdq_reset()
We can't save two different values in "flags" so it means that IRQs are
not enabled properly at the end of this function. This isn't a problem
in the current code because it's always called with IRQs disabled so we
don't want to enable them at the end.
This bug is old but it's thanks to David Matlack's recent cleanups that
Smatch can detect it.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: David Matlack <dmatlack@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jaime Arrocha [Tue, 26 May 2015 18:14:05 +0000 (13:14 -0500)]
staging: gdm724x: Remove test for host endian
gdm_endian.c: small changes were done to remove testing for host
endianness and in-driver conversion for byte-ordering.
The linux/kernel.h functions are used now.
gdm_endian.h: removal of code no longer needed with changes
in gdm_endian.c.
staging: rts5208: pass timeout as HZ independent value
schedule_timeout takes a timeout in jiffies but the code currently is
passing in a constant POLLING_INTERVAL which makes this timeout HZ
dependent, so pass it through msecs_to_jiffies() to fix this up.
patch was compile tested for x86_64_defconfig + CONFIG_STAGING=y,
CONFIG_RTS5208=m
Patch is against 4.0-rc5 (localversion-next is -next-20150527)
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
As the first argument of gf_write64() was of type unsigned long, and as
some calls to gf_write64() were casting the first argument from void *
to u64 the compiler and/or sparse were printing warnings for casts of
wrong sizes when compiling for i386.
This patch changes the type of the first argument of gf_write64() to
const void *, and update calls to the function. This change fixed the
warnings and allowed to remove casts from 3 calls to gf_write64().
In addition gf_write64() was renamed to gf_write_ptr() as the name was
misleading because it only writes 32 bits on 32 bit systems.
gf_write_dma_addr() was added to handle dma_addr_t values which is
used at drivers/staging/goldfish/goldfish_audio.c.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Simon Guo [Sat, 30 May 2015 08:10:46 +0000 (16:10 +0800)]
STAGING: Declare request_cache as static for drivers/staging/lustre/lustre/ptlrpc/client.c
Declare request_cache variable as static. It is only used by
drivers/staging/lustre/lustre/ptlrpc/client.c, and its naming is common
which will lead to namespace pollution.
Signed-off-by: Simon Guo <wei.guo.simon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Oleg Drokin [Thu, 21 May 2015 19:32:18 +0000 (15:32 -0400)]
staging/lustre/llite: make llite/lov and lmv symlinks
old proc code had /proc/sys/fs/lustre/llite/.../lov and lmv
dirs that contained name of the dir in lustre/lov and lustre/lmv
to better be able to find correct obd device there, but
I imagien a better solution would be to just create a symlink with
the same name. The name is then pointless and the target dir would
have uuid file just as if it was the old-style dir.