* [PATCH 0/2] spi: spi-qpic-snand: cleanup 'qpic_ecc' structure
@ 2025-08-10 14:38 Gabor Juhos
2025-08-10 14:38 ` [PATCH 1/2] spi: spi-qpic-snand: remove unused 'dev' member of struct 'qpic_ecc' Gabor Juhos
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Gabor Juhos @ 2025-08-10 14:38 UTC (permalink / raw)
To: Mark Brown
Cc: Md Sadre Alam, Varadarajan Narayanan, Sricharan Ramabadhran,
linux-spi, linux-mtd, linux-arm-msm, linux-kernel, Gabor Juhos
The series consist of two small patches to clean up the qpic_ecc structure
in the spi-qpic-snand driver. The first one removes an unused member from
the structure, whereas the second reduces code duplication and removes
another two members from the same.
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
---
Gabor Juhos (2):
spi: spi-qpic-snand: remove unused 'dev' member of struct 'qpic_ecc'
spi: spi-qpic-snand: remove 'clr*status' members of struct 'qpic_ecc'
drivers/spi/spi-qpic-snand.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
---
base-commit: 13d0fe84a214658254a7412b2b46ec1507dc51f0
change-id: 20250809-qpic-snand-qpic_ecc-cleanup-c4d8f4e49e53
Best regards,
--
Gabor Juhos <j4g8y7@gmail.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] spi: spi-qpic-snand: remove unused 'dev' member of struct 'qpic_ecc'
2025-08-10 14:38 [PATCH 0/2] spi: spi-qpic-snand: cleanup 'qpic_ecc' structure Gabor Juhos
@ 2025-08-10 14:38 ` Gabor Juhos
2025-08-11 8:50 ` Konrad Dybcio
2025-08-10 14:38 ` [PATCH 2/2] spi: spi-qpic-snand: remove 'clr*status' members " Gabor Juhos
2025-08-12 14:27 ` [PATCH 0/2] spi: spi-qpic-snand: cleanup 'qpic_ecc' structure Mark Brown
2 siblings, 1 reply; 5+ messages in thread
From: Gabor Juhos @ 2025-08-10 14:38 UTC (permalink / raw)
To: Mark Brown
Cc: Md Sadre Alam, Varadarajan Narayanan, Sricharan Ramabadhran,
linux-spi, linux-mtd, linux-arm-msm, linux-kernel, Gabor Juhos
The 'dev' member of the 'qpic_ecc' structure is never used in the
code so remove that.
No functional changes.
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
---
drivers/spi/spi-qpic-snand.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/spi/spi-qpic-snand.c b/drivers/spi/spi-qpic-snand.c
index 7b76d2c82a5287df13ee6fcebc4abbe58ca861ee..bc2158e560be3b0ab1b26882e4de524ecf662d14 100644
--- a/drivers/spi/spi-qpic-snand.c
+++ b/drivers/spi/spi-qpic-snand.c
@@ -78,7 +78,6 @@ struct qcom_ecc_stats {
};
struct qpic_ecc {
- struct device *dev;
int ecc_bytes_hw;
int spare_bytes;
int bbm_size;
--
2.50.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] spi: spi-qpic-snand: remove 'clr*status' members of struct 'qpic_ecc'
2025-08-10 14:38 [PATCH 0/2] spi: spi-qpic-snand: cleanup 'qpic_ecc' structure Gabor Juhos
2025-08-10 14:38 ` [PATCH 1/2] spi: spi-qpic-snand: remove unused 'dev' member of struct 'qpic_ecc' Gabor Juhos
@ 2025-08-10 14:38 ` Gabor Juhos
2025-08-12 14:27 ` [PATCH 0/2] spi: spi-qpic-snand: cleanup 'qpic_ecc' structure Mark Brown
2 siblings, 0 replies; 5+ messages in thread
From: Gabor Juhos @ 2025-08-10 14:38 UTC (permalink / raw)
To: Mark Brown
Cc: Md Sadre Alam, Varadarajan Narayanan, Sricharan Ramabadhran,
linux-spi, linux-mtd, linux-arm-msm, linux-kernel, Gabor Juhos
In the qcom_spi_ecc_init_ctx_pipelined() function, the 'clrflashstatus'
and the 'clrreadstatus' members of the ECC context gets initialized with
constant values. Then these values are used by several functions to set
the corresponding members in the register cache.
Because the values are never modified, change the code to set the those
directly in the register cache by the qcom_spi_ecc_init_ctx_pipelined()
function, and remove the repetitive code from the other functions to
reduce code duplication.
Also, remove the respective members from the 'qpic_ecc' structure as
those became unused due to the change.
No functional changes intended.
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
---
drivers/spi/spi-qpic-snand.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/drivers/spi/spi-qpic-snand.c b/drivers/spi/spi-qpic-snand.c
index bc2158e560be3b0ab1b26882e4de524ecf662d14..01f16f49d4cafa608373a176cd1bd88bd00d2a99 100644
--- a/drivers/spi/spi-qpic-snand.c
+++ b/drivers/spi/spi-qpic-snand.c
@@ -94,8 +94,6 @@ struct qpic_ecc {
u32 cfg1_raw;
u32 ecc_buf_cfg;
u32 ecc_bch_cfg;
- u32 clrflashstatus;
- u32 clrreadstatus;
bool bch_enabled;
};
@@ -381,12 +379,12 @@ static int qcom_spi_ecc_init_ctx_pipelined(struct nand_device *nand)
FIELD_PREP(ECC_PARITY_SIZE_BYTES_BCH_MASK, ecc_cfg->ecc_bytes_hw);
ecc_cfg->ecc_buf_cfg = FIELD_PREP(NUM_STEPS_MASK, 0x203);
- ecc_cfg->clrflashstatus = FS_READY_BSY_N;
- ecc_cfg->clrreadstatus = 0xc0;
conf->step_size = ecc_cfg->step_size;
conf->strength = ecc_cfg->strength;
+ snandc->regs->clrflashstatus = cpu_to_le32(FS_READY_BSY_N);
+ snandc->regs->clrreadstatus = cpu_to_le32(0xc0);
snandc->regs->erased_cw_detect_cfg_clr = cpu_to_le32(CLR_ERASED_PAGE_DET);
snandc->regs->erased_cw_detect_cfg_set = cpu_to_le32(SET_ERASED_PAGE_DET);
@@ -598,8 +596,6 @@ static int qcom_spi_read_last_cw(struct qcom_nand_controller *snandc,
snandc->regs->cfg0 = cpu_to_le32(cfg0);
snandc->regs->cfg1 = cpu_to_le32(cfg1);
snandc->regs->ecc_bch_cfg = cpu_to_le32(ecc_bch_cfg);
- snandc->regs->clrflashstatus = cpu_to_le32(ecc_cfg->clrflashstatus);
- snandc->regs->clrreadstatus = cpu_to_le32(ecc_cfg->clrreadstatus);
snandc->regs->exec = cpu_to_le32(1);
qcom_spi_set_read_loc(snandc, num_cw - 1, 0, 0, ecc_cfg->cw_size, 1);
@@ -733,8 +729,6 @@ static int qcom_spi_read_cw_raw(struct qcom_nand_controller *snandc, u8 *data_bu
snandc->regs->cfg0 = cpu_to_le32(cfg0);
snandc->regs->cfg1 = cpu_to_le32(cfg1);
snandc->regs->ecc_bch_cfg = cpu_to_le32(ecc_bch_cfg);
- snandc->regs->clrflashstatus = cpu_to_le32(ecc_cfg->clrflashstatus);
- snandc->regs->clrreadstatus = cpu_to_le32(ecc_cfg->clrreadstatus);
snandc->regs->exec = cpu_to_le32(1);
qcom_spi_set_read_loc(snandc, raw_cw, 0, 0, ecc_cfg->cw_size, 1);
@@ -849,8 +843,6 @@ static int qcom_spi_read_page_ecc(struct qcom_nand_controller *snandc,
snandc->regs->cfg0 = cpu_to_le32(cfg0);
snandc->regs->cfg1 = cpu_to_le32(cfg1);
snandc->regs->ecc_bch_cfg = cpu_to_le32(ecc_bch_cfg);
- snandc->regs->clrflashstatus = cpu_to_le32(ecc_cfg->clrflashstatus);
- snandc->regs->clrreadstatus = cpu_to_le32(ecc_cfg->clrreadstatus);
snandc->regs->exec = cpu_to_le32(1);
qcom_spi_set_read_loc(snandc, 0, 0, 0, ecc_cfg->cw_data, 1);
@@ -942,8 +934,6 @@ static int qcom_spi_read_page_oob(struct qcom_nand_controller *snandc,
snandc->regs->cfg0 = cpu_to_le32(cfg0);
snandc->regs->cfg1 = cpu_to_le32(cfg1);
snandc->regs->ecc_bch_cfg = cpu_to_le32(ecc_bch_cfg);
- snandc->regs->clrflashstatus = cpu_to_le32(ecc_cfg->clrflashstatus);
- snandc->regs->clrreadstatus = cpu_to_le32(ecc_cfg->clrreadstatus);
snandc->regs->exec = cpu_to_le32(1);
qcom_spi_set_read_loc(snandc, 0, 0, 0, ecc_cfg->cw_data, 1);
@@ -1063,8 +1053,6 @@ static int qcom_spi_program_raw(struct qcom_nand_controller *snandc,
snandc->regs->cfg0 = cpu_to_le32(cfg0);
snandc->regs->cfg1 = cpu_to_le32(cfg1);
snandc->regs->ecc_bch_cfg = cpu_to_le32(ecc_bch_cfg);
- snandc->regs->clrflashstatus = cpu_to_le32(ecc_cfg->clrflashstatus);
- snandc->regs->clrreadstatus = cpu_to_le32(ecc_cfg->clrreadstatus);
snandc->regs->exec = cpu_to_le32(1);
qcom_spi_config_page_write(snandc);
--
2.50.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] spi: spi-qpic-snand: remove unused 'dev' member of struct 'qpic_ecc'
2025-08-10 14:38 ` [PATCH 1/2] spi: spi-qpic-snand: remove unused 'dev' member of struct 'qpic_ecc' Gabor Juhos
@ 2025-08-11 8:50 ` Konrad Dybcio
0 siblings, 0 replies; 5+ messages in thread
From: Konrad Dybcio @ 2025-08-11 8:50 UTC (permalink / raw)
To: Gabor Juhos, Mark Brown
Cc: Md Sadre Alam, Varadarajan Narayanan, Sricharan Ramabadhran,
linux-spi, linux-mtd, linux-arm-msm, linux-kernel
On 8/10/25 4:38 PM, Gabor Juhos wrote:
> The 'dev' member of the 'qpic_ecc' structure is never used in the
> code so remove that.
>
> No functional changes.
>
> Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] spi: spi-qpic-snand: cleanup 'qpic_ecc' structure
2025-08-10 14:38 [PATCH 0/2] spi: spi-qpic-snand: cleanup 'qpic_ecc' structure Gabor Juhos
2025-08-10 14:38 ` [PATCH 1/2] spi: spi-qpic-snand: remove unused 'dev' member of struct 'qpic_ecc' Gabor Juhos
2025-08-10 14:38 ` [PATCH 2/2] spi: spi-qpic-snand: remove 'clr*status' members " Gabor Juhos
@ 2025-08-12 14:27 ` Mark Brown
2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2025-08-12 14:27 UTC (permalink / raw)
To: Gabor Juhos
Cc: Md Sadre Alam, Varadarajan Narayanan, Sricharan Ramabadhran,
linux-spi, linux-mtd, linux-arm-msm, linux-kernel
On Sun, 10 Aug 2025 16:38:49 +0200, Gabor Juhos wrote:
> The series consist of two small patches to clean up the qpic_ecc structure
> in the spi-qpic-snand driver. The first one removes an unused member from
> the structure, whereas the second reduces code duplication and removes
> another two members from the same.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/2] spi: spi-qpic-snand: remove unused 'dev' member of struct 'qpic_ecc'
commit: fbec18dc9940a89e094bae890b8dc0af00ddc4ff
[2/2] spi: spi-qpic-snand: remove 'clr*status' members of struct 'qpic_ecc'
commit: 6b7e2aa50bdaf88cd4c2a5e2059a7bf32d85a8b1
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-08-12 14:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-10 14:38 [PATCH 0/2] spi: spi-qpic-snand: cleanup 'qpic_ecc' structure Gabor Juhos
2025-08-10 14:38 ` [PATCH 1/2] spi: spi-qpic-snand: remove unused 'dev' member of struct 'qpic_ecc' Gabor Juhos
2025-08-11 8:50 ` Konrad Dybcio
2025-08-10 14:38 ` [PATCH 2/2] spi: spi-qpic-snand: remove 'clr*status' members " Gabor Juhos
2025-08-12 14:27 ` [PATCH 0/2] spi: spi-qpic-snand: cleanup 'qpic_ecc' structure Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).