scripts/selinux build error in 4.14 after glibc update

2019-04-22 Thread Nathan Chancellor
Hi all, After a glibc update to 2.29, my 4.14 builds started failing like so: $ make -j$(nproc) defconfig bzImage HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/zconf.lex.c HOSTCC scripts/kconfig/zconf.tab.o

[PATCH] arm64: futex: Restore oldval initialization to work around buggy compilers

2019-04-17 Thread Nathan Chancellor
ch64-linux-android-4.9/ Cc: sta...@vger.kernel.org Fixes: 045afc24124d ("arm64: futex: Fix FUTEX_WAKE_OP atomic ops with non-zero result value") Signed-off-by: Nathan Chancellor --- arch/arm64/include/asm/futex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ar

Re: [PATCH 4.9 72/76] arm64: futex: Fix FUTEX_WAKE_OP atomic ops with non-zero result value

2019-04-17 Thread Nathan Chancellor
On Wed, Apr 17, 2019 at 08:15:08AM +0200, Greg Kroah-Hartman wrote: > On Tue, Apr 16, 2019 at 09:47:51AM -0700, Nathan Chancellor wrote: > > On Tue, Apr 16, 2019 at 11:00:52AM +0200, Greg Kroah-Hartman wrote: > > > On Mon, Apr 15, 2019 at 03:01:51PM -0700, Nathan Chancellor wro

Re: [PATCH 4.9 72/76] arm64: futex: Fix FUTEX_WAKE_OP atomic ops with non-zero result value

2019-04-16 Thread Nathan Chancellor
On Tue, Apr 16, 2019 at 10:13:40AM +0100, Will Deacon wrote: > On Mon, Apr 15, 2019 at 03:01:51PM -0700, Nathan Chancellor wrote: > > On Mon, Apr 15, 2019 at 08:44:36PM +0200, Greg Kroah-Hartman wrote: > > > From: Will Deacon > > [...] > > > > @@ -53,2

Re: [PATCH 4.9 72/76] arm64: futex: Fix FUTEX_WAKE_OP atomic ops with non-zero result value

2019-04-16 Thread Nathan Chancellor
On Tue, Apr 16, 2019 at 11:00:52AM +0200, Greg Kroah-Hartman wrote: > On Mon, Apr 15, 2019 at 03:01:51PM -0700, Nathan Chancellor wrote: > > On Mon, Apr 15, 2019 at 08:44:36PM +0200, Greg Kroah-Hartman wrote: > > > From: Will Deacon > > > > > > commit 045a

Re: [PATCH 4.9 72/76] arm64: futex: Fix FUTEX_WAKE_OP atomic ops with non-zero result value

2019-04-15 Thread Nathan Chancellor
On Mon, Apr 15, 2019 at 08:44:36PM +0200, Greg Kroah-Hartman wrote: > From: Will Deacon > > commit 045afc24124d80c6998d9c770844c67912083506 upstream. > > Rather embarrassingly, our futex() FUTEX_WAKE_OP implementation doesn't > explicitly set the return value on the non-faulting path and

Re: [PATCH v2 2/4] s390: boot, purgatory: pass $(CLANG_FLAGS) where needed

2019-04-15 Thread Nathan Chancellor
) everywhere so we pass the correct --target=s390x-linux > option when cross-compiling. > > Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor > --- > arch/s390/Makefile | 4 ++-- > arch/s390/purgatory/Makefile | 1 + > 2 files changed, 3 insertion

Re: [PATCH] clocksource/drivers/timer-ti-dm: Remove omap_dm_timer_set_load_start

2019-04-11 Thread Nathan Chancellor
On Thu, Apr 11, 2019 at 01:56:57PM -0700, Tony Lindgren wrote: > Hi, > > * Daniel Lezcano [190411 19:21]: > > On 10/04/2019 22:07, Tony Lindgren wrote: > > > Hi, > > > > > > * Daniel Lezcano [190410 17:02]: > > >> can you ask for an acked-by before pulling a patch in your tree? > > > > > > I

Re: [PATCH] clocksource/drivers/timer-ti-dm: Remove omap_dm_timer_set_load_start

2019-04-11 Thread Nathan Chancellor
Nathan > >> On 04/04/2019 16:17, Tony Lindgren wrote: > >>> * Ladislav Michl [190327 08:12]: > >>>> Hello Nathan, > >>>> > >>>> On Tue, Mar 26, 2019 at 10:01:27PM -0700, Nathan Chancellor wrote: > >>>>>

Re: [PATCH 03/12] s390: purgatory: pass --target option to clang

2019-04-09 Thread Nathan Chancellor
On Tue, Apr 09, 2019 at 08:43:09AM +0200, Arnd Bergmann wrote: > On Tue, Apr 9, 2019 at 12:03 AM Nathan Chancellor > wrote: > > > > On Mon, Apr 08, 2019 at 11:26:16PM +0200, Arnd Bergmann wrote: > > > The purgatory Makefile does not inherit the original cflags

Re: [PATCH][next] acpi/hmat: fix uninitialized pointer dereference on pointer 'target'

2019-04-08 Thread Nathan Chancellor
Uninitialized pointer read") > Signed-off-by: Colin Ian King Reviewed-by: Nathan Chancellor > --- > drivers/acpi/hmat/hmat.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/acpi/hmat/hmat.c b/drivers/acpi/hmat/hmat.c > index b7824a0309

Re: [PATCH 07/12] s390: cio: fix cio_irb declaration

2019-04-08 Thread Nathan Chancellor
xpanded from macro '__PCPU_ATTRS' > __percpu __attribute__((section(PER_CPU_BASE_SECTION sec))) \ > ^ > Use DECLARE_PER_CPU_ALIGNED() here, to make the two match. > > Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor > --- >

Re: [PATCH 06/12] s390: ctcm: fix ctcm_new_device error return code

2019-04-08 Thread Nathan Chancellor
the return code > based on some earlier optimization step. > > Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor > --- > drivers/s390/net/ctcm_main.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_ma

Re: [PATCH 05/12] s390: zcrypt: initialize variables before_use

2019-04-08 Thread Nathan Chancellor
ions to all affected code paths to shut up the warning > and make the warning output consistent. > > Signed-off-by: Arnd Bergmann I'll never get used to seeing negative numbers assigned to unsigned integers... Reviewed-by: Nathan Chancellor > --- > drivers/s390/crypto/zcrypt_api.c

Re: [PATCH 04/12] s390: qeth: address type mismatch warning

2019-04-08 Thread Nathan Chancellor
: Arnd Bergmann I wonder if it is better to just change the func parameter to type long. I guess it's better to keep the type safety to make sure values aren't unintentionally mixed but the body of the functions is the same so does the type actually matter? Regardless, this change does fix the warni

Re: [PATCH 03/12] s390: purgatory: pass --target option to clang

2019-04-08 Thread Nathan Chancellor
0 > Would ifdef CONFIG_CC_IS_CLANG KBUILD_CFLAGS += --target=s390x-linux endif be a little clearer (and save a cc-option call)? Otherwise, makes sense. Reviewed-by: Nathan Chancellor

Re: [PATCH -next] pinctrl: artpec6: Make two functions static

2019-04-08 Thread Nathan Chancellor
On Thu, Mar 21, 2019 at 11:09:09PM +0800, Yue Haibing wrote: > From: YueHaibing > > Fix sparse warnings: > > drivers/pinctrl/pinctrl-artpec6.c:691:5: warning: > symbol 'artpec6_pmx_enable' was not declared. Should it be static? > drivers/pinctrl/pinctrl-artpec6.c:705:6: warning: > symbol

Re: [PATCH -next] acpi/hmat: fix an uninitialized memory_target

2019-04-07 Thread Nathan Chancellor
^~ > drivers/acpi/hmat/hmat.c:369:30: note: initialize the variable 'target' > to silence this warning > struct memory_target *target; > ^ > = NULL > > Si

Re: [PATCH v4] Makefile: lld: tell clang to use lld

2019-04-02 Thread Nathan Chancellor
nux/issues/366 > Link: https://github.com/ClangBuiltLinux/linux/issues/357 > Suggested-by: Nathan Chancellor > Suggested-by: Masahiro Yamada > Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor > --- > Changes V3->V4: > * Uncon

Re: [PATCH v3] Makefile: lld: tell clang to use lld

2019-04-02 Thread Nathan Chancellor
n cc-option is used. > > > > Link: https://github.com/ClangBuiltLinux/linux/issues/342 > > Link: https://github.com/ClangBuiltLinux/linux/issues/366 > > Link: https://github.com/ClangBuiltLinux/linux/issues/357 > > Suggested-by: Nathan Chancellor > > Suggested-by: M

Re: [PATCH v3] Makefile: lld: tell clang to use lld

2019-04-02 Thread Nathan Chancellor
//github.com/ClangBuiltLinux/linux/issues/357 > Suggested-by: Nathan Chancellor > Suggested-by: Masahiro Yamada > Signed-off-by: Nick Desaulniers > --- > Changes V2->V3: > * Use absolute path based on `which $LD` as per Masahiro. > * Add -Qunused-arguments. > * Drop tested-by/

