err_spi is used when SERIAL_SC16IS7XX_SPI is enabled, so make
the label only available under SERIAL_SC16IS7XX_SPI option.
Otherwise, the below warning appears.
drivers/tty/serial/sc16is7xx.c:1523:1: warning: label ‘err_spi’ defined but not used [-Wunused-label]
err_spi:
^~~~~~~
Signed-off-by: Guoqing Jiang <[email protected]>
Fixes: ac0cdb3d99 ("sc16is7xx: missing unregister/delete driver on error in sc16is7xx_init()")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The calculation of the sampling point has min() and max() exchanged.
Fix this by using the clamp() helper instead.
Fixes: 63ba1e00f1 ("serial: sh-sci: Support for HSCIF RX sampling point adjustment")
Signed-off-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Ulrich Hecht <[email protected]>
Reviewed-by: Wolfram Sang <[email protected]>
Acked-by: Dirk Behme <[email protected]>
Cc: stable <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
There are several issues with the formula used for calculating the
deviation from the intended rate:
1. While min_err and last_stop are signed, srr and baud are unsigned.
Hence the signed values are promoted to unsigned, which will lead
to a bogus value of deviation if min_err is negative,
2. Srr is the register field value, which is one less than the actual
sampling rate factor,
3. The divisions do not use rounding.
Fix this by casting unsigned variables to int, adding one to srr, and
using a single DIV_ROUND_CLOSEST().
Fixes: 63ba1e00f1 ("serial: sh-sci: Support for HSCIF RX sampling point adjustment")
Signed-off-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Mukesh Ojha <[email protected]>
Cc: stable <[email protected]>
Reviewed-by: Ulrich Hecht <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
If no console driver is enabled (or if a non-present driver is selected
with something like console=null in an attempt to disable the console),
opening /dev/console errors out, and init scripts and other userspace
code that relies on the existence of a console will fail. Symlinking
/dev/null to /dev/console does not solve the problem since /dev/null
does not behave like a real TTY.
To just provide a dummy console to userspace when no console driver is
available or desired, add a ttynull driver which simply discards all
writes. It can be chosen on the command line in the standard way, i.e.
with console=ttynull.
Signed-off-by: Vincent Whitchurch <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Pass Unicode character to k_unicode handler function to honor possible
accent_table definition.
With introduction of KDSKBDIACRUC ioctl, it has been possible to set
compose characters (diacr, base and result) to any Unicode character
(below 0xf000 code point) as defined in struct kbdiacruc.
But it does not work with characters beyond Latin-1 as base, because
they are printed early and not passed to any of the handler functions,
thus breaking compose and dead keys.
It affects keyboard layouts defining such characters on level 1 and
relying on dead keys to access level 3 (e.g., lv-modern with some
modifications for extra characters on level 3 for ē, ā and ī keys).
Signed-off-by: Reinis Danne <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This reverts commit f4e68d58cf.
TTY drivers using the tty-port abstraction all provide a pointer to a
set of port operations, which specifically cannot be NULL (or we'd find
out at first attempt to open a port).
Revert the recent commit which added unnecessary NULL-checks and whose
commit message indicated that it was fixing a real problem, which it did
not.
Note that even the two tty drivers for virtual devices currently
providing an empty set of operations probably should be implementing at
least some of the callbacks.
Cc: Fabien Dessenne <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Add Milbeaut serial control including earlycon and console.
Signed-off-by: Sugaya Taichi <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
GIO_UNIMAP can easily result in a high order allocation,
seen 6th order allocation on radeondrmfb:
fbcon: radeondrmfb (fb0) is primary device
Console: switching to colour frame buffer device 160x64
radeon 0000:01:05.0: fb0: radeondrmfb frame buffer device
WARNING: CPU: 0 PID: 78661 at mm/page_alloc.c:3532
__alloc_pages_nodemask+0x1b1/0x600
order 6 >= 3, gfp 0x40d0
The warning is generated by a debug patch.
At the same time it's safe to use kvmalloc() for allocation in
con_get_unimap(), so let's do the substitution.
And do the same for con_set_unimap().
Signed-off-by: Konstantin Khorenko <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
'default n' is the default value for any bool or tristate Kconfig
setting so there is no need to write it explicitly.
Also since commit f467c5640c ("kconfig: only write '# CONFIG_FOO
is not set' for visible symbols") the Kconfig behavior is the same
regardless of 'default n' being present or not:
...
One side effect of (and the main motivation for) this change is making
the following two definitions behave exactly the same:
config FOO
bool
config FOO
bool
default n
With this change, neither of these will generate a
'# CONFIG_FOO is not set' line (assuming FOO isn't selected/implied).
That might make it clearer to people that a bare 'default n' is
redundant.
...
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The return from tty_write_room could potentially be negative if
a tty write_room driver returns an error number (not that any seem
to do). Rather than just check for a zero return, also check for
a -ve return. This avoids the unsigned nr being set to a large unsigned
value on the assignment from variable space and can lead to overflowing
the buffer buf. Better to be safe than assume all write_room
implementations in tty drivers are going to do the right thing.
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Commit 008258d995 ("clocksource/drivers/timer-ti-dm: Make
omap_dm_timer_set_load_start() static") made omap_dm_time_set_load_start
static because its prototype was not defined in a header. Unfortunately,
this causes a build warning on multi_v7_defconfig because this function
is not used anywhere in this translation unit:
drivers/clocksource/timer-ti-dm.c:589:12: error: unused function
'omap_dm_timer_set_load_start' [-Werror,-Wunused-function]
In fact, omap_dm_timer_set_load_start hasn't been used anywhere since
commit f190be7f39 ("staging: tidspbridge: remove driver") and the
prototype was removed in commit 592ea6bd1f ("clocksource: timer-ti-dm:
Make unexported functions static"), which is probably where this should
have happened.
Fixes: 592ea6bd1f ("clocksource: timer-ti-dm: Make unexported functions static")
Fixes: 008258d995 ("clocksource/drivers/timer-ti-dm: Make omap_dm_timer_set_load_start() static")
Signed-off-by: Nathan Chancellor <[email protected]>
Acked-by: Tony Lindgren <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
Remove an unused struct tx_pending_t, as it is never used in
kernel tree.
Signed-off-by: Madhumitha Prabakaran <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Remove typedef in struct ieee_param, as the struct that
has elements that can reasonably be directly accessed
should never be a typedef.
Signed-off-by: Madhumitha Prabakaran <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Remove typedef in struct ieee_param_ex, as the struct that
has elements that can reasonably be directly accessed should
never be a typedef.
Signed-off-by: Madhumitha Prabakaran <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
When setting output power level called, the power level should be
checked by power amplifier level register and high power option. There
was todo about it. Add some variables for checking power level range.
The values that used for checking high power or minimum power are from
rf69 datasheets. The maximum power level is always same regardless of
mode.
Signed-off-by: Sidong Yang <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Remove an exceptional & on function names, otherwise they are used as
pointers without &.
Issue suggested using Coccinelle.
Signed-off-by: Madhumitha Prabakaran <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Do not use uninitialized variable 'port' when printing an error message
Signed-off-by: Antti Keränen <[email protected]>
Reviewed-by: Sergio Paracuellos <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
One of the more common cases of allocation size calculations is finding
the size of a structure that has a zero-sized array at the end, along
with memory for some number of elements for that array. For example:
struct foo {
int stuff;
struct boo entry[];
};
size = sizeof(struct foo) + count * sizeof(struct boo);
instance = kzalloc(size, GFP_KERNEL)
Instead of leaving these open-coded and prone to type mistakes, we can
now use the new struct_size() helper:
size = struct_size(instance, entry, count);
or
instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL)
Based on the above, replace gdma_dma_alloc_desc() with kzalloc() and
use the new struct_size() helper.
This code was detected with the help of Coccinelle.
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
crc16_ccitt() function does "BIT(0) << i" instead of "BIT(i)".
Using !! is slightly shorter than "foo ? 1: 0" and remove unnecessary
parentheses to make the code simple.
Issue suggested by Coccinelle.
Signed-off-by: Madhumitha Prabakaran <[email protected]>
Reviewed-by: Dan Carpenter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Function name is otherwise used as pointers without &.
Issue suggested by Coccinelle.
Signed-off-by: Madhumitha Prabakaran <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/staging/rtlwifi/base.c: In function 'rtl_tx_agg_stop':
drivers/staging/rtlwifi/base.c:1733:23: warning:
variable 'tid_data' set but not used [-Wunused-but-set-variable]
drivers/staging/rtlwifi/base.c: In function 'rtl_check_beacon_key':
drivers/staging/rtlwifi/base.c:2474:5: warning:
variable 'ds_param_len' set but not used [-Wunused-but-set-variable]
drivers/staging/rtlwifi/base.c:2472:5: warning:
variable 'ht_oper_len' set but not used [-Wunused-but-set-variable]
drivers/staging/rtlwifi/base.c:2470:5: warning:
variable 'ht_cap_len' set but not used [-Wunused-but-set-variable]
They are never used and can be removed.
Signed-off-by: YueHaibing <[email protected]>
Reviewed-by: Mukesh Ojha <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
'default n' is the default value for any bool or tristate Kconfig
setting so there is no need to write it explicitly.
Also since commit f467c5640c ("kconfig: only write '# CONFIG_FOO
is not set' for visible symbols") the Kconfig behavior is the same
regardless of 'default n' being present or not:
...
One side effect of (and the main motivation for) this change is making
the following two definitions behave exactly the same:
config FOO
bool
config FOO
bool
default n
With this change, neither of these will generate a
'# CONFIG_FOO is not set' line (assuming FOO isn't selected/implied).
That might make it clearer to people that a bare 'default n' is
redundant.
...
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Remove typedef in struct sdio_data and make the respective changes in
associated files, as the struct that has elements that can reasonably
be directly accessed should never be a typedef.
Signed-off-by: Madhumitha Prabakaran <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix the checkpath error:
CHECK: Blank lines aren't necessary after an open brace '{'
Signed-off-by: Daniel Junho <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/staging/rtl8192e/rtl8192e/rtl_pci.c: In function 'rtl92e_check_adapter':
drivers/staging/rtl8192e/rtl8192e/rtl_pci.c:36:6: warning:
variable 'VenderID' set but not used [-Wunused-but-set-variable]
u16 VenderID;
^
It's never used and can be removed.
Signed-off-by: YueHaibing <[email protected]>
Reviewed-by: Mukesh Ojha <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/staging/rtlwifi/rtl8822be/hw.c: In function 'rtl8822be_update_hal_rate_mask':
drivers/staging/rtlwifi/rtl8822be/hw.c:2144:5: warning:
variable 'curtxbw_40mhz' set but not used [-Wunused-but-set-variable]
It's never used and can be removed.
Signed-off-by: YueHaibing <[email protected]>
Reviewed-by: Mukesh Ojha <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Add space between "enum TXDESC_SC" and '{' at line 86.
Fix the following error from checkpatch.pl
WARNING: missing space after enum definition
+enum TXDESC_SC{
Signed-off-by: William Tustumi <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix checkpatch coding style errors on rtl819x_TSProc.c
- space required before the open parenthesis '('
- spaces required around that '=='
Signed-off-by: Caio Salvador Rohwedder <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix checkpatch error: "ERROR: space required after that close brace '}'".
Signed-off-by: Gabriel Siqueira <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix checkpatch error "ERROR: code indent should use tabs where possible"
in hal_com_phycfg.c:1726.
Signed-off-by: Beatriz Martins de Carvalho <[email protected]>
Reviewed-by: Dan Carpenter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Function sta2sta_data_frame() is only used in rtw_recv.c.
So make it static.
Signed-off-by: Michael Straube <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The declaration of sta2sta_data_frame() is directly above
the function definition. Remove the unnecessary declaration.
This also clears a checkpatch issue.
CHECK: Lines should not end with a '('
Signed-off-by: Michael Straube <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
List wlan_network is built properly with init_list_head and
list_add_tail which cancels out its probability of being NULL because of
the precence of list_head at the top of this structure. Hence, the NULL
test can be omitted.
Signed-off-by: Himadri Pandya <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The `np->permission' structure is smaller than the `np' structure but
sizeof(*np) worth of data is copied in there. Fix the size passed to
copy_from_user() to avoid overrun.
Fixes: 3d2ec9dcd5 ("staging: Android: Add 'vsoc' driver for cuttlefish.")
Signed-off-by: Vincent Stehlé <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Reviewed-by: Dan Carpenter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch updates the driver documentation files to reflect the
latest changes regarding configfs.
Signed-off-by: Christian Gromm <[email protected]>
v2:
- changed kernel version to 5.2
v3:
v4:
Signed-off-by: Christian Gromm <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch adds code that cleans up established links whenever the destroy
attribute is set or if the config_item (directory) is being removed.
Signed-off-by: Christian Gromm <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Reading the create attribute that triggers the creation of a link to
a certain channel is not necessary. Hence, it is being removed.
Signed-off-by: Christian Gromm <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch makes the driver accept a link configuration eventhough no
device is attached to the bus. Instead the configuration is being applied
as soon as a device is being registered with the core.
Signed-off-by: Christian Gromm <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch removes the driver attribute add_link. It is not needed, because
the link management is now done via configfs.
Signed-off-by: Christian Gromm <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch cuts off the usb_device prefix of the description string.
It is not needed, as the interface type is already available with the
interface attribute of a channel.
Signed-off-by: Christian Gromm <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>