This patch series removes two Variable Length Arrays (VLAs) from
the powerpc code.
Series based on v4.19-rc2
Suraj Jitindar Singh (2):
powerpc/prom: Remove VLA in prom_check_platform_support()
powerpc/pseries: Remove VLA from lparcfg_write()
arch/powerpc/kernel/prom_init.c | 7 +++++--
arch/powerpc/platforms/pseries/lparcfg.c | 5 ++---
2 files changed, 7 insertions(+), 5 deletions(-)
--
2.13.6
In prom_check_platform_support() we retrieve and parse the
"ibm,arch-vec-5-platform-support" property of the chosen node.
Currently we use a variable length array however to avoid this use an
array of constant length 8.
This property is used to indicate the supported options of vector 5
bytes 23-26 of the ibm,architecture.vec node. Each of these options
is a pair of bytes, thus for 4 options we have a max length of 8 bytes.
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
---
arch/powerpc/kernel/prom_init.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
In lparcfg_write we hard code kbuf_sz and then use this as the variable
length of kbuf creating a variable length array. Since we're hard coding
the length anyway just define the array using this as the length and
remove the need for kbuf_sz, thus removing the variable length array.
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
---
arch/powerpc/platforms/pseries/lparcfg.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
From: Joel Stanley <joel@jms.id.au> Date: 2018-09-17 02:37:13
On Wed, 5 Sep 2018 at 11:40, Suraj Jitindar Singh
[off-list ref] wrote:
In prom_check_platform_support() we retrieve and parse the
"ibm,arch-vec-5-platform-support" property of the chosen node.
Currently we use a variable length array however to avoid this use an
array of constant length 8.
This property is used to indicate the supported options of vector 5
bytes 23-26 of the ibm,architecture.vec node. Each of these options
is a pair of bytes, thus for 4 options we have a max length of 8 bytes.
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
From: Joel Stanley <joel@jms.id.au> Date: 2018-09-17 02:37:29
On Wed, 5 Sep 2018 at 11:40, Suraj Jitindar Singh
[off-list ref] wrote:
In lparcfg_write we hard code kbuf_sz and then use this as the variable
length of kbuf creating a variable length array. Since we're hard coding
the length anyway just define the array using this as the length and
remove the need for kbuf_sz, thus removing the variable length array.
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
From: Michael Ellerman <hidden> Date: 2018-09-20 04:21:00
On Wed, 2018-09-05 at 02:09:50 UTC, Suraj Jitindar Singh wrote:
In prom_check_platform_support() we retrieve and parse the
"ibm,arch-vec-5-platform-support" property of the chosen node.
Currently we use a variable length array however to avoid this use an
array of constant length 8.
This property is used to indicate the supported options of vector 5
bytes 23-26 of the ibm,architecture.vec node. Each of these options
is a pair of bytes, thus for 4 options we have a max length of 8 bytes.
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>