Re: [PATCH] iwlwifi: mvm: add terminate entry for dmi_system_id tables

2021-02-26 Thread Nathan Chancellor
eived a report about a crash in iwlwifi when compiled with LTO and this fix resolves it. Reviewed-by: Nathan Chancellor > --- > drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c >

Re: [PATCH 1/2] mt76: mt7915: fix unused 'mode' variable

2021-02-25 Thread Nathan Chancellor
On Thu, Feb 25, 2021 at 03:59:14PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > clang points out a possible corner case in the mt7915_tm_set_tx_cont() > function if called with invalid arguments: > > drivers/net/wireless/mediatek/mt76/mt7915/testmode.c:593:2: warning: variable > 'mode'

Re: [PATCH V2] init/Kconfig: Fix a typo in CC_VERSION_TEXT help text

2021-02-24 Thread Nathan Chancellor
On Thu, Feb 25, 2021 at 04:03:25AM +0530, Bhaskar Chowdhury wrote: > > s/compier/compiler/ > > Signed-off-by: Bhaskar Chowdhury Reviewed-by: Nathan Chancellor > --- > Changes from V1: > Nathan and Randy, suggested better subject line texts,so incorporated. > >

Re: [RFC] dwarves/pahole: Add test scripts

2021-02-24 Thread Nathan Chancellor
Hi Jiri, Just some drive by comments. I think the idea is neat, I am always a fan of automating more things :) On Tue, Feb 23, 2021 at 02:23:21PM +0100, Jiri Olsa wrote: > hi, > I cleaned up a bit my testing scripts, that I'm using for testing > btf encoding changes. It's far from ideal and convo

Re: [PATCH] init: Kconfig: Fix a spelling compier to compiler in the file init/Kconfig

2021-02-24 Thread Nathan Chancellor
and descriptive. With that change: Reviewed-by: Nathan Chancellor > --- > init/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/init/Kconfig b/init/Kconfig > index b77c60f8b963..739c3425777b 100644 > --- a/init/Kconfig > +++ b/init/Kcon

Re: [PATCHv2] btf_encoder: Match ftrace addresses within elf functions

2021-02-13 Thread Nathan Chancellor
tu-m3-large-x86/ > Acked-by: Andrii Nakryiko > Signed-off-by: Jiri Olsa I did several builds with CONFIG_DEBUG_INFO_BTF enabled (arm64, ppc64le, and x86_64) and saw no build errors. I did not do any runtime testing. Tested-by: Nathan Chancellor > --- > v2 changes: > - updat

Re: FAILED unresolved symbol vfs_truncate on arm64 with LLVM

2021-02-11 Thread Nathan Chancellor
t; segment that overlaps with a given address by first binary searching > > > for a segment with the largest starting address that is <= addr. And > > > then just confirming that segment does overlap with the requested > > > address. > > > > &

Re: [PATCH bpf-next 4/4] kbuild: Add resolve_btfids clean to root clean target

2021-02-10 Thread Nathan Chancellor
On Wed, Feb 10, 2021 at 07:29:31PM +0100, Jiri Olsa wrote: > On Wed, Feb 10, 2021 at 11:02:15AM -0700, Nathan Chancellor wrote: > > On Wed, Feb 10, 2021 at 09:52:42AM -0800, Andrii Nakryiko wrote: > > > On Wed, Feb 10, 2021 at 9:47 AM Nathan Chancellor > > > wrote: >

Re: FAILED unresolved symbol vfs_truncate on arm64 with LLVM

2021-02-10 Thread Nathan Chancellor
On Wed, Feb 10, 2021 at 02:26:43PM +0100, Jiri Olsa wrote: > On Tue, Feb 09, 2021 at 02:00:29PM -0800, Andrii Nakryiko wrote: > > SNIP > > > > > > I'm still trying to build the kernel.. however ;-) > > > > > > > > > > patch below adds the ftrace check only for static functions > > > > > and lets

Re: [PATCH bpf-next 4/4] kbuild: Add resolve_btfids clean to root clean target

2021-02-10 Thread Nathan Chancellor
On Wed, Feb 10, 2021 at 09:52:42AM -0800, Andrii Nakryiko wrote: > On Wed, Feb 10, 2021 at 9:47 AM Nathan Chancellor wrote: > > > > On Fri, Feb 05, 2021 at 01:40:20PM +0100, Jiri Olsa wrote: > > > The resolve_btfids tool is used during the kernel build, > > >

Re: [PATCH bpf-next 4/4] kbuild: Add resolve_btfids clean to root clean target

2021-02-10 Thread Nathan Chancellor
On Fri, Feb 05, 2021 at 01:40:20PM +0100, Jiri Olsa wrote: > The resolve_btfids tool is used during the kernel build, > so we should clean it on kernel's make clean. > > Invoking the the resolve_btfids clean as part of root > 'make clean'. > > Acked-by: Song Liu > Signed-off-by: Jiri Olsa > ---

Re: FAILED unresolved symbol vfs_truncate on arm64 with LLVM

2021-02-09 Thread Nathan Chancellor
On Tue, Feb 09, 2021 at 12:09:31PM -0800, Nick Desaulniers wrote: > On Tue, Feb 9, 2021 at 11:06 AM Jiri Olsa wrote: > > > > On Tue, Feb 09, 2021 at 05:13:42PM +0100, Jiri Olsa wrote: > > > On Tue, Feb 09, 2021 at 04:09:36PM +0100, Jiri Olsa wrote: > > > > > > SNIP > > > > > > > > > > >

Re: FAILED unresolved symbol vfs_truncate on arm64 with LLVM

