Re: [PATCH] mtd: maps: sa1100-flash: Prefer struct_size over open coded arithmetic

2024-04-08 Thread Miquel Raynal
On Sat, 2024-03-30 at 17:55:35 UTC, Erick Archer wrote: > This is an effort to get rid of all multiplications from allocation > functions in order to prevent integer overflows [1][2]. > > As the "info" variable is a pointer to "struct sa_info" and this > structure ends in a flexible array: > > st

Re: [PATCH v2] mtd: rawnand: Prefer struct_size over open coded arithmetic

2024-02-26 Thread Miquel Raynal
On Sun, 2024-02-11 at 09:16:33 UTC, Erick Archer wrote: > This is an effort to get rid of all multiplications from allocation > functions in order to prevent integer overflows [1]. > > As the "chip" variable is a pointer to "struct mtk_nfc_nand_chip" and > this structure ends in a flexible array:

Re: [PATCH] mtd: rawnand: rockchip: Use struct_size()

2023-10-16 Thread Miquel Raynal
On Sun, 2023-10-01 at 07:44:04 UTC, Christophe JAILLET wrote: > Use struct_size() instead of hand writing it. > This is less verbose and more robust. > > While at it, prepare for the coming implementation by GCC and Clang of the > __counted_by attribute. Flexible array members annotated with __cou

Re: [PATCH] mtd: rawnand: Annotate struct mtk_nfc_nand_chip with __counted_by

2023-10-16 Thread Miquel Raynal
ndexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct > mtk_nfc_nand_chip. > > Cc: Miquel Raynal > Cc: Richard Weinberger > Cc: Vignesh Raghavendra > Cc: Matthias Brugger > Cc: Angel

Re: [PATCH] mtd: rawnand: cadence: Annotate struct cdns_nand_chip with __counted_by

2023-10-16 Thread Miquel Raynal
ndexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct cdns_nand_chip. > > Cc: Miquel Raynal > Cc: Richard Weinberger > Cc: Vignesh Raghavendra > Cc: "Gustavo A. R. Silva" > C

Re: [PATCH] i3c: svc: Annotate struct svc_i3c_xfer with __counted_by

2023-09-22 Thread Miquel Raynal
AN_BOUNDS > (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct svc_i3c_xfer. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci >

Re: [PATCH] mtd: Annotate struct lpddr_private with __counted_by

2023-09-22 Thread Miquel Raynal
; (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct lpddr_private. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Miquel Ra

Re: [PATCH] mtd: cfi: Annotate struct cfi_private with __counted_by

2023-09-22 Thread Miquel Raynal
; (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct cfi_private. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Miquel Ra

Re: [PATCH] mtd: rawnand: atmel: Annotate struct atmel_nand with __counted_by

2023-09-22 Thread Miquel Raynal
; (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct atmel_nand. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Tudor Ambarus

Re: [PATCH] mtd: rawnand: denali: Annotate struct denali_chip with __counted_by

2023-09-22 Thread Miquel Raynal
; (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct denali_chip. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Miquel Ra

Re: [PATCH] mtd: rawnand: ingenic: Annotate struct ingenic_nfc with __counted_by

2023-09-22 Thread Miquel Raynal
; (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct ingenic_nfc. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Paul Cercu

Re: [PATCH] mtd: rawnand: marvell: Annotate struct marvell_nand_chip with __counted_by

2023-09-22 Thread Miquel Raynal
; (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct marvell_nand_chip. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Miq

Re: [PATCH] mtd: rawnand: meson: Annotate struct meson_nfc_nand_chip with __counted_by

2023-09-22 Thread Miquel Raynal
; (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct meson_nfc_nand_chip. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: L

Re: [PATCH] mtd: rawnand: renesas: Annotate struct rnand_chip with __counted_by

2023-09-22 Thread Miquel Raynal
; (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct rnand_chip. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Miquel Ra

Re: [PATCH] mtd: rawnand: sunxi: Annotate struct sunxi_nand_chip with __counted_by

2023-09-22 Thread Miquel Raynal
; (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct sunxi_nand_chip. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Miq