Re: [PATCH] net/mlx5e: Move priv variable into case statement in mlx5e_setup_tc

2019-07-10 Thread Nathan Chancellor
On Wed, Jul 10, 2019 at 11:02:00PM -0700, Saeed Mahameed wrote: > On Wed, Jul 10, 2019 at 12:05 PM Nathan Chancellor > wrote: > > > > There is an unused variable warning on arm64 defconfig when > > CONFIG_MLX5_ESWITCH is unset: > > > > drivers/net/ethernet/

Re: [PATCH] rdma/siw: Use proper enumerated type in map_cqe_status

2019-07-11 Thread Nathan Chancellor
Hi Bernard, On Thu, Jul 11, 2019 at 07:44:22AM +, Bernard Metzler wrote: > Nathan, thanks very much. That's correct. Thanks for the confirmation that the fix was correct. > I don't know how this could pass w/o warning. Unfortunately, it appears that GCC only warns when two different enumera

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

2019-01-08 Thread Nathan Chancellor
On Tue, Jan 08, 2019 at 09:50:39AM -0800, Nick Desaulniers wrote: > On Mon, Jan 7, 2019 at 9:07 PM Nathan Chancellor > wrote: > > > > A recent commit in Clang expanded the -Wstring-plus-int warning, showing > > some odd behavior in this file. > > > > drivers/is

Clang warning in drivers/gpu/drm/i915/i915_debugfs.c

2019-01-08 Thread Nathan Chancellor
Hi all, Commit e845f099f1c6 ("drm/i915/dsc: Add Per connector debugfs node for DSC support/enable") causes a Clang warning: drivers/gpu/drm/i915/i915_debugfs.c:4961:17: warning: address of array 'intel_dp->dsc_dpcd' will always evaluate to 'true' [-Wpointer-bool-conversion] if (i

[PATCH v2] nfit: Mark some functions as __maybe_unused

2019-01-08 Thread Nathan Chancellor
is set. Fixes: 4c6926a23b76 ("acpi/nfit, libnvdimm: Add unlock of nvdimm support for Intel DIMMs") Suggested-by: Dan Williams Signed-off-by: Nathan Chancellor --- v1 -> v2: * Mark the functions as __maybe_unused rather than expanding the CONFIG_X86, as requested by Dan. driv

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

2019-01-09 Thread Nathan Chancellor
nu_strftime", "strftime" }, { "gnu_strfmon", "strfmon" }, { NULL, NULL } }; The mentioned override only happens on Windows (mingw32). Changing from gnu_printf to printf is a no-op for GCC and stops Clang from warning. Link: ht

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

2019-01-09 Thread Nathan Chancellor
arning generated. This is equivalent to just "\0". Nick pointed out that it is smarter to use "" instead of "\0" because "" is used elsewhere in the kernel and can be deduplicated at the linking stage. Link: https://github.com/ClangBuiltLinux/linux/issu

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

2019-03-08 Thread Nathan Chancellor
t value. Use 9600 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/ser

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'

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] 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 > > > wrote: &

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

2019-03-11 Thread Nathan Chancellor
passing around pointers to > 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/xf

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 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 1917d42d14b7

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

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). A

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 >

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-uni

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

2019-03-22 Thread Nathan Chancellor
= NULL > > 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 sugge

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] > > T

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

2019-03-22 Thread Nathan Chancellor
Jonathan's testing branch: https://git.kernel.org/pub/scm/linux/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] ALSA: hda/ca0132: work around clang -Wuninitialized warning

2019-03-22 Thread Nathan Chancellor
ly this is not very intuitive here. > > > > 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

Re: [PATCH] selinux: avoid uninitialized variable warning

2019-03-22 Thread Nathan Chancellor
of CONFIG_IPV6 is disabled, but it's better 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(-) > > di

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

2019-03-22 Thread Nathan Chancellor
note: remove the 'if' 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 > > Rearrang

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

2019-02-18 Thread Nathan Chancellor
-dc7a-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/

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

2019-03-22 Thread Nathan Chancellor
ow of this function. I 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 > --- >

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

2019-03-22 Thread Nathan Chancellor
> > This cannot happen in practice because we only enter the loop > if there is at least one element 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 l

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 opti

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

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] 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] mmc: pxamci: fix enum type confusion