2021-02-09 Thread Nathan Chancellor
On Tue, Feb 09, 2021 at 10:41:44PM +0100, Jiri Olsa wrote: > On Tue, Feb 09, 2021 at 09:50:48PM +0100, Jiri Olsa wrote: > > On Tue, Feb 09, 2021 at 12:09:31PM -0800, Nick Desaulniers wrote: > > > On Tue, Feb 9, 2021 at 11:06 AM Jiri Olsa wrote: > > > > > > > > On Tue, Feb 09, 2021 at 05:13:42PM +0

Re: FAILED unresolved symbol vfs_truncate on arm64 with LLVM

2021-02-09 Thread Nathan Chancellor
On Tue, Feb 09, 2021 at 05:13:38PM +0100, Jiri Olsa wrote: > On Tue, Feb 09, 2021 at 04:09:36PM +0100, Jiri Olsa wrote: > > SNIP > > > > > > > DW_AT_prototyped(true) > > > > > > DW_AT_type (0x01cfdfe4 "long int") > > > > > > DW_AT_exter

Re: FAILED unresolved symbol vfs_truncate on arm64 with LLVM

2021-02-08 Thread Nathan Chancellor
On Mon, Feb 08, 2021 at 10:56:36PM -0800, Andrii Nakryiko wrote: > On Mon, Feb 8, 2021 at 10:13 PM Andrii Nakryiko > wrote: > > > > On Mon, Feb 8, 2021 at 10:09 PM Andrii Nakryiko > > wrote: > > > > > > On Mon, Feb 8, 2021 at 9:23 PM Nathan Chancellor

Re: FAILED unresolved symbol vfs_truncate on arm64 with LLVM

2021-02-08 Thread Nathan Chancellor
On Mon, Feb 08, 2021 at 08:45:43PM -0800, Andrii Nakryiko wrote: > On Mon, Feb 8, 2021 at 7:44 PM Nathan Chancellor wrote: > > > > Hi all, > > > > Recently, an issue with CONFIG_DEBUG_INFO_BTF was reported for arm64: > > https://groups.google.com/g/clang-built-l

FAILED unresolved symbol vfs_truncate on arm64 with LLVM

2021-02-08 Thread Nathan Chancellor
Hi all, Recently, an issue with CONFIG_DEBUG_INFO_BTF was reported for arm64: https://groups.google.com/g/clang-built-linux/c/de_mNh23FOc/m/E7cu5BwbBAAJ $ make -skj"$(nproc)" ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \ LLVM=1 O=build/aarch64 defconfig $ scripts/config \

Re: [PATCH] staging: qlge/qlge_main: Use min_t instead of min

2021-02-04 Thread Nathan Chancellor
On Fri, Feb 05, 2021 at 03:24:51AM +0530, ameynarkhed...@gmail.com wrote: > From: Amey Narkhede > > Use min_t instead of min function in qlge/qlge_main.c > Fixes following checkpatch.pl warning: > WARNING: min() should probably be min_t(int, MAX_CPUS, num_online_cpus()) > > Signed-off-by: Amey N

Re: [PATCH] net: hns3: avoid -Wpointer-bool-conversion warning

2021-02-04 Thread Nathan Chancellor
ays evaluate to 'true' > [-Werror,-Wpointer-bool-conversion] > > This can never fail, so just remove the check. > > Fixes: 04987ca1b9b6 ("net: hns3: add debugfs support for tm nodes, priority > and qset info") > Signed-off-by: Arnd Bergmann Re

Re: [PATCH V2 net-next 2/2] net: hns3: add debugfs support for tm nodes, priority and qset info

2021-02-01 Thread Nathan Chancellor
On Thu, Jan 28, 2021 at 07:51:36PM +0800, Huazhong Tan wrote: > From: Guangbin Huang > > In order to query tm info of nodes, priority and qset > for debugging, adds three debugfs files tm_nodes, > tm_priority and tm_qset in newly created tm directory. > > Unlike previous debugfs commands, these

Re: [PATCH bpf-next v3] samples/bpf: Update build procedure for manually compiling LLVM and Clang

2021-01-21 Thread Nathan Chancellor
On Thu, Jan 21, 2021 at 12:08:31AM -0800, Andrii Nakryiko wrote: > On Wed, Jan 20, 2021 at 9:36 PM Nathan Chancellor > wrote: > > > > On Thu, Jan 21, 2021 at 01:27:35PM +0800, Tiezhu Yang wrote: > > > The current LLVM and Clang build procedure in samples/bpf/README.rs

Re: [PATCH bpf-next v3] samples/bpf: Update build procedure for manually compiling LLVM and Clang

2021-01-20 Thread Nathan Chancellor
install is > not used, BUILD_SHARED_LIBS=OFF is the default option [2], so also change > Documentation/bpf/bpf_devel_QA.rst together. > > [1] https://clang.llvm.org/get_started.html > [2] https://www.llvm.org/docs/CMake.html > > Signed-off-by: Tiezhu Yang > Acked-by: Yonghong Song

Re: [PATCH] bpf: Hoise pahole version checks into Kconfig

2021-01-13 Thread Nathan Chancellor
On Wed, Jan 13, 2021 at 02:38:27PM -0800, Andrii Nakryiko wrote: > Hm.. Just saw Linus proposing using $(error-if) in Kconfig for an > unrelated issue ([0]). If we can make this work, then it would catch > such issue early on, yet won't have any downsides of hiding > CONFIG_DEBUG_INFO_BTF if pahole

Re: [PATCH] bpf: Hoise pahole version checks into Kconfig

