* [PATCH] accel/qaic: Change aic100_image_table definition
@ 2024-12-13 18:51 Jeffrey Hugo
2025-01-07 10:55 ` Jacek Lawrynowicz
2025-01-17 16:05 ` Jeffrey Hugo
0 siblings, 2 replies; 3+ messages in thread
From: Jeffrey Hugo @ 2024-12-13 18:51 UTC (permalink / raw)
To: quic_yabdulra, quic_carlv; +Cc: linux-arm-msm, dri-devel, Jeffrey Hugo
From: Youssef Samir <quic_yabdulra@quicinc.com>
aic100_image_table is currently defined as a "const char *" array,
this can potentially lead to the accidental modification of the
pointers inside. Also, checkpatch.pl gives a warning about it.
Change the type to a "const char * const" array to make the pointers
immutable, preventing accidental modification of the images' paths.
Signed-off-by: Youssef Samir <quic_yabdulra@quicinc.com>
Reviewed-by: Carl Vanderlip <quic_carlv@quicinc.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
---
drivers/accel/qaic/sahara.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/accel/qaic/sahara.c b/drivers/accel/qaic/sahara.c
index 21d58aed0deb..09c8b055aa81 100644
--- a/drivers/accel/qaic/sahara.c
+++ b/drivers/accel/qaic/sahara.c
@@ -160,7 +160,7 @@ struct sahara_context {
struct work_struct fw_work;
struct work_struct dump_work;
struct mhi_device *mhi_dev;
- const char **image_table;
+ const char * const *image_table;
u32 table_size;
u32 active_image_id;
const struct firmware *firmware;
@@ -177,7 +177,7 @@ struct sahara_context {
bool is_mem_dump_mode;
};
-static const char *aic100_image_table[] = {
+static const char * const aic100_image_table[] = {
[1] = "qcom/aic100/fw1.bin",
[2] = "qcom/aic100/fw2.bin",
[4] = "qcom/aic100/fw4.bin",
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] accel/qaic: Change aic100_image_table definition
2024-12-13 18:51 [PATCH] accel/qaic: Change aic100_image_table definition Jeffrey Hugo
@ 2025-01-07 10:55 ` Jacek Lawrynowicz
2025-01-17 16:05 ` Jeffrey Hugo
1 sibling, 0 replies; 3+ messages in thread
From: Jacek Lawrynowicz @ 2025-01-07 10:55 UTC (permalink / raw)
To: Jeffrey Hugo, quic_yabdulra, quic_carlv; +Cc: linux-arm-msm, dri-devel
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
On 12/13/2024 7:51 PM, Jeffrey Hugo wrote:
> From: Youssef Samir <quic_yabdulra@quicinc.com>
>
> aic100_image_table is currently defined as a "const char *" array,
> this can potentially lead to the accidental modification of the
> pointers inside. Also, checkpatch.pl gives a warning about it.
>
> Change the type to a "const char * const" array to make the pointers
> immutable, preventing accidental modification of the images' paths.
>
> Signed-off-by: Youssef Samir <quic_yabdulra@quicinc.com>
> Reviewed-by: Carl Vanderlip <quic_carlv@quicinc.com>
> Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
> Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
> ---
> drivers/accel/qaic/sahara.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/accel/qaic/sahara.c b/drivers/accel/qaic/sahara.c
> index 21d58aed0deb..09c8b055aa81 100644
> --- a/drivers/accel/qaic/sahara.c
> +++ b/drivers/accel/qaic/sahara.c
> @@ -160,7 +160,7 @@ struct sahara_context {
> struct work_struct fw_work;
> struct work_struct dump_work;
> struct mhi_device *mhi_dev;
> - const char **image_table;
> + const char * const *image_table;
> u32 table_size;
> u32 active_image_id;
> const struct firmware *firmware;
> @@ -177,7 +177,7 @@ struct sahara_context {
> bool is_mem_dump_mode;
> };
>
> -static const char *aic100_image_table[] = {
> +static const char * const aic100_image_table[] = {
> [1] = "qcom/aic100/fw1.bin",
> [2] = "qcom/aic100/fw2.bin",
> [4] = "qcom/aic100/fw4.bin",
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] accel/qaic: Change aic100_image_table definition
2024-12-13 18:51 [PATCH] accel/qaic: Change aic100_image_table definition Jeffrey Hugo
2025-01-07 10:55 ` Jacek Lawrynowicz
@ 2025-01-17 16:05 ` Jeffrey Hugo
1 sibling, 0 replies; 3+ messages in thread
From: Jeffrey Hugo @ 2025-01-17 16:05 UTC (permalink / raw)
To: quic_yabdulra, quic_carlv; +Cc: linux-arm-msm, dri-devel
On 12/13/2024 11:51 AM, Jeffrey Hugo wrote:
> From: Youssef Samir <quic_yabdulra@quicinc.com>
>
> aic100_image_table is currently defined as a "const char *" array,
> this can potentially lead to the accidental modification of the
> pointers inside. Also, checkpatch.pl gives a warning about it.
>
> Change the type to a "const char * const" array to make the pointers
> immutable, preventing accidental modification of the images' paths.
>
> Signed-off-by: Youssef Samir <quic_yabdulra@quicinc.com>
> Reviewed-by: Carl Vanderlip <quic_carlv@quicinc.com>
> Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
> Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Applied to drm-misc-next
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-17 16:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-13 18:51 [PATCH] accel/qaic: Change aic100_image_table definition Jeffrey Hugo
2025-01-07 10:55 ` Jacek Lawrynowicz
2025-01-17 16:05 ` Jeffrey Hugo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox