[PATCH v2] ext4: hash: simplify kzalloc(n * 1, ...) to kzalloc(n, ...)

2025-03-15 Thread Ethan Carter Edwards
sizeof(char) evaluates to 1. Remove the churn. Signed-off-by: Ethan Carter Edwards --- Changes in v2: - change back to kzalloc because sizeof(char) is 1. Nice catch. Thanks. - Link to v1: https://lore.kernel.org/r/20250315-ext4-hash-kcalloc-v1-1-a9132cb49...@ethancedwards.com --- fs/ext4

Re: [PATCH] ext4: hash: change kzalloc(n * sizeof, ...) to kcalloc(n, sizeof, ...)

2025-03-15 Thread Andreas Dilger
On Mar 15, 2025, at 9:28 PM, Matthew Wilcox wrote: > > On Sat, Mar 15, 2025 at 12:29:34PM -0400, Ethan Carter Edwards wrote: >> Open coded arithmetic in allocator arguments is discouraged. Helper >> functions like kcalloc are preferred. > > Well, yes, but ... > >> +++ b/fs/ext4/hash.c >> @@ -30

Re: [PATCH] ext4: hash: change kzalloc(n * sizeof, ...) to kcalloc(n, sizeof, ...)

2025-03-15 Thread Matthew Wilcox
On Sat, Mar 15, 2025 at 12:29:34PM -0400, Ethan Carter Edwards wrote: > Open coded arithmetic in allocator arguments is discouraged. Helper > functions like kcalloc are preferred. Well, yes, but ... > +++ b/fs/ext4/hash.c > @@ -302,7 +302,7 @@ int ext4fs_dirhash(const struct inode *dir, const cha

Re: [PATCH] iio: magnetometer: ak8974: Add __nonstring annotations for unterminated strings

2025-03-15 Thread Kees Cook
On Sat, Mar 15, 2025 at 06:31:25PM +, Jonathan Cameron wrote: > On Fri, 14 Mar 2025 11:31:09 +0100 > Linus Walleij wrote: > > > On Mon, Mar 10, 2025 at 11:23 PM Kees Cook wrote: > > > > > When a character array without a terminating NUL character has a static > > > initializer, GCC 15's -Wu

[PATCH v10 nf-next 2/3] netfilter: nf_flow_table_offload: Add nf_flow_encap_push() for xmit direct

2025-03-15 Thread Eric Woudstra
Loosely based on wenxu's patches: "nf_flow_table_offload: offload the vlan/PPPoE encap in the flowtable". Fixed double vlan and pppoe packets, almost entirely rewriting the patch. After this patch, it is possible to transmit packets in the fastpath with outgoing encaps, without using vlan- and/o

[PATCH v10 nf-next 1/3] net: pppoe: avoid zero-length arrays in struct pppoe_hdr

2025-03-15 Thread Eric Woudstra
Jakub Kicinski suggested following patch: W=1 C=1 GCC build gives us: net/bridge/netfilter/nf_conntrack_bridge.c: note: in included file (through ../include/linux/if_pppox.h, ../include/uapi/linux/netfilter_bridge.h, ../include/linux/netfilter_bridge.h): include/uapi/linux/if_pppox.h: 153:29: war

[PATCH v10 nf-next 3/3] netfilter: flow: remove hw_outdev, out.hw_ifindex and out.hw_ifidx

2025-03-15 Thread Eric Woudstra
Now always info->outdev == info->hw_outdev, so the netfilter code can be further cleaned up by removing: * hw_outdev from struct nft_forward_info * out.hw_ifindex from struct nf_flow_route * out.hw_ifidx from struct flow_offload_tuple Reviewed-by: Nikolay Aleksandrov Signed-off-by: Eric Woudst

[PATCH v10 nf-next 0/3] Add nf_flow_encap_push() for xmit direct

2025-03-15 Thread Eric Woudstra
To have the ability to handle xmit direct with outgoing encaps in the bridge fastpass bypass, we need to be able to handle them without going through vlan/pppoe devices. So I've applied, amended and squashed wenxu's patch-set. This patch also makes it possible to egress from vlan-filtering brlan

Re: [PATCH] iio: magnetometer: ak8974: Add __nonstring annotations for unterminated strings

2025-03-15 Thread Jonathan Cameron
On Fri, 14 Mar 2025 11:31:09 +0100 Linus Walleij wrote: > On Mon, Mar 10, 2025 at 11:23 PM Kees Cook wrote: > > > When a character array without a terminating NUL character has a static > > initializer, GCC 15's -Wunterminated-string-initialization will only > > warn if the array lacks the "non

Re: [PATCH] string: Disable read_word_at_a_time() optimizations if kernel MTE is enabled

2025-03-15 Thread Mark Rutland
On Mon, Mar 10, 2025 at 06:40:11PM +, Catalin Marinas wrote: > On Mon, Mar 10, 2025 at 06:13:58PM +, Mark Rutland wrote: > > On Mon, Mar 10, 2025 at 05:37:50PM +, Catalin Marinas wrote: > > > On Fri, Mar 07, 2025 at 07:36:31PM -0800, Kees Cook wrote: > > > > On Fri, Mar 07, 2025 at 06:3

Re: [PATCH] string: Disable read_word_at_a_time() optimizations if kernel MTE is enabled

2025-03-15 Thread Kees Cook
On Mon, Mar 10, 2025 at 05:37:50PM +, Catalin Marinas wrote: > On Fri, Mar 07, 2025 at 07:36:31PM -0800, Kees Cook wrote: > > On Fri, Mar 07, 2025 at 06:33:13PM -0800, Peter Collingbourne wrote: > > > The optimized strscpy() and dentry_string_cmp() routines will read 8 > > > unaligned bytes at

Re: [PATCH] string: Disable read_word_at_a_time() optimizations if kernel MTE is enabled

2025-03-15 Thread Catalin Marinas
On Fri, Mar 07, 2025 at 07:36:31PM -0800, Kees Cook wrote: > On Fri, Mar 07, 2025 at 06:33:13PM -0800, Peter Collingbourne wrote: > > The optimized strscpy() and dentry_string_cmp() routines will read 8 > > unaligned bytes at a time via the function read_word_at_a_time(), but > > this is incompatib

[PATCH] ext4: hash: change kzalloc(n * sizeof, ...) to kcalloc(n, sizeof, ...)

2025-03-15 Thread Ethan Carter Edwards
if (!buff) return -ENOMEM; --- base-commit: da920b7df701770e006928053672147075587fb2 change-id: 20250315-ext4-hash-kcalloc-203033977bd9 Best regards, -- Ethan Carter Edwards

Re: [PATCH] string: Disable read_word_at_a_time() optimizations if kernel MTE is enabled

2025-03-15 Thread Catalin Marinas
On Mon, Mar 10, 2025 at 06:13:58PM +, Mark Rutland wrote: > On Mon, Mar 10, 2025 at 05:37:50PM +, Catalin Marinas wrote: > > On Fri, Mar 07, 2025 at 07:36:31PM -0800, Kees Cook wrote: > > > On Fri, Mar 07, 2025 at 06:33:13PM -0800, Peter Collingbourne wrote: > > > > The optimized strscpy()

[PATCH 4/4] ASoC: Intel: max98927: move devm_kzalloc(..., size * n, ...) to devm_kcalloc

2025-03-15 Thread Ethan Carter Edwards
Open coded arithmetic in allocator arguments is discouraged. Helper functions like kcalloc or, in this case, devm_kcalloc are preferred. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments Signed-off-by: Ethan Carter Edwards --- sou

Re: [PATCH] EISA: Increase length of device names

2025-03-15 Thread Alejandro Colomar
Hi Kees, Alex, On Sat, Mar 15, 2025 at 09:27:36AM -0500, Alex Elder wrote: > On 3/10/25 5:24 PM, Kees Cook wrote: > > GCC 15's -Wunterminated-string-initialization warned about truncated > > name strings. Instead of marking them with the "nonstring" attribute[1], > > increase their length to corre

Re: [PATCH] EISA: Increase length of device names

2025-03-15 Thread Alex Elder
On 3/10/25 5:24 PM, Kees Cook wrote: GCC 15's -Wunterminated-string-initialization warned about truncated name strings. Instead of marking them with the "nonstring" attribute[1], increase their length to correctly include enough space for the terminating NUL character, as they are used with %s fo

Re: [PATCH][next] wifi: iwlwifi: dvm: Avoid -Wflex-array-member-not-at-end warnings

2025-03-15 Thread Gustavo A. R. Silva
On 11/03/25 21:12, Johannes Berg wrote: On Tue, 2025-03-11 at 11:40 +0100, Johannes Berg wrote: On Mon, 2025-03-10 at 14:17 +1030, Gustavo A. R. Silva wrote: Hi all, I wonder who can take this patch, please. :) At the very least you're going to have to resend, I don't have the patch in p