2021-01-11 Thread Nathan Chancellor
On Tue, Jan 12, 2021 at 04:50:50AM +0900, Masahiro Yamada wrote: > On Tue, Jan 12, 2021 at 4:34 AM Nathan Chancellor > wrote: > > > > On Tue, Jan 12, 2021 at 04:19:01AM +0900, Masahiro Yamada wrote: > > > On Tue, Jan 12, 2021 at 3:06 AM Nathan Chancellor > > >

Re: [PATCH] bpf: Hoise pahole version checks into Kconfig

2021-01-11 Thread Nathan Chancellor
On Tue, Jan 12, 2021 at 04:19:01AM +0900, Masahiro Yamada wrote: > On Tue, Jan 12, 2021 at 3:06 AM Nathan Chancellor > wrote: > > > > After commit da5fb18225b4 ("bpf: Support pre-2.25-binutils objcopy for > > vmlinux BTF"), having CONFIG_DEBUG_INFO_BTF enabl

[PATCH] bpf: Hoise pahole version checks into Kconfig

2021-01-11 Thread Nathan Chancellor
andard for options that require a specific tools version. Suggested-by: Sedat Dilek Signed-off-by: Nathan Chancellor --- MAINTAINERS | 1 + init/Kconfig | 4 lib/Kconfig.debug | 6 ++ scripts/link-vmlinux.sh | 13 - scripts/pahole-versi

Re: UBSAN: object-size-mismatch in wg_xmit

2021-01-08 Thread Nathan Chancellor
On Fri, Jan 08, 2021 at 10:33:19AM +0100, Dmitry Vyukov wrote: > On Thu, Jan 7, 2021 at 8:06 PM Jeffrey Walton wrote: > > > > On Thu, Jan 7, 2021 at 2:03 PM Jason A. Donenfeld wrote: > > > > > > On Thu, Jan 7, 2021 at 1:22 PM Dmitry Vyukov wrote: > > > > > > > > On Mon, Dec 21, 2020 at 12:23 PM

[PATCH] mt76: Fix queue ID variable types after mcu queue split

2020-12-29 Thread Nathan Chancellor
ted. Use the proper type for the queue ID variables to fix these warnings. Additionally, rename the txq variable in mt7915_mcu_send_message to be more neutral like mt7615_mcu_send_message. Fixes: e637763b606b ("mt76: move mcu queues to mt76_dev q_mcu array") Link: https://github.com/Clan

Re: [PATCH v3] Compiler Attributes: remove CONFIG_ENABLE_MUST_CHECK

2020-11-29 Thread Nathan Chancellor
a big churn. If arch > maintainers want to clean them up, please go ahead. > > While I was here, I also moved __must_check to compiler_attributes.h > from compiler_types.h > > Signed-off-by: Masahiro Yamada > Acked-by: Jason A. Donenfeld Acked-by: Nathan Chancellor

Re: [net-next,v2,4/5] seg6: add support for the SRv6 End.DT4 behavior

2020-11-13 Thread Nathan Chancellor
On Fri, Nov 13, 2020 at 10:05:56AM -0700, David Ahern wrote: > On 11/13/20 9:57 AM, Jakub Kicinski wrote: > > Good people of build bot, > > > > would you mind shedding some light on this one? It was also reported on > > v1, and Andrea said it's impossible to repro. Strange that build bot > > woul

Re: [PATCH] ipv6: remove unused function ipv6_skb_idev()

2020-11-13 Thread Nathan Chancellor
> net/ipv6/exthdrs.c:909:33: > warning: unused function 'ipv6_skb_idev' [-Wunused-function] > > So, remove this unused function and a -Wunused-function warning. > > Signed-off-by: Lukas Bulwahn Reviewed-by: Nathan Chancellor > --- > Alexey, Hideaki-san, p

Re: [PATCH] compiler-clang: remove version check for BPF Tracing

2020-11-04 Thread Nathan Chancellor
r > clang sources. > > Cc: > Fixes: commit 1f7a44f63e6c ("compiler-clang: add build check for clang > 10.0.1") > Reported-by: Chen Yu > Reported-by: Jarkko Sakkinen > Signed-off-by: Nick Desaulniers Acked-by: Nathan Chancellor > --- > include/linux/compil

Re: [PATCH net-next 07/11] rtw88: remove extraneous 'const' qualifier

2020-10-26 Thread Nathan Chancellor
pe has no effect [-Wignored-qualifiers] > static const u8 rtw8822b_get_swing_index(struct rtw_dev *rtwdev) > > Remove the extra qualifier here. > > Fixes: c97ee3e0bea2 ("rtw88: add power tracking support") > Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chanc

Re: [PATCH\ net] rtw88: fix fw dump support detection

2020-10-26 Thread Nathan Chancellor
fifo\n"); > return -ENOTSUPP; > } > -- > 2.27.0 > Tom sent an identical patch earlier that it does not look like Kalle has picked up: https://lore.kernel.org/linux-wireless/20201011155438.15892-1-t...@redhat.com/ Not that it particularly matters which one goes in so regardless: Reviewed-by: Nathan Chancellor

Re: [PATCH 1/2] staging: wfx: fix use of uninitialized pointer

2020-10-19 Thread Nathan Chancellor
> if (rate->idx >= band->n_bitrates) { > ^~~~ > > Reported-by: kernel test robot > Reported-by: Nathan Chancellor > Fixes: 868fd970e187 ("staging: wfx: improve robustness of wfx_get_hw_rate()") > Signed-off-by: Jérôme Pouiller Reviewe

Re: [PATCH 8/8] staging: wfx: improve robustness of wfx_get_hw_rate()

2020-10-15 Thread Nathan Chancellor
On Fri, Oct 09, 2020 at 07:13:07PM +0200, Jerome Pouiller wrote: > From: Jérôme Pouiller > > Smatch complains: > > data_tx.c:37 wfx_get_hw_rate() warn: constraint '(struct > ieee80211_supported_band)->bitrates' overflow 'band->bitrates' 0 <= abs_rl > '0-127' user_rl '' required = '(struct

Re: [PATCH] rtw88: fix fw_fifo_addr check

2020-10-11 Thread Nathan Chancellor
dev->chip->fw_fifo_addr) { > > fw_fifo_addr is an array in rtw_chip_info so it is always > nonzero. A better check is if the first element of the array is > nonzero. In the cases where fw_fifo_addr is initialized by rtw88b > and rtw88c, the first array element is

Re: [PATCH] brcmfmac: initialize variable

2020-09-13 Thread Nathan Chancellor
; brcmf_sdio_dcmd_resp_wait() only sets pending to true. > So pending needs to be initialized to false. > > Fixes: 5b435de0d786 ("net: wireless: add brcm80211 drivers") > Signed-off-by: Tom Rix Reviewed-by: Nathan Chancellor > --- > drivers/net/wireless/broadco

Re: [PATCH net-next] net: mvpp2: Initialize link in mvpp2_isr_handle_{xlg,gmac_internal}

2020-09-11 Thread Nathan Chancellor
On Fri, Sep 11, 2020 at 08:22:36AM -0700, Jakub Kicinski wrote: > On Fri, 11 Sep 2020 12:11:58 +0100 Russell King - ARM Linux admin wrote: > > On Thu, Sep 10, 2020 at 05:31:42PM -0700, Nathan Chancellor wrote: > > > Ah great, that is indeed cleaner, thank you for letting me kn

Re: [PATCH net-next] net: mvpp2: Initialize link in mvpp2_isr_handle_{xlg,gmac_internal}

2020-09-10 Thread Nathan Chancellor
On Thu, Sep 10, 2020 at 03:28:11PM -0700, David Miller wrote: > From: Nathan Chancellor > Date: Thu, 10 Sep 2020 10:48:27 -0700 > > > Clang warns (trimmed for brevity): > > > > drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c:3073:7: warning: > > variable 

[PATCH net-next] net: mvpp2: Initialize link in mvpp2_isr_handle_{xlg,gmac_internal}

2020-09-10 Thread Nathan Chancellor
r_handle_link. Fixes: 36cfd3a6e52b ("net: mvpp2: restructure "link status" interrupt handling") Link: https://github.com/ClangBuiltLinux/linux/issues/1151 Signed-off-by: Nathan Chancellor --- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 4 ++-- 1 file changed, 2 insertions

Re: [PATCH] ath11k: fix a double free and a memory leak

2020-09-07 Thread Nathan Chancellor
ath11k_mac_setup_channels_rates(), allocates 3 channels. err_free > misses releasing ar->mac.sbands[NL80211_BAND_6GHZ].channels > > Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") > Signed-off-by: Tom Rix Reviewed-by: Nathan Chancellor > --

Re: [PATCH] mwifiex: remove function pointer check

2020-09-07 Thread Nathan Chancellor
ot be NULL because it will always be called at the end of the function even if the first check is skipped. Reviewed-by: Nathan Chancellor > --- > drivers/net/wireless/marvell/mwifiex/init.c | 14 ++ > 1 file changed, 6 insertions(+), 8 deletions(-) > > diff --git a/

[PATCH] mwifiex: Remove unnecessary braces from HostCmd_SET_SEQ_NO_BSS_INFO

2020-09-01 Thread Nathan Chancellor
e. Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver") Link: https://github.com/ClangBuiltLinux/linux/issues/1146 Reported-by: Andy Lavr Signed-off-by: Nathan Chancellor --- drivers/net/wireless/marvell/mwifiex/cmdevt.c | 4 ++-- drivers/net/wireless/m

[PATCH] net: dsa: sja1105: Do not use address of compatible member in sja1105_check_device_id

2020-08-21 Thread Nathan Chancellor
atch") Link: https://github.com/ClangBuiltLinux/linux/issues/1139 Signed-off-by: Nathan Chancellor --- drivers/net/dsa/sja1105/sja1105_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c index c3f6f124e5f

Re: [Intel-wired-lan] [PATCH] igc: Do not use link uninitialized in igc_check_for_copper_link

2020-07-16 Thread Nathan Chancellor
On Thu, Jul 16, 2020 at 07:29:03PM +0300, Neftin, Sasha wrote: > On 7/16/2020 07:49, Nathan Chancellor wrote: > > Clang warns: > > > Hello Nathan, > Thanks for tracking our code.Please, look at > https://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200709

[PATCH] igc: Do not use link uninitialized in igc_check_for_copper_link

2020-07-15 Thread Nathan Chancellor
8 ("igc: Add initial LTR support") Link: https://github.com/ClangBuiltLinux/linux/issues/1095 Signed-off-by: Nathan Chancellor --- drivers/net/ethernet/intel/igc/igc_mac.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_mac.c b/dri

[PATCH net-next 1/2] amd8111e: Mark PM functions as __maybe_unused

2020-06-30 Thread Nathan Chancellor
ompiler that this is going to happen based on the configuration, which is the standard for these types of functions. Fixes: 2caf751fe080 ("amd8111e: Convert to generic power management") Signed-off-by: Nathan Chancellor --- drivers/net/ethernet/amd/amd8111e.c | 4 ++-- 1 file changed

[PATCH net-next 2/2] pcnet32: Mark PM functions as __maybe_unused

2020-06-30 Thread Nathan Chancellor
make it clear to the compiler that this is going to happen based on the configuration, which is the standard for these types of functions. Fixes: a86688fbef1b ("pcnet32: Convert to generic power management") Signed-off-by: Nathan Chancellor --- drivers/net/ethernet/amd/pcnet32.c | 4 ++-- 1 fi

[PATCH net-next] bonding: Remove extraneous parentheses in bond_setup

2020-06-25 Thread Nathan Chancellor
assignment within an if statement. Since equality comparisons do not need a second set of parentheses, remove them to fix the warning. Fixes: 18cb261afd7b ("bonding: support hardware encryption offload to slaves") Link: https://github.com/ClangBuiltLinux/linux/issues/1066 Signed-off-

Re: [PATCH net] net/mlx5: Don't fail driver on failure to create debugfs

2020-06-08 Thread Nathan Chancellor
On Thu, Jun 04, 2020 at 04:44:00AM +, Saeed Mahameed wrote: > On Wed, 2020-06-03 at 11:34 -0700, Nathan Chancellor wrote: > > On Tue, Jun 02, 2020 at 12:27:24PM -0700, Nathan Chancellor wrote: > > > On Tue, Jun 02, 2020 at 03:28:37PM +0300, Leon Romanovsky wrote: > > &

Re: [PATCH 00/10] Remove uninitialized_var() macro

2020-06-03 Thread Nathan Chancellor
y saw one warning pop up (which was about a variable being unused, commented on patch 9 about it). No warnings about uninitialized variables came up; clang's -Wuninitialized was not impacted by 78a5255ffb6a ("Stop the ad-hoc games with -Wno-maybe-initialized") so it should have ca

Re: [PATCH 09/10] treewide: Remove uninitialized_var() usage

2020-06-03 Thread Nathan Chancellor
On Wed, Jun 03, 2020 at 04:32:02PM -0700, Kees Cook wrote: > Using uninitialized_var() is dangerous as it papers over real bugs[1] > (or can in the future), and suppresses unrelated compiler warnings > (e.g. "unused variable"). If the compiler thinks it is uninitialized, > either simply initialize

Re: [PATCH net] net/mlx5: Don't fail driver on failure to create debugfs

2020-06-03 Thread Nathan Chancellor
On Tue, Jun 02, 2020 at 12:27:24PM -0700, Nathan Chancellor wrote: > On Tue, Jun 02, 2020 at 03:28:37PM +0300, Leon Romanovsky wrote: > > From: Leon Romanovsky > > > > Clang warns: > > > > drivers/net/ethernet/mellanox/mlx5/core/main.c:1278:6: warning: variabl

Re: [PATCH net] net/mlx5: Don't fail driver on failure to create debugfs

2020-06-02 Thread Nathan Chancellor
_DEBUG_FS > will return ERR_PTR(-ENODEV) and not NULL as expected. > > Fixes: 11f3b84d7068 ("net/mlx5: Split mdev init and pci init") > Link: https://github.com/ClangBuiltLinux/linux/issues/1042 > Reported-by: Nathan Chancellor > Signed-off-by: Leon Romanovsky Thanks!

Re: [PATCH net-next] mlx5: Restore err assignment in mlx5_mdev_init

2020-06-01 Thread Nathan Chancellor
On Sun, May 31, 2020 at 12:58:10PM +0300, Leon Romanovsky wrote: > On Fri, May 29, 2020 at 10:54:48PM -0700, Nathan Chancellor wrote: > > Clang warns: > > > > drivers/net/ethernet/mellanox/mlx5/core/main.c:1278:6: warning: variable > > 'err' is used uninitia

[PATCH net-next] mlx5: Restore err assignment in mlx5_mdev_init

2020-05-29 Thread Nathan Chancellor
t;net/mlx5: Add missing mutex destroy") Link: https://github.com/ClangBuiltLinux/linux/issues/1042 Signed-off-by: Nathan Chancellor --- drivers/net/ethernet/mellanox/mlx5/core/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/n

Re: [PATCH] net: ethernet: mtk-star-emac: fix error path in RX handling

2020-05-27 Thread Nathan Chancellor
es it by moving the assignment before the > label to which we jump after mapping or allocation errors. > > Fixes: 8c7bd5a454ff ("net: ethernet: mtk-star-emac: new driver") > Reported-by: Nathan Chancellor > Signed-off-by: Bartosz Golaszewski Tested-by: Nathan Chancellor

[PATCH net] netfilter: conntrack: Pass value of ctinfo to __nf_conntrack_update

2020-05-27 Thread Nathan Chancellor
_conntrack_update to __nf_conntrack_update so that uninitialized memory is not used and everything works properly. Fixes: ee04805ff54a ("netfilter: conntrack: make conntrack userspace helpers work again") Link: https://github.com/ClangBuiltLinux/linux/issues/1039 Signed-off-by: Nathan

[PATCH net-next] nexthop: Fix type of event_type in call_nexthop_notifiers

2020-05-27 Thread Nathan Chancellor
EXTHOP_EVENT_DEL, nh); ~~ ^ 1 warning generated. Use the right type for event_type so that clang does not warn. Fixes: 8590ceedb701 ("nexthop: add support for notifiers") Link: https://github.com/ClangBuiltLinux/linux/issues/1038 Signed-off-by: Nathan Chancellor --- net/ipv4/nexth

[PATCH] net/mlx5e: Don't use err uninitialized in mlx5e_attach_decap

2020-05-27 Thread Nathan Chancellor
n one. Initialize err to 0 to fix this. Fixes: 14e6b038afa0 ("net/mlx5e: Add support for hw decapsulation of MPLS over UDP") Link: https://github.com/ClangBuiltLinux/linux/issues/1037 Signed-off-by: Nathan Chancellor --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +- 1 file changed,

Re: [PATCH v5 06/11] net: ethernet: mtk-star-emac: new driver

2020-05-27 Thread Nathan Chancellor
On Fri, May 22, 2020 at 02:06:55PM +0200, Bartosz Golaszewski wrote: > diff --git a/drivers/net/ethernet/mediatek/mtk_star_emac.c > b/drivers/net/ethernet/mediatek/mtk_star_emac.c > new file mode 100644 > index ..789c77af501f > --- /dev/null > +++ b/drivers/net/ethernet/mediatek/mtk

[PATCH] mt76: mt7915: Use proper enum type in __mt7915_mcu_msg_send

2020-05-22 Thread Nathan Chancellor
~~~ txq should be a "enum mt76_txq_id" as values of that type are the only ones assigned to it and that is the type that mt76_tx_queue_skb_raw expects. Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets") Link: https://github.com/ClangBuiltLinux/linu