2019-03-07 Thread Nathan Chancellor
rect, so this must be a simply typo from > 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

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] ASoC: ams-delta: remove duplicate 'const'

2019-03-07 Thread Nathan Chancellor
UM_SINGLE_EXT(ARRAY_SIZE(xtexts), > 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.

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

2019-03-07 Thread Nathan Chancellor
/restore > 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 a3a67a8f0f5

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] 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] 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 > (TRANSFER_FUNC_UNKNO

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] [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"

[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

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

2019-03-07 Thread Nathan Chancellor
lized whenever 'if' condition 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-

[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] iio: adc: stmpe-adc: Shuffle an if statement around in stmpe_adc_isr

2019-03-07 Thread Nathan Chancellor
use the two if statements 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 Cha

[PATCH] ACPI / sysfs: Restructure get_status

2019-03-07 Thread Nathan Chancellor
just direct returning 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

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

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 trun

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

2019-03-07 Thread Nathan Chancellor
called in the middle 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: N

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

2019-03-07 Thread Nathan Chancellor
tialize hw->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:

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

2019-03-07 Thread Nathan Chancellor
sis phase (plus inline 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

[PATCH] bcache: Zero initialize bucket in bch_allocator_thread

2019-03-07 Thread Nathan Chancellor
Link: https://github.com/ClangBuiltLinux/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/m

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

2019-03-07 Thread Nathan Chancellor
n issue because the value 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: N

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

2019-03-07 Thread Nathan Chancellor
ang understands 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.

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

2019-03-07 Thread Nathan Chancellor
called to initialize 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 t

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

2019-03-07 Thread Nathan Chancellor
ning that we never called 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 matche

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

2019-03-07 Thread Nathan Chancellor
ning that we never called 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/

[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] 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] 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

-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] xfs: Zero initialize highstale and lowstale in xfs_dir2_leafn_add

2019-03-07 Thread Nathan Chancellor
passed to xfs_dir3_leaf_find_entry, where 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/3

-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 [-Wsometimes-unini

-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

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

2019-03-07 Thread Nathan Chancellor
inux/linux/issues/415 Signed-off-by: Nathan Chancellor --- Alternatively, this can be solved by having the return value of local_clock_us(&this_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(

[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,

Patch series for 4.19 to compile powerpc with Clang

2019-01-10 Thread Nathan Chancellor
Hi Greg and Sasha, Attached is an mbox with a series of patches to allow building the powerpc kernel with Clang. We have been running continuous integration that builds and boots the kernel in QEMU for almost two months now with no regressions. This is on top of 4.19.14, there should be no conflic

Patch series for 4.14 to compile powerpc with Clang

2019-01-10 Thread Nathan Chancellor
Hi Greg and Sasha, Attached is an mbox with a series of patches to allow building the powerpc kernel with Clang. We have been running continuous integration that builds and boots the kernel in QEMU for almost two months now with no regressions. This is on top of 4.14.92, there should be no conflic

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

2019-01-10 Thread Nathan Chancellor
On Thu, Jan 10, 2019 at 10:54:46AM -0800, Nick Desaulniers wrote: > On Wed, Jan 9, 2019 at 8:22 PM Nathan Chancellor > wrote: > > > > Clang warns: > > > > In file included from drivers/net/ethernet/intel/iavf/iavf_main.c:4: > > In file included from drive

Re: [PATCH] dmaengine: ep93xx: Return proper enum in ep93xx_dma_chan_direction

2018-09-12 Thread Nathan Chancellor
On Wed, Sep 12, 2018 at 10:00:57AM -0700, Nick Desaulniers wrote: > On Tue, Sep 11, 2018 at 4:40 PM Nathan Chancellor > wrote: > > > > Clang warns when implicitly converting from one enumerated type to > > another. Avoid this by using the equivalent value from the expec

Re: [PATCH 4.4 00/60] 4.4.156-stable review

2018-09-13 Thread Nathan Chancellor
On Thu, Sep 13, 2018 at 03:30:07PM +0200, Greg Kroah-Hartman wrote: > This is the start of the stable review cycle for the 4.4.156 release. > There are 60 patches in this series, all will be posted as a response > to this one. If anyone has any issues with these being applied, please > let me know

Re: [PATCH 4.9 00/78] 4.9.127-stable review

2018-09-13 Thread Nathan Chancellor
On Thu, Sep 13, 2018 at 03:30:47PM +0200, Greg Kroah-Hartman wrote: > This is the start of the stable review cycle for the 4.9.127 release. > There are 78 patches in this series, all will be posted as a response > to this one. If anyone has any issues with these being applied, please > let me know

Re: [PATCH 4.14 000/115] 4.14.70-stable review

2018-09-13 Thread Nathan Chancellor
On Thu, Sep 13, 2018 at 03:30:20PM +0200, Greg Kroah-Hartman wrote: > This is the start of the stable review cycle for the 4.14.70 release. > There are 115 patches in this series, all will be posted as a response > to this one. If anyone has any issues with these being applied, please > let me kno

[PATCH] drbd: Change drbd_request_detach_interruptible's return type to int

2018-09-13 Thread Nathan Chancellor
rv = ERR_INTR; ~ ^~~~ drbd_request_detach_interruptible's only call site is in the return statement of adm_detach, which returns an int. Change the return type of drbd_request_detach_interruptible to match, silencing Clang's warning. Reported-by: Nick Desaulniers Si

[PATCH] iio: adc: max9611: Avoid implicit enum conversion warning

2018-09-14 Thread Nathan Chancellor
*csa_gain = gain_selectors[i]; ~ ^ 1 warning generated. Change the type of the variable 'gain_selectors' to int so that Clang understands this is expected behavior. Reported-by: Nick Desaulniers Signed-off-by: Nathan Chancellor ---

[PATCH] misc: echo: Remove unnecessary parentheses and simplify check for zero

2018-09-14 Thread Nathan Chancellor
if ((ec->nonupdate_dwell == 0)) { ^~ = 1 warning generated. Remove them and while we're at it, simplify the zero check as '!var' is used more than 'var == 0'. Reported-by: Nick Desaulniers Si

Re: [PATCH 4.4 00/70] 4.4.158-stable review

2018-09-24 Thread Nathan Chancellor
On Mon, Sep 24, 2018 at 01:51:59PM +0200, Greg Kroah-Hartman wrote: > This is the start of the stable review cycle for the 4.4.158 release. > There are 70 patches in this series, all will be posted as a response > to this one. If anyone has any issues with these being applied, please > let me know

Re: [PATCH 4.9 000/111] 4.9.129-stable review

2018-09-24 Thread Nathan Chancellor
On Mon, Sep 24, 2018 at 01:51:27PM +0200, Greg Kroah-Hartman wrote: > This is the start of the stable review cycle for the 4.9.129 release. > There are 111 patches in this series, all will be posted as a response > to this one. If anyone has any issues with these being applied, please > let me kno

Re: [PATCH 4.14 000/173] 4.14.72-stable review

2018-09-24 Thread Nathan Chancellor
On Mon, Sep 24, 2018 at 01:50:34PM +0200, Greg Kroah-Hartman wrote: > This is the start of the stable review cycle for the 4.14.72 release. > There are 173 patches in this series, all will be posted as a response > to this one. If anyone has any issues with these being applied, please > let me kno

[PATCH] iw_cxgb4: Use proper enumerated type in c4iw_bar2_addrs

2018-09-24 Thread Nathan Chancellor
T4_BAR2_QTYPE_EGRESS = CXGB4_BAR2_QTYPE_EGRESS = 0 T4_BAR2_QTYPE_INGRESS = CXGB4_BAR2_QTYPE_INGRESS = 1 Reported-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- drivers/infiniband/hw/cxgb4/cq.c | 2 +- drivers/infiniband/hw/cxgb4/qp.c | 7 --- 2 files changed, 5 insertions(+), 4 deleti

[PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-24 Thread Nathan Chancellor
gs. Make that clear to Clang by changing the create_flags type to u32. Reported-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- include/rdma/ib_verbs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index e463d30

Re: [PATCH] drm/amd/display: Change status's type in aux_reply_transaction_data

2018-09-24 Thread Nathan Chancellor
On Mon, Sep 24, 2018 at 03:07:16PM -0700, Nick Desaulniers wrote: > On Fri, Sep 21, 2018 at 2:55 PM Nathan Chancellor > wrote: > > > > Clang warns when one enumerated type is implicitly converted to another. > > > > drivers/gpu/drm/amd/amdgpu/../display/dc

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-24 Thread Nathan Chancellor
On Mon, Sep 24, 2018 at 03:24:36PM -0700, Nick Desaulniers wrote: > On Mon, Sep 24, 2018 at 12:57 PM Nathan Chancellor > wrote: > > > > Clang warns when one enumerated type is implicitly converted to another. > > > > drivers/infiniband/hw/mlx4/mad.c:1811:41: warning

[PATCH] pinctrl: generic: Avoid several implicit enum conversions

2018-09-24 Thread Nathan Chancellor
Clang that this is allowed by changing param's type in all of these instances to int so no conversion needs to happen. Link: https://github.com/ClangBuiltLinux/linux/issues/138 Signed-off-by: Nathan Chancellor --- include/linux/pinctrl/pinconf-generic.h | 6 +++--- 1 file changed, 3 inser

[PATCH v2] mtd: spi-nor: cadence-quadspi: Use proper enum for dma_unmap_single

2018-09-25 Thread Nathan Chancellor
dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, 0) ~~ ^ 2 warnings generated. Use the proper enums from dma_data_direction to satisfy Clang. DMA_FROM_DEVICE = DMA_DEV_TO_MEM = 2 Link: https://github.com/ClangBuiltLinux/linux/issues/108 Signed-off-by: Nathan Chancellor ---

Re: [PATCH] mtd: spi-nor: cadence-quadspi: Use proper enum for dma_unmap_single

2018-09-25 Thread Nathan Chancellor
On Tue, Sep 25, 2018 at 10:24:04AM +0300, Tudor Ambarus wrote: > Hi, Nathan, > > On 09/21/2018 01:29 PM, Nathan Chancellor wrote: > > Clang warns when one enumerated type is converted implicitly to another. > > > > drivers/mtd/spi-nor/cadence-quadspi.c:962:47: warni

Re: [PATCH] pinctrl: generic: Avoid several implicit enum conversions

2018-09-25 Thread Nathan Chancellor
On Tue, Sep 25, 2018 at 12:58:16PM +0200, Linus Walleij wrote: > On Tue, Sep 25, 2018 at 8:19 AM Nathan Chancellor > wrote: > > > Clang warns when one enumerated type is implicitly converted to another, > > which happens several times in the pinctrl drivers for a few r

[PATCH v2] staging: rtl8188eu: Simplify memcmp logical checks

2018-09-25 Thread Nathan Chancellor
gt; if (0 == 0) -> if (true) Alternatively: if (!1 == 0) -> if (!!1) -> if (1) Simplify these comparisons so that Clang doesn't complain. Link: https://github.com/ClangBuiltLinux/linux/issues/161 Signed-off-by: Nathan Chancellor --- v1 -> v2: * Fix missing parenthesis in last hunk

Re: [PATCH] staging: rtl8188eu: Simplify memcmp logical checks

2018-09-25 Thread Nathan Chancellor
On Tue, Sep 25, 2018 at 09:07:11PM +0200, Greg Kroah-Hartman wrote: > On Thu, Sep 20, 2018 at 05:22:21PM -0700, Nathan Chancellor wrote: > > Clang generates a warning when it sees a logical not followed by a > > conditional operator like ==, >, or < because it thinks tha

[PATCH] arm64: percpu: Initialize ret in the default case

2018-09-25 Thread Nathan Chancellor
ning appears several times while building the erofs filesystem. While it's not strictly wrong, the BUILD_BUG will prevent this from becoming a true problem. Initialize ret to 0 in the default case right before the BUILD_BUG to silence all of these warnings. Reported-by: Prasad Sodagudi Signed-

[PATCH] platform/x86: mlx-platform: Properly use mlxplat_mlxcpld_msn201x_items

2018-09-25 Thread Nathan Chancellor
first added. Use the definition in mlxplat_mlxcpld_msn201x_data so that Clang no longer warns. Link: https://github.com/ClangBuiltLinux/linux/issues/141 Fixes: a49a41482f61 ("platform/x86: mlx-platform: Add support for new msn201x system type") Signed-off-by: Nathan Chancellor --- drivers/p

[PATCH] staging: rtl8723bs: Remove ACPI table declaration

2018-09-25 Thread Nathan Chancellor
Remove it since it's not doing anything. Link: https://github.com/ClangBuiltLinux/linux/issues/169 Signed-off-by: Nathan Chancellor --- drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/s

Re: [PATCH] staging: rtl8723bs: Remove ACPI table declaration

2018-09-25 Thread Nathan Chancellor
On Wed, Sep 26, 2018 at 08:22:45AM +0200, Greg Kroah-Hartman wrote: > On Tue, Sep 25, 2018 at 10:39:10PM -0700, Nathan Chancellor wrote: > > Clang warns that the acpi_id declaration is not going to be emitted > > in the final assembly: > > > > drivers/staging/rtl8723

Re: [PATCH] staging: rtl8723bs: Remove ACPI table declaration

2018-09-25 Thread Nathan Chancellor
On Wed, Sep 26, 2018 at 08:49:15AM +0200, Greg Kroah-Hartman wrote: > On Tue, Sep 25, 2018 at 11:44:37PM -0700, Nathan Chancellor wrote: > > On Wed, Sep 26, 2018 at 08:22:45AM +0200, Greg Kroah-Hartman wrote: > > > On Tue, Sep 25, 2018 at 10:39:10PM -0700, Nathan Chancellor wr

[PATCH] staging: rtl8723bs: Mark ACPI table declaration as maybe unused

2018-09-26 Thread Nathan Chancellor
generated. Mark the declaration as maybe unused like a few other instances of this construct in the kernel. Link: https://github.com/ClangBuiltLinux/linux/issues/169 Signed-off-by: Nathan Chancellor --- drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

Re: [PATCH] staging: rtl8723bs: Mark ACPI table declaration as maybe unused

2018-09-26 Thread Nathan Chancellor
On Wed, Sep 26, 2018 at 09:13:59AM +0200, Greg Kroah-Hartman wrote: > On Wed, Sep 26, 2018 at 12:02:09AM -0700, Nathan Chancellor wrote: > > Clang emits the following warning: > > > > drivers/staging/rtl8723bs/os_dep/sdio_intf.c:25:36: warning: variable > > 'acpi

[PATCH] fs/exofs: Remove ignored __weak attribute

2018-09-30 Thread Nathan Chancellor
xofs: Kbuild, Headers and osd utils"). Reported-by: Nick Desaulniers Reviewed-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- fs/exofs/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/exofs/common.h b/fs/exofs/common.h index 7d88ef566213..45da

Re: [PATCH v2] PCI: kirin: Fix section mismatch warning

2018-10-01 Thread Nathan Chancellor
On Mon, Oct 01, 2018 at 03:53:41PM +0100, Lorenzo Pieralisi wrote: > On Thu, Sep 20, 2018 at 11:58:28AM +0100, Lorenzo Pieralisi wrote: > > [+Paul] > > > > On Wed, Sep 19, 2018 at 02:08:08PM -0700, Nick Desaulniers wrote: > > > On Wed, Sep 19, 2018 at 11:55 AM

Re: [PATCH 4.9 00/94] 4.9.131-stable review

2018-10-02 Thread Nathan Chancellor
On Tue, Oct 02, 2018 at 06:24:14AM -0700, Greg Kroah-Hartman wrote: > This is the start of the stable review cycle for the 4.9.131 release. > There are 94 patches in this series, all will be posted as a response > to this one. If anyone has any issues with these being applied, please > let me know

Re: [PATCH 4.14 000/137] 4.14.74-stable review

2018-10-02 Thread Nathan Chancellor
On Tue, Oct 02, 2018 at 06:23:21AM -0700, Greg Kroah-Hartman wrote: > This is the start of the stable review cycle for the 4.14.74 release. > There are 137 patches in this series, all will be posted as a response > to this one. If anyone has any issues with these being applied, please > let me kno

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