Re: [PATCH 4.9 25/30] USB: core: only clean up what we allocated

2019-03-30 Thread Nathan Chancellor
On Tue, Mar 26, 2019 at 03:30:04PM +0900, Greg Kroah-Hartman wrote: > 4.9-stable review patch. If anyone has any objections, please let me know. > > -- > > From: Andrey Konovalov > > commit 32fd87b3bbf5f7a045546401dfe2894dbbf4d8c3 upstream. > > When cleaning up the

[PATCH] clocksource/drivers/timer-ti-dm: Remove omap_dm_timer_set_load_start

2019-03-26 Thread Nathan Chancellor
("clocksource/drivers/timer-ti-dm: Make omap_dm_timer_set_load_start() static") Signed-off-by: Nathan Chancellor --- My apologies if this has already been sent, I didn't see anything in tip or on LKML. drivers/clocksource/timer-ti-dm.c | 28 1 file changed,

Re: [RFCv2] string: Use faster alternatives when constant arguments are used

2019-03-23 Thread Nathan Chancellor
On Sat, Mar 23, 2019 at 07:24:06PM -0700, Sultan Alsawaf wrote: > I messed up the return value for strcat in the first patch. Here's a fixed > version, ready for some scathing reviews. > > From: Sultan Alsawaf > > When strcpy, strcat, and strcmp are used with a literal string, they can > be

[tip:x86/urgent] x86/hw_breakpoints: Make default case in hw_breakpoint_arch_parse() return an error

2019-03-22 Thread tip-bot for Nathan Chancellor
Commit-ID: e898e69d6b9475bf123f99b3c5d1a67bb7cb2361 Gitweb: https://git.kernel.org/tip/e898e69d6b9475bf123f99b3c5d1a67bb7cb2361 Author: Nathan Chancellor AuthorDate: Thu, 7 Mar 2019 14:27:56 -0700 Committer: Thomas Gleixner CommitDate: Fri, 22 Mar 2019 17:08:17 +0100 x86

Re: [PATCH] bcache: avoid clang -Wunintialized warning

2019-03-22 Thread Nathan Chancellor
ement in the list. > > Slightly rearranging the code makes this clearer to both the > reader and the compiler, which avoids the warning. > > Signed-off-by: Arnd Bergmann Yes, I like this much better than my patch, thanks! Reviewed-by: Nathan Chancellor > --- > drivers/md/b

Re: [PATCH] mfd: arizona: fix undefined behavior

2019-03-22 Thread Nathan Chancellor
agree that without restructuring it, zero initializing this variable to shut up the warning is the path of least resistance (clang must evaluate variables in isolation like I did until I fully read the commit message *facepalm*). Reviewed-by: Nathan Chancellor > --- > drivers/mfd/arizona-cor

Re: [PATCH] rxrpc: avoid clang -Wuninitialized warning

2019-03-22 Thread Nathan Chancellor
' if its condition is always > false > if (lost) > ^ > net/rxrpc/output.c:339:9: note: initialize the variable 'ret' to silence this > warning > int ret, opt; >^ > = 0 > > Rearrange the code to make that more obvious and

Re: [PATCH] selinux: avoid uninitialized variable warning

2019-03-22 Thread Nathan Chancellor
to rearrange the code > so this cannot happen. > > Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor > --- > security/selinux/netlabel.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/security/selinux/netlabel.c b/security/selinux/

Re: [PATCH] ALSA: hda/ca0132: work around clang -Wuninitialized warning

2019-03-22 Thread Nathan Chancellor
> > > Link: https://bugs.llvm.org/show_bug.cgi?id=41197#c1 > > Signed-off-by: Arnd Bergmann > > --- > > Any suggestions for other workarounds appreciated. If you can think > > of a better fix, please treat this as a reported-by: > > Can it be

Re: [PATCH] iio: ssp_sensors: avoid uninitialized variable usage

2019-03-22 Thread Nathan Chancellor
x/kernel/git/jic23/iio.git/commit/?id=0643039b4fee4aa54a233ead15dc0b2286f059d7 You made a good point previously that initializing the variable at the beginning of a function may not always be the best choice. I don't have a personal preference for which patch stays around so: Reviewed-by: Nathan Chancellor Just in case. Nathan

Re: [PATCH] iio: stmpe-adc: avoid harmless clang warning

