Re: [PATCH bpf-next v2] samples/bpf: Update README.rst and Makefile for manually compiling LLVM and clang

2021-01-19 Thread Nick Desaulniers
> -- > 2.1.0 > > -- > You received this message because you are subscribed to the Google Groups > "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clang-built-linux+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/clang-built-linux/1611042978-21473-1-git-send-email-yangtiezhu%40loongson.cn. -- Thanks, ~Nick Desaulniers

Re: [PATCH net-next v2 1/2] Makefile.extrawarn: Add symbol for W=1 warnings for today

2020-10-01 Thread Nick Desaulniers
- > You received this message because you are subscribed to the Google Groups > "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clang-built-linux+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/clang-built-linux/20201001011232.4050282-2-andrew%40lunn.ch. -- Thanks, ~Nick Desaulniers

Re: -Wsizeof-array-div warnings in ethernet drivers

2019-09-17 Thread Nick Desaulniers
oes the math > > > to check how many u32's has to write. > > > > That stinks of a possible misaligned data access. > > It's possible to happen only if structure field is not aligned. I guess > I can either change all to u32 or just __align the field of the struct Would __aligning the struct still produce the warning? It's good to know that this case is intentional, but I would like to consider other instances of it before we seriously consider turning it off. If the driver can be rewritten to just make use of u32, I would find that preferrable. -- Thanks, ~Nick Desaulniers

Re: [PATCH] netfilter: nft_bitwise: Adjust parentheses to fix memcmp size argument

2019-08-14 Thread Nick Desaulniers
s: bd8699e9e292 ("netfilter: nft_bitwise: add offload support") > Link: https://github.com/ClangBuiltLinux/linux/issues/638 > Reported-by: kbuild test robot > Signed-off-by: Nathan Chancellor oh no! thanks for the patch. Reviewed-by: Nick Desaulniers > --- > net

[PATCH 00/16] treewide: prefer __section from compiler_attributes.h