[PATCH] ethernet: ti: am65-cpts: Add missing inline qualifier to stub functions

2020-05-15 Thread Nathan Chancellor
pts: add routines to support taprio offload") Link: https://github.com/ClangBuiltLinux/linux/issues/1026 Signed-off-by: Nathan Chancellor --- drivers/net/ethernet/ti/am65-cpts.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ti/am65-cpts.h b/d

[PATCH net-next] net: ipa: Remove ipa_endpoint_stop{,_rx_dma} again

2020-05-08 Thread Nathan Chancellor
series, merged in as commit 33395f4a5c1b ("Merge branch 'net-ipa-kill-endpoint-stop-workaround'"). Remove them again so that the build works properly. Fixes: 3793faad7b5b ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net") Signed-off-by: Nathan Chanc

Re: [PATCH] net: bareudp: avoid uninitialized variable warning

2020-05-05 Thread Nathan Chancellor
this file the > same way, using "if(IS_ENABLED())" instead of #if IS_ENABLED()". > > Fixes: 571912c69f0e ("net: UDP tunnel encapsulation module for tunnelling > different protocols like MPLS, IP, NSH etc.") > Signed-off-by: Arnd Bergmann Reviewed-by:

Re: [PATCH v2] hv_netvsc: Fix netvsc_start_xmit's return type

2020-04-29 Thread Nathan Chancellor
Hi Michael, On Thu, Apr 30, 2020 at 12:06:09AM +, Michael Kelley wrote: > From: Nathan Chancellor Sent: Tuesday, April 28, > 2020 10:55 AM > > > > Do note that netvsc_xmit still returns int because netvsc_xmit has a > > potential return from netvsc_vf_xmi

[PATCH v2] hv_netvsc: Fix netvsc_start_xmit's return type

2020-04-28 Thread Nathan Chancellor
s: fceaf24a943d8 ("Staging: hv: add the Hyper-V virtual network driver") Link: https://github.com/ClangBuiltLinux/linux/issues/1009 Signed-off-by: Nathan Chancellor --- v1 -> v2: * Move splat into commit message rather than issue. Comment from previous version: Do note that netvsc_x

[PATCH] dpaa2-eth: Use proper division helper in dpaa2_dbg_ch_show

2020-04-28 Thread Nathan Chancellor
dd channel stat to debugfs") Link: https://github.com/ClangBuiltLinux/linux/issues/1012 Signed-off-by: Nathan Chancellor --- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dp

-Wsizeof-array-div warnings in ethernet drivers

2019-09-17 Thread Nathan Chancellor
Hi all, Clang recently added a new diagnostic in r371605, -Wsizeof-array-div, that tries to warn when sizeof(X) / sizeof(Y) does not compute the number of elements in an array X (i.e., sizeof(Y) is wrong). See that commit for more details: https://github.com/llvm/llvm-project/commit/3240ad4ced0d3

[PATCH] net/mlx5: Fix addr's type in mlx5dr_icm_dm

2019-09-04 Thread Nathan Chancellor
PHYS_ADDR_T_64BIT is set, which is always when CONFIG_64BIT is set. Fixes: 29cf8febd185 ("net/mlx5: DR, ICM pool memory allocator") Link: https://github.com/ClangBuiltLinux/linux/issues/653 Signed-off-by: Nathan Chancellor --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c | 2

[PATCH] net/mlx5: Fix rt's type in dr_action_create_reformat_action

2019-09-04 Thread Nathan Chancellor
right type for rt, which is mlx5_reformat_ctx_type so there are no warnings about mismatched types. Fixes: 9db810ed2d37 ("net/mlx5: DR, Expose steering action functionality") Link: https://github.com/ClangBuiltLinux/linux/issues/652 Signed-off-by: Nathan Chancellor --- drivers/net/e

Re: [PATCH v2] net: mdio-octeon: Fix Kconfig warnings and build errors

2019-08-06 Thread Nathan Chancellor
On Tue, Aug 06, 2019 at 02:11:33PM -0700, David Miller wrote: > From: Nathan Chancellor > Date: Fri, 2 Aug 2019 23:01:56 -0700 > > > After commit 171a9bae68c7 ("staging/octeon: Allow test build on > > !MIPS"), the following combination of configs cause a few

Re: [PATCH] net: mdio-octeon: Fix build error and Kconfig warning