2019-03-22 Thread Nathan Chancellor
On Fri, Mar 22, 2019 at 03:08:39PM +0100, Arnd Bergmann wrote: > Clang points out a control flow bug, which happens to be harmless: > > drivers/iio/adc/stmpe-adc.c:204:13: error: variable 'data' is used > uninitialized whenever 'if' condition is false > [-Werror,-Wsometimes-uninitialized] > >

Re: [PATCH] ALSA: hda/ca0132: work around clang -Wuninitialized warning

2019-03-22 Thread Nathan Chancellor
> Adding an explicit check for CONFIG_PCI avoids the issue. > Unfortunately this is not very intuitive here. > > Link: https://bugs.llvm.org/show_bug.cgi?id=41197#c1 > Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor > --- > Any suggestions for other workarounds appreciated

Re: [PATCH] soc: mediatek: pwrap: Zero initialize rdata in pwrap_init_cipher

2019-03-20 Thread Nathan Chancellor
On Thu, Mar 07, 2019 at 03:56:51PM -0700, Nathan Chancellor wrote: > When building with -Wsometimes-uninitialized, Clang warns: > > drivers/soc/mediatek/mtk-pmic-wrap.c:1358:6: error: variable 'rdata' is > used uninitialized whenever '||' condition is true > [-Werror,-Wsometime

Re: [PATCH] x86/hw_breakpoints: Return -EINVAL in default case in hw_breakpoint_arch_parse

2019-03-20 Thread Nathan Chancellor
On Thu, Mar 07, 2019 at 02:27:56PM -0700, Nathan Chancellor wrote: > When building with -Wsometimes-uninitialized, Clang warns: > > arch/x86/kernel/hw_breakpoint.c:355:2: warning: variable 'align' is used > uninitialized whenever switch default is taken > [-Wsometimes-uninitial

Re: [PATCH v4] lib/string.c: implement a basic bcmp

2019-03-13 Thread Nathan Chancellor
ttps://code.woboq.org/userspace/glibc/string/memcmp.c.html#bcmp > Link: > https://github.com/llvm/llvm-project/commit/8e16d73346f8091461319a7dfc4ddd18eedcff13 > Link: https://github.com/ClangBuiltLinux/linux/issues/416 > Cc: sta...@vger.kernel.org > Reported-by: Nathan Chancellor

Re: [PATCH] Makefile: Add '-fno-builtin-bcmp' to CLANG_FLAGS

2019-03-13 Thread Nathan Chancellor
On Wed, Mar 13, 2019 at 02:48:49PM +0100, Arnd Bergmann wrote: > On Wed, Mar 13, 2019 at 2:44 PM Nathan Chancellor > wrote: > > On Wed, Mar 13, 2019 at 09:13:11AM +0100, Rasmus Villemoes wrote: > > > Wouldn't it be better to just define bcmp as an alias for memcmp? Th

Re: [PATCH] Makefile: Add '-fno-builtin-bcmp' to CLANG_FLAGS

2019-03-13 Thread Nathan Chancellor
On Wed, Mar 13, 2019 at 09:13:11AM +0100, Rasmus Villemoes wrote: > On 12/03/2019 22.52, Nathan Chancellor wrote: > > After LLVM revision r355672 [1], all known working kernel configurations > > fail to link [2]: > > > > ld: init/do_mounts.o: in function `prepare_

[PATCH] Makefile: Add '-fno-builtin-bcmp' to CLANG_FLAGS

2019-03-12 Thread Nathan Chancellor
s/416 Link: https://bugs.llvm.org/show_bug.cgi?id=41035 Cc: sta...@vger.kernel.org Signed-off-by: Nathan Chancellor --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 9ef547fc7ffe..6645a274b6e3 100644 --- a/Makefile +++ b/Makefile @@ -501,6 +501,

Re: [PATCH] ACPI / sysfs: Restructure get_status

2019-03-11 Thread Nathan Chancellor
On Mon, Mar 11, 2019 at 11:56:27PM +0100, Rafael J. Wysocki wrote: > On Monday, March 11, 2019 11:46:14 PM CET Rafael J. Wysocki wrote: > > On Thursday, March 7, 2019 6:38:02 PM CET Nathan Chancellor wrote: > > > When building with -Wsometimes-uninitialized, Clang warns: > &g

Re: [PATCH 1/2] xfs: zero initialize highstale and lowstale in xfs_dir2_leaf_addname

2019-03-11 Thread Nathan Chancellor
uninitialized stack areas. > > Signed-off-by: Darrick J. Wong Reviewed-by: Nathan Chancellor Thanks for this! > --- > fs/xfs/libxfs/xfs_dir2_leaf.c |4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_dir2_leaf.c b/fs/xfs/l

Re: [PATCH] iio: common: ssp_sensors: Initialize calculated_time in ssp_common_process_data

2019-03-11 Thread Nathan Chancellor
On Mon, Mar 11, 2019 at 12:10:18PM +0100, Arnd Bergmann wrote: > On Sun, Mar 10, 2019 at 10:37 AM Jonathan Cameron wrote: > > On Thu, 7 Mar 2019 16:35:26 -0800 Nick Desaulniers > > wrote: > > > On Thu, Mar 7, 2019 at 1:46 PM Nathan Chancellor > > > wro

Re: [PATCH] xfs: clean up xfs_dir2_leafn_add

2019-03-08 Thread Nathan Chancellor
On Fri, Mar 08, 2019 at 03:11:14PM -0800, Darrick J. Wong wrote: > On Fri, Mar 08, 2019 at 10:42:59AM -0800, Nick Desaulniers wrote: > > On Fri, Mar 8, 2019 at 10:38 AM Darrick J. Wong > > wrote: > > > > > > On Fri, Mar 08, 2019 at 10:12:33AM -0800, Nick Desaulniers wrote: > > > > On Fri, Mar 8,

Re: [PATCH] scsi: gdth: Only call dma_free_coherent when buf is not NULL in ioc_general

2019-03-08 Thread Nathan Chancellor
On Fri, Mar 08, 2019 at 01:14:25PM -0800, Nick Desaulniers wrote: > On Thu, Mar 7, 2019 at 3:19 PM Nathan Chancellor > wrote: > > > > When building with -Wsometimes-uninitialized, Clang warns: > > > > drivers/scsi/gdth.c:3662:6: warning: variable 'paddr' is u

[PATCH] tty: serial: qcom_geni_serial: Initialize baud in qcom_geni_console_setup

2019-03-08 Thread Nathan Chancellor
as that is a sane default. Link: https://github.com/ClangBuiltLinux/linux/issues/395 Suggested-by: Greg Kroah-Hartman Signed-off-by: Nathan Chancellor --- drivers/tty/serial/qcom_geni_serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b

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

2019-03-07 Thread Nathan Chancellor
sues/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, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ne

[PATCH] drm/i915: Zero initialize this_cpu in busywait_stop

2019-03-07 Thread Nathan Chancellor
5 Signed-off-by: Nathan Chancellor --- Alternatively, this can be solved by having the return value of local_clock_us(_cpu) be a local variable but this seems less controversial. drivers/gpu/drm/i915/i915_request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/

-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-uninitialized Clang warning in drivers/tty/serial/qcom_geni_serial.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/tty/serial/qcom_geni_serial.c:1079:6: warning: variable 'baud' is used uninitialized whenever 'if' condition is false

[PATCH] xfs: Zero initialize highstale and lowstale in xfs_dir2_leafn_add

2019-03-07 Thread Nathan Chancellor
they are initialized before use when compact is zero. Regardless, it's better not to be passing around uninitialized stack memory so zero initialize these variables, which silences this warning. Link: https://github.com/ClangBuiltLinux/linux/issues/393 Signed-off-by: Nathan Chancellor --- fs/xfs/libxfs

-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
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 Chancellor --- drivers/net/wireless

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

2019-03-07 Thread Nathan Chancellor
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: Nathan Chancellor --- net/wireless

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

2019-03-07 Thread Nathan Chancellor
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/niu.c | 1 + 1

[PATCH] scsi: gdth: Only call dma_free_coherent when buf is not NULL in ioc_general

2019-03-07 Thread Nathan Chancellor
dma_alloc_coherent and initialized paddr), which avoids this warning. Link: https://github.com/ClangBuiltLinux/linux/issues/402 Signed-off-by: Nathan Chancellor --- drivers/scsi/gdth.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index

[PATCH v2] scsi: qla4xxx: Don't call dma_free_coherent when buf is NULL

2019-03-07 Thread Nathan Chancellor
dma_alloc_coherent and initialized buf_dma. Fixes: 2a991c215978 ("[SCSI] qla4xxx: Boot from SAN support for open-iscsi") Link: https://github.com/ClangBuiltLinux/linux/issues/391 Signed-off-by: Nathan Chancellor --- v1 -> v2: * Check that buf is not NULL, which matches how dma_free_coheren

[PATCH] soc: mediatek: pwrap: Zero initialize rdata in pwrap_init_cipher

2019-03-07 Thread Nathan Chancellor
rdata, meaning that we will use some random uninitialized stack value in our print statement. Zero initialize rdata in case this happens. Link: https://github.com/ClangBuiltLinux/linux/issues/401 Signed-off-by: Nathan Chancellor --- I don't know if this is better or to just restructure

[PATCH] pwm: img: Turn final 'else if' into 'else' in img_pwm_config

2019-03-07 Thread Nathan Chancellor
that timebase cannot be used uninitialized. Link: https://github.com/ClangBuiltLinux/linux/issues/400 Signed-off-by: Nathan Chancellor --- drivers/pwm/pwm-img.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pwm/pwm-img.c b/drivers/pwm/pwm-img.c index 815f5333bb8f

[PATCH] drm/vmwgfx: Zero initialize handle in vmw_execbuf_process

2019-03-07 Thread Nathan Chancellor
of handle isn't used when user_fence_rep is NULL because vmw_execbuf_copy_fence_user returns immediately when that is the case. Just zero initialize this variable so that Clang no longer warns. Link: https://github.com/ClangBuiltLinux/linux/issues/397 Signed-off-by: Nathan Chancellor --- drivers

[PATCH] bcache: Zero initialize bucket in bch_allocator_thread

2019-03-07 Thread Nathan Chancellor
/linux/issues/396 Signed-off-by: Nathan Chancellor --- drivers/md/bcache/alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c index 5002838ea476..c72094901ac6 100644 --- a/drivers/md/bcache/alloc.c +++ b/drivers/md/bcache

[PATCH] iio: common: ssp_sensors: Initialize calculated_time in ssp_common_process_data

2019-03-07 Thread Nathan Chancellor
is merely a hint to the compiler). Fix this by just zero initializing calculated_time. Link: https://github.com/ClangBuiltLinux/linux/issues/394 Signed-off-by: Nathan Chancellor --- drivers/iio/common/ssp_sensors/ssp_iio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH] x86/hw_breakpoints: Return -EINVAL in default case in hw_breakpoint_arch_parse

2019-03-07 Thread Nathan Chancellor
len to one of the specified switch cases. We can easily silence Clang by just returning -EINVAL in the default case so that we can never use align without initializing it first. Link: https://github.com/ClangBuiltLinux/linux/issues/392 Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancel

[PATCH] scsi: qla4xxx: Don't call dma_free_coherent without dma_alloc_coherent

2019-03-07 Thread Nathan Chancellor
conditional statement. Use that same conditional to call dma_free_coherent so that buf_dma is always initialized when used. Fixes: 2a991c215978 ("[SCSI] qla4xxx: Boot from SAN support for open-iscsi") Link: https://github.com/ClangBuiltLinux/linux/issues/391 Signed-off-by: Nathan Chancellor --

Re: [PATCH 1/2] futex: mark futex_detect_cmpxchg() as 'noinline'

2019-03-07 Thread Nathan Chancellor
On Thu, Mar 07, 2019 at 10:12:11AM -0800, Nick Desaulniers wrote: > On Thu, Mar 7, 2019 at 1:15 AM Arnd Bergmann wrote: > > > > On 32-bit ARM, I got a link failure in futex_init() when building > > with clang in some random configurations: > > > > kernel/futex.o:(.text.fixup+0x5c): relocation

[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 attention :(

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

2019-03-07 Thread Nathan Chancellor
t 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 Reviewed-by: Nick Desaulniers Signed-off-by: Nathan Chancellor -

[PATCH] ACPI / sysfs: Restructure get_status

2019-03-07 Thread Nathan Chancellor
the value of the function. Link: https://github.com/ClangBuiltLinux/linux/issues/388 Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- drivers/acpi/sysfs.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c

[PATCH] iio: adc: stmpe-adc: Shuffle an if statement around in stmpe_adc_isr

2019-03-07 Thread Nathan Chancellor
take care of all cases. Remove the first if statement and make it the else branch of the second one so that it is apparent to Clang that all cases are covered. Link: https://github.com/ClangBuiltLinux/linux/issues/387 Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- drivers/iio

[PATCH] net: atm: Use IS_ENABLED in atm_dev_ioctl

2019-03-07 Thread Nathan Chancellor
. 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://gist.github.com/74650e9139f704a5435f82fc80d59969

[PATCH] btrfs: Turn an 'else if' into an 'else' in btrfs_uuid_tree_add

2019-03-07 Thread Nathan Chancellor
is false [-Wsometimes-uninitialized] Clang can't tell that all cases are covered with this final else if. Just turn it into an else so that it is clear. Link: https://github.com/ClangBuiltLinux/linux/issues/385 Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- fs/btrfs/uuid

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

2019-03-07 Thread Nathan Chancellor
t 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 Signed-off-by: Nathan Chancellor --- drivers/net/ethernet/stmicro/

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

2019-03-07 Thread Nathan Chancellor
de 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") > Signed-off-b

Re: [PATCH] ARM: omap2: remove incorrect __init annotation

2019-03-07 Thread Nathan Chancellor
_prm_enable_io_wakeup is wrong. > > When building with gcc, omap3xxx_prm_enable_io_wakeup() is always > inlined, so we never noticed in the past. > > Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor > --- > arch/arm/mach-omap2/prm3xxx.c | 2 +- > 1 file changed

Re: [PATCH] drm/amd/display: avoid passing enum as NULL pointer

2019-03-07 Thread Nathan Chancellor
On Thu, Mar 07, 2019 at 11:34:29AM +0100, Arnd Bergmann wrote: > The mod_freesync_build_vrr_infopacket() function uses rather obscure > calling conventions, where an enum is passed in through a pointer, > and a NULL pointer is expected to behave the same way as the zero-value >

Re: [PATCH] peak_usb: fix clang build warning

2019-03-07 Thread Nathan Chancellor
as 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/issues/109 Revi

Re: [PATCH] cpufreq: pxa2xx: remove incorrect __init annotation

2019-03-07 Thread Nathan Chancellor
ges(). > This is often because pxa_cpufreq_init lacks a __init > annotation or the annotation of pxa_cpufreq_init_voltages is wrong. > > Fixes: 50e77fcd790e ("ARM: pxa: remove __init from cpufreq_driver->init()") > Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor &g

Re: [PATCH] ASoC: davinci-mcasp: Fix clang warning without CONFIG_PM

2019-03-07 Thread Nathan Chancellor
> to use array") > Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor > --- > sound/soc/ti/davinci-mcasp.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c > index a3a67a8f0f54..9fbc759

Re: [PATCH] ASoC: ams-delta: remove duplicate 'const'

2019-03-07 Thread Nathan Chancellor
s), > xtexts) > > Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor > --- > sound/soc/ti/ams-delta.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sound/soc/ti/ams-delta.c b/sound/soc/ti/ams-delta.c > index 4dce494dfbd3..b96

Re: [PATCH] mmc: davinci: remove extraneous __init annotation

2019-03-07 Thread Nathan Chancellor
t; The function davinci_mmcsd_probe() references > the function __init init_mmcsd_host(). > This is often because davinci_mmcsd_probe lacks a __init > annotation or the annotation of init_mmcsd_host is wrong. > > Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor > --- >

Re: [PATCH] mmc: pxamci: fix enum type confusion

2019-03-07 Thread Nathan Chancellor
> dma_data_direction and dma_transfer_direction being similarly named > types with a similar purpose. > > Fixes: 6464b7140951 ("mmc: pxamci: switch over to dmaengine use") > Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor > --- > drivers/mmc/host/pxamc

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

2019-03-07 Thread Nathan Chancellor
er-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/isdnloop/isdnloop.c |

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

Re: [PATCH] x86/KASLR: always return a value from process_mem_region

2019-03-02 Thread Nathan Chancellor
probably have been placed > outside the #endif, so move it there > > Link: https://github.com/ClangBuiltLinux/linux/issues/360 > Signed-off-by: Louis Taylor Reviewed-by: Nathan Chancellor Thanks for the patch! > --- > arch/x86/boot/compressed/kaslr.c | 2 +- > 1 f

Re: [PATCH] x86/boot: clean up headers

2019-03-01 Thread Nathan Chancellor
iltLinux/linux/issues/347 > Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor > --- > Note that this only regresses for us on linux-next (not mainline). > > arch/x86/boot/string.c | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-

Re: [PATCH] tmpfs: fix uninitialized return value in shmem_link

2019-02-28 Thread Nathan Chancellor
On Wed, Feb 27, 2019 at 09:09:40AM -0500, Qian Cai wrote: > On Mon, 2019-02-25 at 16:07 -0800, Linus Torvalds wrote: > > On Mon, Feb 25, 2019 at 4:03 PM Qian Cai wrote: > > > > > > > > Of course, that's just gcc. I have no idea what llvm ends up doing. > > > > > > Clang 7.0: > > > > > > #

[PATCH] powerpc/xmon: Fix opcode being uninitialized in print_insn_powerpc

2019-02-25 Thread Nathan Chancellor
ation changes)") Link: https://github.com/ClangBuiltLinux/linux/issues/390 Signed-off-by: Nathan Chancellor --- arch/powerpc/xmon/ppc-dis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/xmon/ppc-dis.c b/arch/powerpc/xmon/ppc-dis.c index 9deea5ee13f6..27f1e6415

Re: Clang patches for 4.9

2019-02-25 Thread Nathan Chancellor
On Mon, Feb 25, 2019 at 09:46:56AM -0800, Nick Desaulniers wrote: > On Mon, Feb 25, 2019 at 9:35 AM Nathan Chancellor > wrote: > > > > On Mon, Feb 25, 2019 at 03:47:19PM +0100, Greg Kroah-Hartman wrote: > > > On Mon, Feb 25, 2019 at 03:45:13PM +0100, Greg Kroah-Hartman

Re: Clang patches for 4.9

2019-02-25 Thread Nathan Chancellor
On Mon, Feb 25, 2019 at 03:47:19PM +0100, Greg Kroah-Hartman wrote: > On Mon, Feb 25, 2019 at 03:45:13PM +0100, Greg Kroah-Hartman wrote: > > On Sun, Feb 24, 2019 at 11:13:01PM -0700, Nathan Chancellor wrote: > > > Hi Greg and Sasha, > > > > > > Attached are

Clang patches for 4.9

2019-02-24 Thread Nathan Chancellor
Hi Greg and Sasha, Attached are three mbox files containing patches that bring the Clang backports that Nick did in 4.9.139 up to date with what is currently in 4.14 and mainline, as well as fix warnings that are present in the arm64 and x86_64 defconfigs here and in AOSP (cuttlefish_defconfig).

Re: [PATCH] drm/amd/display: Pass app_tf by value rather than by reference

2019-02-22 Thread Nathan Chancellor
On Mon, Dec 10, 2018 at 04:42:01PM -0700, Nathan Chancellor wrote: > Clang warns when an expression that equals zero is used as a null > pointer constant (in lieu of NULL): > > drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:4435:3: > warning: expression which ev

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

2019-02-21 Thread Nathan Chancellor
. 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 of div{,64}_s64 must be used), thanks to Arnd f

[PATCH] staging: rtlwifi: Use proper enum for return in halmac_parse_psd_data_88xx

2019-02-20 Thread Nathan Chancellor
github.com/ClangBuiltLinux/linux/issues/375 Signed-off-by: Nathan Chancellor --- drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c b/drivers/staging/rtlw

Re: [PATCH] kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig

2019-02-20 Thread Nathan Chancellor
>for "make W=1"") turned off this option for GCC < 4.9 >Arnd provided more explanation in https://lkml.org/lkml/2017/3/14/903 > > I think this looks better by shifting the logic from Makefile to Kconfig. > I agree! > Signed-off-by: Masahiro Yamada Rev

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
. 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 changed, 1 insertion(+), 1 deletion(-) diff --git a/d

[PATCH] tee: optee: Initialize some structs using memset instead of braces

2019-02-19 Thread Nathan Chancellor
370 Signed-off-by: Nathan Chancellor --- drivers/tee/optee/device.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/tee/optee/device.c b/drivers/tee/optee/device.c index 5e4938bbef2b..167839b371f2 100644 --- a/drivers/tee/optee/device.c +++ b/drivers/tee/opte

[PATCH] hwrng: optee: Initialize some structs using memset instead of braces

2019-02-18 Thread Nathan Chancellor
-a45c-64187ecd9...@amd.com/ [2]: https://lore.kernel.org/lkml/20181128.215241.702406654469517539.da...@davemloft.net/ Fixes: 5fe8b1cc6a03 ("hwrng: add OP-TEE based rng driver") Link: https://github.com/ClangBuiltLinux/linux/issues/369 Signed-off-by: Nathan Chancellor --- drivers/char/hw_ra

[PATCH] arm64/neon: Disable -Wincompatible-pointer-types when building with Clang

2019-02-14 Thread Nathan Chancellor
w warnings/errors or boot failures can be caught and fixed quickly. Link: https://github.com/ClangBuiltLinux/linux/issues/283 Suggested-by: Ard Biesheuvel Signed-off-by: Nathan Chancellor --- arch/arm64/include/asm/neon-intrinsics.h | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm

Re: [PATCH RFC v2] fcoe: make use of fip_mode enum complete

2019-02-12 Thread Nathan Chancellor
On Tue, Feb 12, 2019 at 08:50:04AM +0100, Sedat Dilek wrote: > On Mon, Feb 11, 2019 at 6:53 PM Nathan Chancellor > wrote: > > > > On Mon, Feb 11, 2019 at 06:07:51PM +0100, Sedat Dilek wrote: > > > From: Sedat Dilek > > > > > > commit 1917d42d14

<    5   6   7   8   9   10   11   12   13   14   >