2019-08-12 Thread Nick Desaulniers
ound with: $ grep -e __section\(\" -e __section__\(\" -r See the discussions in: https://bugs.llvm.org/show_bug.cgi?id=42950 https://marc.info/?l=linux-netdev&m=156412960619946&w=2 Nick Desaulniers (16): s390/boot: fix section name escaping arc: prefer __section from

[PATCH 16/16] compiler_attributes.h: add note about __section

2019-08-12 Thread Nick Desaulniers
The antipattern described can be found with: $ grep -e __section\(\" -r -e __section__\(\" Link: https://bugs.llvm.org/show_bug.cgi?id=42950 Signed-off-by: Nick Desaulniers --- include/linux/compiler_attributes.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/inc

[PATCH 14/16] include/linux: prefer __section from compiler_attributes.h

2019-08-12 Thread Nick Desaulniers
Link: https://github.com/ClangBuiltLinux/linux/issues/619 Reported-by: Sedat Dilek Suggested-by: Josh Poimboeuf Signed-off-by: Nick Desaulniers --- include/linux/cache.h | 6 +++--- include/linux/compiler.h| 8 include/linux/cpu.h | 2 +- include/linux/export.h

[PATCH 15/16] include/linux/compiler.h: remove unused KENTRY macro

2019-08-12 Thread Nick Desaulniers
This macro is not used throughout the kernel. Delete it rather than update the __section to be a fully spelled out __attribute__((__section__())) to avoid https://bugs.llvm.org/show_bug.cgi?id=42950. Signed-off-by: Nick Desaulniers --- include/linux/compiler.h | 23 --- 1

Re: [PATCH v3 13/17] mvpp2: no need to check return value of debugfs_create functions

2019-08-12 Thread Nick Desaulniers
On Mon, Aug 12, 2019 at 12:01 PM Greg Kroah-Hartman wrote: > > On Mon, Aug 12, 2019 at 10:55:51AM -0700, Nick Desaulniers wrote: > > On Sat, Aug 10, 2019 at 3:17 AM Greg Kroah-Hartman > > wrote: > > > > > > When calling debugfs functions, there is no need

Re: [PATCH v3 13/17] mvpp2: no need to check return value of debugfs_create functions

2019-08-12 Thread Nick Desaulniers
the comment block above the definition of debugfs_create_dir() in fs/debugfs/inode.c would help prevent this issue in the future? What failure means, and how to proceed can be tricky; more documentation can only help in this regard. > > Cc: "David S. Miller" > Cc: Maxime Che

Re: [PATCH net v2 1/2] ipv6: constify rt6_nexthop()

2019-06-24 Thread Nick Desaulniers
On Mon, Jun 24, 2019 at 10:22 AM David Miller wrote: > > From: Nick Desaulniers > Date: Mon, 24 Jun 2019 10:17:03 -0700 > > > On Mon, Jun 24, 2019 at 10:06 AM David Miller wrote: > >> And you mean just changing to 'const' fixes something, how? > > >

Re: [PATCH net v2 1/2] ipv6: constify rt6_nexthop()

2019-06-24 Thread Nick Desaulniers
On Mon, Jun 24, 2019 at 10:06 AM David Miller wrote: > > From: Nick Desaulniers > Date: Mon, 24 Jun 2019 09:45:14 -0700 > > > https://groups.google.com/forum/#!searchin/clang-built-linux/const%7Csort:date/clang-built-linux/umkS84jS9m8/GAVVEgNYBgAJ > > Inaccessible..

Re: [PATCH net v2 1/2] ipv6: constify rt6_nexthop()

2019-06-24 Thread Nick Desaulniers
this fixes an issues reported by 0day: https://groups.google.com/forum/#!searchin/clang-built-linux/const%7Csort:date/clang-built-linux/umkS84jS9m8/GAVVEgNYBgAJ Reported-by: kbuild test robot Acked-by: Nick Desaulniers > --- > drivers/net/vrf.c| 2 +- > include/net/ip6_ro

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

2019-03-08 Thread Nick Desaulniers
rnings") Was initially confused by the link (thought I caught the 3 previous instances in code review of df103170854e). I see now that I did not report stmmac_ptp.c (only stmmac_main.c) properly. Had I, this could have been bundled up into df103170854e indeed. Sorry. Thanks for circling

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

2019-03-07 Thread Nick Desaulniers
alized] > > The default case can never happen because i can only be 0 to 3 > (NIU_L3_PROG_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). Good

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

2019-03-07 Thread Nick Desaulniers
here. > > Link: https://github.com/ClangBuiltLinux/linux/issues/382 > Suggested-by: Nick Desaulniers > Signed-off-by: Nathan Chancellor Thanks for the quick fix! Reviewed-by: Nick Desaulniers > --- > net/wireless/util.c | 6 -- > 1 file changed, 4 insertions(+), 2 del

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

2019-03-07 Thread Nick Desaulniers
ntend to bail out here. > > Link: https://github.com/ClangBuiltLinux/linux/issues/399 > Signed-off-by: Nathan Chancellor Thanks for the simple fix. Reviewed-by: Nick Desaulniers > --- > drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 4 +++- > 1 file changed, 3 insertions(+), 1

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

2019-03-07 Thread Nick Desaulniers
iables. 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.com/ClangBuiltLinux/linux/issues/384 > Suggested-by: Nick Desaulniers >

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

2019-03-07 Thread Nick Desaulniers
ang-format could or could not handle that rule* Thanks for sending the patch Nathan; if you could resend with the declaration order changed so that the line width decreases going down in the order, you can add my Reviewed-by tag. -- Thanks, ~Nick Desaulniers

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

2019-03-01 Thread Nick Desaulniers
vate flags to userspace ethtool. So the variable declaration should get a `__unused` annotation then (and maybe a comment)? -- Thanks, ~Nick Desaulniers

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

2019-02-21 Thread Nick Desaulniers
langBuiltLinux/linux/issues/372 > Suggested-by: Arnd Bergmann > Signed-off-by: Nathan Chancellor > --- > > v1 -> v2: > > * Fix logic (as the return value of div{,64}_s64 must be used), thanks > to Arnd for the review. oh boy, sorry I missed that in the initial code

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

2019-02-19 Thread Nick Desaulniers
round trip time average (RTT avg) should ever be negative. General rule of thumb for C is to keep arithmetic signed (even when working with non zero values), so rather than make the literal () a unsigned long, I agree with your change to keep the division signed as well. Thanks for the fix

Re: [PATCH v2] isdn: avm: Fix string plus integer warning from Clang

2019-01-10 Thread Nick Desaulniers
" is used elsewhere in the kernel and > can be deduplicated at the linking stage. > > Link: https://github.com/ClangBuiltLinux/linux/issues/309 > Suggested-by: Nick Desaulniers Thanks for sending the v2. I'll leave review to the maintainers to confirm my suspicions a

Re: [PATCH] iavf: Use printf instead of gnu_printf for iavf_debug_d

2019-01-10 Thread Nick Desaulniers
706..c90cafb526d0 100644 > --- a/drivers/net/ethernet/intel/iavf/iavf_osdep.h > +++ b/drivers/net/ethernet/intel/iavf/iavf_osdep.h > @@ -46,7 +46,7 @@ struct iavf_virt_mem { > > #define iavf_debug(h, m, s, ...) iavf_debug_d(h, m, s, ##__VA_ARGS__) > extern void iavf_debug_d(void *hw, u32 mask, char *fmt_str, ...) > - __attribute__ ((format(gnu_printf, 3, 4))); > + __printf(3, 4); And you make use of the __attribute__ wrapper from include/linux/compiler_attributes.h, cool. Reviewed-by: Nick Desaulniers -- Thanks, ~Nick Desaulniers

Re: [PATCH] isdn: avm: Fix string plus integer warning from Clang

2019-01-08 Thread Nick Desaulniers
AVM_MAXVERSION; j++) > - cinfo->version[j] = "\0\0" + 1; > + cinfo->version[j] = "\0"; > for (i = 0, j = 0; > j < AVM_MAXVERSION && i < cinfo->versionlen; > j++, i += cinfo->versionbuf[i] + 1) > -- > 2.20.1 > -- Thanks, ~Nick Desaulniers

Re: [PATCH RFC 1/4] include/linux/compiler*.h: fix OPTIMIZER_HIDE_VAR

2019-01-08 Thread Nick Desaulniers
ested with gcc and clang. > > Fixes: 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually > exclusive") > Cc: Eli Friedman > Cc: Joe Perches > Cc: Nick Desaulniers > Cc: Linus Torvalds > Signed-off-by: Michael S. Tsirkin Also for more contex

Re: [PATCH net] perf/bpf: fix a clang compilation issue

2017-09-13 Thread Nick Desaulniers
; >> The fix is to use a fixed array length instead. >> >> Reported-by: Nick Desaulniers >> Signed-off-by: Yonghong Song > > Applied. -- Thanks, ~Nick Desaulniers

Re: [PATCH v2] netfilter: nf_nat_h323: fix logical-not-parentheses warning

2017-08-24 Thread Nick Desaulniers
bumping for review (resending, had gmail set to html mode) On Mon, Aug 14, 2017 at 10:36 AM, Nick Desaulniers wrote: > Minor nit for the commit message that can get fixed up when being merged: > > On Fri, Aug 11, 2017 at 11:16 AM, Nick Desaulniers > wrote: > >&g

Re: [PATCH v2] netfilter: nf_nat_h323: fix logical-not-parentheses warning

2017-08-14 Thread Nick Desaulniers
Minor nit for the commit message that can get fixed up when being merged: On Fri, Aug 11, 2017 at 11:16 AM, Nick Desaulniers wrote: > if (x) > return > ... > > rather than: > > if (!x == 0) should remove the `!`, ex: if (x == 0) > ... > else > return -- Thanks, ~Nick Desaulniers

[PATCH v2] netfilter: nf_nat_h323: fix logical-not-parentheses warning

2017-08-11 Thread Nick Desaulniers
to be missing in one instance. Signed-off-by: Nick Desaulniers --- Changes in v2: * Reorder if/else blocks to return early. * Also handle this for set_h245_addr(), not just set_h225_addr(). * Add return code check for the Gnomemeeting case. net/ipv4/netfilte

Re: [PATCH] netfilter: nf_nat_h323: fix logical-not-parentheses warning

2017-08-08 Thread Nick Desaulniers
bumping for review On Mon, Jul 31, 2017 at 11:39 AM, Nick Desaulniers wrote: > Clang produces the following warning: > > net/ipv4/netfilter/nf_nat_h323.c:553:6: error: > logical not is only applied to the left hand side of this comparison > [-Werror,-Wlogical-not-pa

[PATCH] netfilter: nf_nat_h323: fix logical-not-parentheses warning

2017-07-31 Thread Nick Desaulniers
o evaluate the comparison first add parentheses around left hand side expression to silence this warning There's not necessarily a bug here, but it's cleaner to use the form: if (x != 0) rather than: if (!x == 0) Signed-off-by: Nick Desaulniers --- Also, it's even cleaner to use th