- 28 6月, 2018 40 次提交
-
-
由 Michael Straube 提交于
Remove unrequired whitespace in some declarations, fix an indentation and remove unrequired blank lines. Signed-off-by: NMichael Straube <straube.linux@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Michael Straube 提交于
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: NMichael Straube <straube.linux@gmail.com> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Michael Straube 提交于
Use ether_addr_copy() instead of memcpy() to copy the mac address. Suggested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NMichael Straube <straube.linux@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Michael Straube 提交于
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: NJoe Perches <joe@perches.com> Suggested-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NMichael Straube <straube.linux@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Michael Straube 提交于
Fix comparsion to NULL issues found by checkpatch. Use !x instead of x == NULL. Signed-off-by: NMichael Straube <straube.linux@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Joe Perches 提交于
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: NJoe Perches <joe@perches.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Michael Straube 提交于
Remove unrequired blank lines after open and before close braces. Reported by checkpatch. Signed-off-by: NMichael Straube <straube.linux@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tim Collier 提交于
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: NTim Collier <osdevtc@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tim Collier 提交于
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: NTim Collier <osdevtc@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tim Collier 提交于
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: NTim Collier <osdevtc@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Tim Collier 提交于
Fix "CHECK: Alignment should match open parenthesis" reported by checkpatch.pl. Signed-off-by: NTim Collier <osdevtc@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Jia-Ju Bai 提交于
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: NJia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Chris Opperman 提交于
Improve readability of prism2_add_key: a) Reduce nesting and removed goto statement by using more return statements. Signed-off-by: NChris Opperman <eklikeroomys@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Arnd Bergmann 提交于
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: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Omer Efrat 提交于
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: NOmer Efrat <omer.efrat@tandemg.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Marcin Ciupak 提交于
This patch fixes following sparse warning: Using plain integer as NULL pointer in drivers/staging/most/dim2/dim2.c Signed-off-by: NMarcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Michael Straube 提交于
The function rtw_set_tx_chksum_offload() has empty definition. Signed-off-by: NMichael Straube <straube.linux@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Henriette Hofmeier 提交于
Change comment from 'local variable' to 'global variables' and change style to comply with coding-style. Signed-off-by: NHenriette Hofmeier <passt@h-hofmeier.de> Signed-off-by: NFlorian Harbecke <florian.harbecke@fau.de> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Henriette Hofmeier 提交于
Remove initializations of global variables with 0. Criticized by checkpatch. Signed-off-by: NHenriette Hofmeier <passt@h-hofmeier.de> Signed-off-by: NFlorian Harbecke <florian.harbecke@fau.de> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Henriette Hofmeier 提交于
Move open braces of definitions to the next line to comply with codestyle. Criticized by checkpatch. Signed-off-by: NHenriette Hofmeier <passt@h-hofmeier.de> Signed-off-by: NFlorian Harbecke <florian.harbecke@fau.de> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Jia-Ju Bai 提交于
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: NJia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Arnd Bergmann 提交于
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: NArnd Bergmann <arnd@arndb.de> Reviewed-by: NQuytelda Kahja <quytelda@tamalin.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Quytelda Kahja 提交于
Fix 'braces {} should be used on all arms of this statement' coding style problem in 'phy_get_tx_pwr_lmt()'. Signed-off-by: NQuytelda Kahja <quytelda@tamalin.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> -
由 Quytelda Kahja 提交于
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: NQuytelda Kahja <quytelda@tamalin.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Quytelda Kahja 提交于
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: NQuytelda Kahja <quytelda@tamalin.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Quytelda Kahja 提交于
Signed-off-by: NQuytelda Kahja <quytelda@tamalin.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Quytelda Kahja 提交于
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: NQuytelda Kahja <quytelda@tamalin.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Quytelda Kahja 提交于
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: NQuytelda Kahja <quytelda@tamalin.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Quytelda Kahja 提交于
This else-if conditional block does nothing; remove it. Signed-off-by: NQuytelda Kahja <quytelda@tamalin.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Quytelda Kahja 提交于
Two if statements that carry out the same operation can be combined with a logical OR. Signed-off-by: NQuytelda Kahja <quytelda@tamalin.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Quytelda Kahja 提交于
Change camel-case names to snake-case names; to avoid variable name conflicts, rename table index variables to idx_*. Signed-off-by: NQuytelda Kahja <quytelda@tamalin.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Quytelda Kahja 提交于
Rename camel-case 'PHY_GetTxPowerLimit()' to 'phy_get_tx_pwr_lmt()'. Signed-off-by: NQuytelda Kahja <quytelda@tamalin.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Quytelda Kahja 提交于
Wrap lines longer than 80 characters where possible, delete double newlines, and fix alignment per the kernel coding style guidelines. Signed-off-by: NQuytelda Kahja <quytelda@tamalin.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Valentin Vidic 提交于
Fixes checkpatch warning: WARNING: line over 80 characters Signed-off-by: NValentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Valentin Vidic 提交于
Use GPL-2.0+ based on the license text in each of the files. Signed-off-by: NValentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Valentin Vidic 提交于
Use const array to map switch cases to resulting values. Signed-off-by: NValentin Vidic <Valentin.Vidic@CARNet.hr> Reviewed-by: NMarcus Wolf <Marcus.Wolf@Wolf-Entwicklungen.de> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Hugo Lefeuvre 提交于
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: NHugo Lefeuvre <hle@owl.eu.com> Reviewed-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> -
由 Arnd Bergmann 提交于
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: NArnd Bergmann <arnd@arndb.de> Reviewed-by: NMartijn Coenen <maco@android.com> Tested-by: NAlistair Strachan <astrachan@google.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Alistair Strachan 提交于
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 <tkjos@android.com> Cc: devel@driverdev.osuosl.org Cc: linux-kernel@vger.kernel.org Cc: kernel-team@android.com Cc: Joel Fernandes <joel@joelfernandes.org> Signed-off-by: NAlistair Strachan <astrachan@google.com> Acked-by: NJoel Fernandes (Google) <joel@joelfernandes.org> Reviewed-by: NMartijn Coenen <maco@android.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Alistair Strachan 提交于
There is no speed difference, and it makes the code harder to read. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Arve Hjønnevåg <arve@android.com> Cc: Todd Kjos <tkjos@android.com> Cc: Martijn Coenen <maco@android.com> Cc: devel@driverdev.osuosl.org Cc: linux-kernel@vger.kernel.org Cc: kernel-team@android.com Cc: Joel Fernandes <joel@joelfernandes.org> Suggested-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NAlistair Strachan <astrachan@google.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-