2019-08-02 Thread Nathan Chancellor
On Fri, Aug 02, 2019 at 06:39:52PM -0700, Matthew Wilcox wrote: > On Fri, Aug 02, 2019 at 06:30:31PM -0700, Nathan Chancellor wrote: > > On Fri, Aug 02, 2019 at 06:11:32PM -0700, David Miller wrote: > > > The proper way to fix this is to include either > > > > >

[PATCH v2] net: mdio-octeon: Fix Kconfig warnings and build errors

2019-08-02 Thread Nathan Chancellor
FIG_OF_MDIO is not needed when CONFIG_COMPILE_TEST is enabled because of commit f9dc9ac51610 ("of/mdio: Add dummy functions in of_mdio.h."). Fixes: 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS") Reported-by: kbuild test robot Reported-by: Mark Brown Reported-by: Rand

Re: [PATCH] net: mdio-octeon: Fix build error and Kconfig warning

2019-08-02 Thread Nathan Chancellor
On Fri, Aug 02, 2019 at 06:11:32PM -0700, David Miller wrote: > From: Nathan Chancellor > Date: Wed, 31 Jul 2019 11:50:24 -0700 > > > arm allyesconfig warns: > > > > WARNING: unmet direct dependencies detected for MDIO_OCTEON > > Depends on [n]: NETDEVICES [=y

[PATCH] net: mdio-octeon: Fix build error and Kconfig warning

2019-07-31 Thread Nathan Chancellor
ss the several -Wint-to-pointer-cast and -Wpointer-to-int-cast warnings that appeared as a result of commit 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS") in these files. Fixes: 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS") Reported-by: kbuild test robo

Re: next/master build: 221 builds: 11 failed, 210 passed, 13 errors, 1174 warnings (next-20190731)

2019-07-31 Thread Nathan Chancellor
On Wed, Jul 31, 2019 at 06:00:43PM +0200, Greg KH wrote: > On Wed, Jul 31, 2019 at 08:48:24AM -0700, David Miller wrote: > > From: Greg Kroah-Hartman > > Date: Wed, 31 Jul 2019 13:35:22 +0200 > > > > > On Wed, Jul 31, 2019 at 12:24:41PM +0100, Mark Brown wrote: > > >> On Wed, Jul 31, 2019 at 04:0

Re: [PATCH net] Revert "fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied"

2019-06-05 Thread Nathan Chancellor
dd > > new rules and delete old ones. > > > > If we return 0 without adding dup rules, Android will remove the new > > added rules and causing system to soft-reboot. > > > > Reported-by: Nathan Chancellor > > Fixes: e9919a24d302 ("fib_rules: return 0

Re: [PATCH net] Revert "fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied"

2019-06-04 Thread Nathan Chancellor
ndroid will remove the new > added rules and causing system to soft-reboot. > > Reported-by: Nathan Chancellor > Fixes: e9919a24d302 ("fib_rules: return 0 directly if an exactly same rule > exists when NLM_F_EXCL not supplied") > Signed-off-by: Hangbin Liu Rev

Re: [PATCH net 6/6] bnxt_en: Fix uninitialized variable usage in bnxt_rx_pkt().

2019-04-26 Thread Nathan Chancellor
> the length update. This is the most correct fix since the length > may not be valid when we get this type of error. > > Fixes: 6a8788f25625 ("bnxt_en: add support for software dynamic interrupt > moderation") > Reported-by: Nathan Chancellor > Cc: Nathan Chancellor

[PATCH] net: stmmac: Avoid one more sometimes uninitialized Clang warning

2019-03-07 Thread Nathan Chancellor
ble. Link: https://github.com/ClangBuiltLinux/linux/issues/384 Fixes: df103170854e ("net: stmmac: Avoid sometimes uninitialized Clang warnings") Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 2 +- 1 file changed,

-Wsometimes-uninitialized Clang warning in drivers/net/ethernet/broadcom/bnxt/bnxt.c

2019-03-07 Thread Nathan Chancellor
Hi all, We are trying to get Clang's -Wsometimes-uninitialized turned on for the kernel as it can catch some bugs that GCC can't. This warning came up: drivers/net/ethernet/broadcom/bnxt/bnxt.c:1612:6: warning: variable 'len' is used uninitialized whenever 'if' condition is true [-Wsometimes-uni

-Wsometimes-uninitialized Clang warning in net/tipc/node.c

2019-03-07 Thread Nathan Chancellor
Hi all, We are trying to get Clang's -Wsometimes-uninitialized turned on for the kernel as it can catch some bugs that GCC can't. This warning came up: net/tipc/node.c:831:6: warning: variable 'maddr' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (

[PATCH] iwlwifi: mvm: Change an 'else if' into an 'else' in iwl_mvm_send_add_bcast_sta

2019-03-07 Thread Nathan Chancellor
...) always returns true because __ret_warn_on is defined as !!(condition), which isn't immediately evaluated as 1. Change this branch to else so that it's clear to Clang that we intend to bail out here. Link: https://github.com/ClangBuiltLinux/linux/issues/399 Signed-off-by: Nathan Ch

[PATCH] cfg80211: Change an 'else if' into an 'else' in cfg80211_calculate_bitrate_he

2019-03-07 Thread Nathan Chancellor
because __ret_warn_on is defined as !!(condition), which isn't immediately evaluated as 1. Change this branch to else so that it's clear to Clang that we intend to bail out here. Link: https://github.com/ClangBuiltLinux/linux/issues/382 Suggested-by: Nick Desaulniers Signed-off-by: N

[PATCH] net: ethernet: sun: Zero initialize class in default case in niu_add_ethtool_tcam_entry

2019-03-07 Thread Nathan Chancellor
ROG_CLS is defined as 4). To make this clear to Clang, just zero initialize class in the default case (use the macro CLASS_CODE_UNRECOG to make it clear this shouldn't happen). Link: https://github.com/ClangBuiltLinux/linux/issues/403 Signed-off-by: Nathan Chancellor --- drivers/net/ethernet/sun

[PATCH] net: atm: Add another IS_ENABLED(CONFIG_COMPAT) in atm_dev_ioctl

2019-03-07 Thread Nathan Chancellor
I removed compat's universal assignment to 0, which allows this if statement to fall through when compat is passed with a value other than 0. Fixes: f9d19a7494e5 ("net: atm: Use IS_ENABLED in atm_dev_ioctl") Signed-off-by: Nathan Chancellor --- Sorry for not paying more attenti

[PATCH v2] net: stmmac: Avoid sometimes uninitialized Clang warnings

2019-03-07 Thread Nathan Chancellor
s (get_timestamp and config_sub_second_increment respectively) are the ones that initialize the variables. While it's unlikely that the callbacks are ever going to disappear and make that condition false, we can easily avoid this warning by zero initialize the variables. Link: https://github.

[PATCH] net: atm: Use IS_ENABLED in atm_dev_ioctl

2019-03-07 Thread Nathan Chancellor
analysis stage, which eliminates this warning. Link: https://github.com/ClangBuiltLinux/linux/issues/386 Signed-off-by: Nathan Chancellor --- I don't think this looks the greatest because of the IS_ENABLED + #ifdef but the only other solution I could think of looks way uglier to me: https:

[PATCH] net: stmmac: Avoid sometimes uninitialized Clang warnings

2019-03-07 Thread Nathan Chancellor
s (get_timestamp and config_sub_second_increment respectively) are the ones that initialize the variables. While it's unlikely that the callbacks are ever going to disappear and make that condition false, we can easily avoid this warning by zero initialize the variables. Link: https://github.co

Re: [PATCH] [v2] enic: fix build warning without CONFIG_CPUMASK_OFFSTACK

2019-03-07 Thread Nathan Chancellor
ell, the code is still correct, as the truth value of > the pointer is what we need in this configuration. To get rid of > the warning, use cpumask_available() instead of checking the > pointer directly. > > Fixes: 322cf7e3a4e8 ("enic: assign affinity hint to interrupts"

Re: [PATCH] peak_usb: fix clang build warning

2019-03-07 Thread Nathan Chancellor
rt' has undefined > behavior [-Werror,-Wvarargs] > > Changing the function prototype to avoid argument promotion in the > varargs call avoids the warning, and should make this well-defined. > > Signed-off-by: Arnd Bergmann Link: https://github.com/ClangBuiltLinux/linux/issue

Re: [PATCH] isdn: isdnloop: fix pointer dereference bug

2019-03-07 Thread Nathan Chancellor
Wpointer-bool-conversion] > > This is an array of pointers, so we should check if a specific > pointer exists in the array before using it, not whether the > array itself exists. > > Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor > --- > drivers/isdn/i

Re: [PATCH] davinci_emac: always build in CONFIG_OF code

2019-03-07 Thread Nathan Chancellor
onal way aside from > avoiding the warning. > > Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor > --- > drivers/net/ethernet/ti/davinci_emac.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/ti/davinci_emac

Re: [PATCH] enic: fix build warning without CONFIG_CPUMASK_OFFSTACK

2019-03-07 Thread Nathan Chancellor
On Thu, Mar 07, 2019 at 10:33:02AM +0100, Arnd Bergmann wrote: > The enic driver relies on the CONFIG_CPUMASK_OFFSTACK feature to > dynamically allocate a struct member, but this is normally intended for > local variables. > > Building with clang, I get a warning for a few locations that check the

[PATCH v2] iwlwifi: mvm: Use div_s64 instead of do_div in iwl_mvm_debug_range_resp

2019-02-21 Thread Nathan Chancellor
dend. Use div_s64, which expects a signed dividend. Fixes: 937b10c0de68 ("iwlwifi: mvm: add debug prints for FTM") Link: https://github.com/ClangBuiltLinux/linux/issues/372 Suggested-by: Arnd Bergmann Signed-off-by: Nathan Chancellor --- v1 -> v2: * Fix logic (as the return value

Re: [PATCH] iwlwifi: mvm: Use div64_s64 instead of do_div in iwl_mvm_debug_range_resp

2019-02-20 Thread Nathan Chancellor
On Wed, Feb 20, 2019 at 11:51:34AM +0100, Arnd Bergmann wrote: > On Tue, Feb 19, 2019 at 7:22 PM Nathan Chancellor > wrote: > > > > > diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c > > b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiat

[PATCH] iwlwifi: mvm: Use div64_s64 instead of do_div in iwl_mvm_debug_range_resp

2019-02-19 Thread Nathan Chancellor
nd. Use div64_s64, which expects a signed dividend. Fixes: 937b10c0de68 ("iwlwifi: mvm: add debug prints for FTM") Link: https://github.com/ClangBuiltLinux/linux/issues/372 Signed-off-by: Nathan Chancellor --- drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c | 2 +- 1 file chan

Clang warning in drivers/net/ethernet/intel/igc/igc_ethtool.c

2019-02-07 Thread Nathan Chancellor
Hi all, After commit 8c5ad0dae93c ("igc: Add ethtool support"), Clang warns: drivers/net/ethernet/intel/igc/igc_ethtool.c:9:19: warning: variable 'igc_priv_flags_strings' is not needed and will not be emitted [-Wunneeded-internal-declaration] static const char igc_priv_flags_strings[][ETH_GSTRI

  1   2   >