lede/target/linux/qualcommax/patches-6.6/0408-spi-spi-qpic-fix-compilation-issues.patch
2025-02-07 12:04:28 +08:00

46 lines
1.6 KiB
Diff

From: George Moussalem <george.moussalem@outlook.com>
Subject: [PATCH] spi: spi-qpic: fix compilation issues
Date: Sun, 06 Oct 2024 16:34:11 +0400
The compiler will throw a warning when freeing a variable, setting values
of u32 to zero using memset, when the number of bytes is greater than the
size of the variable passed, so let's set each of the 8 variables
contiguously set in memory as part of the structure to zero.
The output type of the remove function is void while it should return an
integer indicating success (0) or a negative number as an error. So let's
switch to use the new .remove_new function which expects nothing to be
returned
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
--- a/drivers/mtd/nand/qpic_common.c
+++ b/drivers/mtd/nand/qpic_common.c
@@ -82,7 +82,14 @@ void qcom_clear_bam_transaction(struct q
if (!nandc->props->supports_bam)
return;
- memset(&bam_txn->bam_ce_pos, 0, sizeof(u32) * 8);
+ bam_txn->bam_ce_pos = 0;
+ bam_txn->bam_ce_start = 0;
+ bam_txn->cmd_sgl_pos = 0;
+ bam_txn->cmd_sgl_start = 0;
+ bam_txn->tx_sgl_pos = 0;
+ bam_txn->tx_sgl_start = 0;
+ bam_txn->rx_sgl_pos = 0;
+ bam_txn->rx_sgl_start = 0;
bam_txn->last_data_desc = NULL;
sg_init_table(bam_txn->cmd_sgl, nandc->max_cwperpage *
--- a/drivers/spi/spi-qpic-snand.c
+++ b/drivers/spi/spi-qpic-snand.c
@@ -1624,7 +1624,7 @@ static struct platform_driver qcom_spi_d
.of_match_table = qcom_snandc_of_match,
},
.probe = qcom_spi_probe,
- .remove = qcom_spi_remove,
+ .remove_new = qcom_spi_remove,
};
module_platform_driver(qcom_spi_driver);