Since commit 5d20ee3192 ("kbuild: Allow LD_DEAD_CODE_DATA_ELIMINATION
to be selectable if enabled"), HAVE_LD_DEAD_CODE_DATA_ELIMINATION is
supposed to be selected by architectures that are capable of this
functionality. LD_DEAD_CODE_DATA_ELIMINATION is now users' selection.
Update the help message.
Signed-off-by: Masahiro Yamada <[email protected]>
Each symbol has a property of type P_SYMBOL since commit
59e89e3ddf (kconfig: save location of config symbols).
Handle those properties in print_symbol().
Further, place a pointer to print_symbol() in the comment above the
list of known property type.
Signed-off-by: Dirk Gouders <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
Remove unrequired whitespace in some declarations,
fix an indentation and remove unrequired blank lines.
Signed-off-by: Michael Straube <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Use the mac_pton() helper to convert the mac address string.
The functions key_char2num() and key_2char2num() are not used
anywhere else and can be removed.
This also has the benefit of validating the input since mac_pton()
returns false if the string is not valid.
Signed-off-by: Michael Straube <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Use ether_addr_copy() instead of memcpy() to copy the mac address.
Suggested-by: Andy Shevchenko <[email protected]>
Signed-off-by: Michael Straube <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Using is_broadcast_ether_addr() and is_zero_ether_addr() instead of
testing each byte of the mac[] array for 0xff and 0x00 shortens the
code and improves readability.
If np == NULL, of_get_property() returns NULL, hence the "np" check
is not needed.
Instead of a fixed default mac address use a random one to reduce the
likelihood of mac address collision.
Thanks to Joe Perches and Dan Carpenter.
Suggested-by: Joe Perches <[email protected]>
Suggested-by: Dan Carpenter <[email protected]>
Signed-off-by: Michael Straube <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix comparsion to NULL issues found by checkpatch.
Use !x instead of x == NULL.
Signed-off-by: Michael Straube <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
random_ether_addr is a #define for eth_random_addr which is
generally preferred in kernel code by ~3:1
Convert the uses of random_ether_addr to enable removing the #define
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Remove unrequired blank lines after open and before close braces.
Reported by checkpatch.
Signed-off-by: Michael Straube <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix two "CHECK: Macro argument 'N' may be better as '(N)' to avoid
precedence issue" messages, reported by checkpatch, by adding
parentheses around the offending macro argument references.
Signed-off-by: Tim Collier <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
checkpatch gives the following message for the p80211rate_to_p2bit
macro:
CHECK: Macro argument reuse 'n' - possible side-effects?
To fix the message, replace the macro with an equivalent inline
function.
Signed-off-by: Tim Collier <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
checkpatch reports a "CHECK" diagnostic for WLAN_CTL_FRAMELEN as the
macro reuses its argument, leading to possible side-effects. Avoid
this by replacing the macro with an equivalent function, named
wlan_ctl_framelen (as recommended in the coding style). All references
to the macro also updated accordingly.
Signed-off-by: Tim Collier <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix "CHECK: Alignment should match open parenthesis" reported by
checkpatch.pl.
Signed-off-by: Tim Collier <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The driver may sleep with holding a spinlock.
The function call path (from bottom to top) in Linux-4.16.7 is:
[FUNC] schedule
drivers/staging/rtlwifi/halmac/rtl_halmac.c, 884:
schedule in _is_fw_read_cmd_down
drivers/staging/rtlwifi/halmac/rtl_halmac.c, 912:
_is_fw_read_cmd_down in rtl_halmac_send_h2c
drivers/staging/rtlwifi/halmac/rtl_halmac.c, 907:
_raw_spin_lock_irqsave in rtl_halmac_send_h2c
To fix this bug, schedule() is replaced with mdelay(1).
This bug is found by my static analysis tool (DSAC-2) and checked by
my code review.
Signed-off-by: Jia-Ju Bai <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Improve readability of prism2_add_key:
a) Reduce nesting and removed goto statement by using more return statements.
Signed-off-by: Chris Opperman <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The driver has rather excessive amount of tracing code, which would be
better done using ftrace. This is obviously not a main feature of the
driver, and it should work just as well without it.
Removing it saves over 1300 lines of code and likely makes the driver
a bit faster by avoiding lots of calls into the timekeeping code.
I came across this while cleaning up the last users of the deprecated
getnstimeofday64() function, of which there is one in the now-removed
get_current_time() function of the rtsx driver that was only used for
tracing.
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The BIT macro uses unsigned long which some architectures handle as 32 bit
and therefore might cause macro's shift to overflow when used on a value
equals or larger than 32 (NL80211_STA_INFO_RX_DURATION and afterwards).
Since 'filled' member in station_info changed to u64, BIT_ULL macro
should be used with all NL80211_STA_INFO_* attribute types instead of BIT
to prevent future possible bugs when one will use BIT macro for higher
attributes by mistake.
This commit cleans up all usages of BIT macro with the above field
in cfg80211 by changing it to BIT_ULL instead.
Signed-off-by: Omer Efrat <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch fixes following sparse warning:
Using plain integer as NULL pointer
in drivers/staging/most/dim2/dim2.c
Signed-off-by: Marcin Ciupak <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The function rtw_set_tx_chksum_offload() has empty definition.
Signed-off-by: Michael Straube <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Move open braces of definitions to the next line
to comply with codestyle.
Criticized by checkpatch.
Signed-off-by: Henriette Hofmeier <[email protected]>
Signed-off-by: Florian Harbecke <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The driver may sleep with holding a spinlock.
The function call paths (from bottom to top) in Linux-4.16.7 are:
[FUNC] kzalloc(GFP_KERNEL)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 323:
kzalloc in translate_scan
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 1554:
translate_scan in rtw_wx_get_scan
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 1533:
spin_lock_bh in rtw_wx_get_scan
[FUNC] kzalloc(GFP_KERNEL)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 455:
kzalloc in translate_scan
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 1554:
translate_scan in rtw_wx_get_scan
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 1533:
spin_lock_bh in rtw_wx_get_scan
To fix these bugs, GFP_KERNEL is replaced with GFP_ATOMIC.
These bugs are found by my static analysis tool (DSAC-2) and checked by
my code review.
Signed-off-by: Jia-Ju Bai <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
get_monotonic_boottime() is deprecated because it uses the
old 'timespec' structure. This replaces one of the last callers
with a call to ktime_get_boottime, which also simplifies it
a bit by avoiding a double conversion.
Signed-off-by: Arnd Bergmann <[email protected]>
Reviewed-by: Quytelda Kahja <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix 'braces {} should be used on all arms of this statement' coding
style problem in 'phy_get_tx_pwr_lmt()'.
Signed-off-by: Quytelda Kahja <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The if conditionals used to work around wrong TX power limit indices
can be condensed into a single if/else-if statement for more concise
expression.
Signed-off-by: Quytelda Kahja <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Two conditionals that set 'channel' based on 'band_type' in
'phy_get_tx_pwr_lmt()' can be simplified into one single-line conditional.
Signed-off-by: Quytelda Kahja <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Factoring out the conditional lookup of bandwidth index into the power
limit table into it's own function simplifies the logic of
'phy_get_tx_pwr_lmt()'.
Signed-off-by: Quytelda Kahja <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The rate section lookup is a large switch statement in the middle of
'phy_get_tx_pwr_lmt()'; refactor this statement into it's own function
for increased readability.
Signed-off-by: Quytelda Kahja <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Two if statements that carry out the same operation can be combined with
a logical OR.
Signed-off-by: Quytelda Kahja <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Use GPL-2.0+ based on the license text in each of the files.
Signed-off-by: Valentin Vidic <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Use const array to map switch cases to resulting values.
Signed-off-by: Valentin Vidic <[email protected]>
Reviewed-by: Marcus Wolf <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The device structure contains a useless non-atomic users counter which
is subject to race conditions. It has probably been created to handle
the case where remove is executed while operations are still executing
on open fds but this will never happen because of reference counts.
Drop the users counter and move rx buffer {de,}allocation to probe()
and remove(). Remove associated dead code from open() and release().
Remove related TODO entry from ioctl().
Signed-off-by: Hugo Lefeuvre <[email protected]>
Reviewed-by: Dan Carpenter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The timespec structure suffers from the y2038 overflow and should not
be used. This changes handle_vsoc_cond_wait() to use ktime_t directly.
Signed-off-by: Arnd Bergmann <[email protected]>
Reviewed-by: Martijn Coenen <[email protected]>
Tested-by: Alistair Strachan <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The ashmem driver did not check that the size/offset of the vma passed
to its .mmap() function was not larger than the ashmem object being
mapped. This could cause mmap() to succeed, even though accessing parts
of the mapping would later fail with a segmentation fault.
Ensure an error is returned by the ashmem_mmap() function if the vma
size is larger than the ashmem object size. This enables safer handling
of the problem in userspace.
Cc: Todd Kjos <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Joel Fernandes <[email protected]>
Signed-off-by: Alistair Strachan <[email protected]>
Acked-by: Joel Fernandes (Google) <[email protected]>
Reviewed-by: Martijn Coenen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Item [1] in TODO list is already addressed, so removed it from TODO file.
[1]. Move handling for each individual members of 'union message_body' out
into a separate 'struct work_struct' and completely remove the
multiplexerthat is currently part of host_if_work(), allowing movement
of the implementation of each message handler into the callsite of the
function that currently queues the 'host_if_msg'.
Signed-off-by: Ajay Singh <[email protected]>
Reviewed-by: Claudiu Beznea <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Instead of static variable now allocating the data and passing to
handle_get_rssi() to fill the rssi information.
Signed-off-by: Ajay Singh <[email protected]>
Reviewed-by: Claudiu Beznea <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Avoided the use of static variable 'inactive_time' and move it as part of
'sta_inactive_t' structure.
Signed-off-by: Ajay Singh <[email protected]>
Reviewed-by: Claudiu Beznea <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Handle freeing of memory allocated to keep 'key' & 'seq' in wilc_add_rx_gtk().
Once completion event is received, free the memory allocated for
to avoid missing of free in work function.
Signed-off-by: Ajay Singh <[email protected]>
Reviewed-by: Claudiu Beznea <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Handle freeing of memory allocated to store the 'key' in wilc_add_ptk()
function. Once work completion notification is received, free the
memory allocated to avoid missing of free in work function sepecially
for error scenario.
Signed-off-by: Ajay Singh <[email protected]>
Reviewed-by: Claudiu Beznea <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Modified the code to free the allocated memory, used to store the key in
wilc_add_wep_key_bss_sta() and wilc_add_wep_key_bss_ap().
After work completion notification is received, free the
memory allocated to avoid missing of free in work function.
Signed-off-by: Ajay Singh <[email protected]>
Reviewed-by: Claudiu Beznea <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Rename wilc_enqueue_cmd() to wilc_enqueue_work() because its used to
enqueue the work queue. Also removed the function header comment for
wilc_enqueue_cmd() as its not correct.
Signed-off-by: Ajay Singh <[email protected]>
Reviewed-by: Claudiu Beznea <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Remove 'hif_thread_comp' completions as its not required after adding
completion event as part work data to handle each sync call.
Signed-off-by: Ajay Singh <[email protected]>
Reviewed-by: Claudiu Beznea <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>