diff mbox series

[v5,3/3] mtd: nand: raw: qcom_nandc: reorder qcom_nand_host struct

Message ID 20220608001030.18813-4-ansuelsmth@gmail.com (mailing list archive)
State Superseded
Headers show
Series Add support for unprotected spare data page | expand

Commit Message

Christian Marangi June 8, 2022, 12:10 a.m. UTC
Reorder qcom_nand_host to save holes in the struct.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
 drivers/mtd/nand/raw/qcom_nandc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Manivannan Sadhasivam June 9, 2022, 7:22 a.m. UTC | #1
On Wed, Jun 08, 2022 at 02:10:30AM +0200, Ansuel Smith wrote:
> Reorder qcom_nand_host to save holes in the struct.
> 
> Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>

If this patch gets moved to 2/3, you could save few changes. Also, do the same
for other structs as well.

Thanks,
Mani

> ---
>  drivers/mtd/nand/raw/qcom_nandc.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index 06ee9a836a3b..110f839c9e51 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -475,11 +475,13 @@ struct qcom_nand_host {
>  	int cs;
>  	int cw_size;
>  	int cw_data;
> -	bool use_ecc;
> -	bool bch_enabled;
>  	int ecc_bytes_hw;
>  	int spare_bytes;
>  	int bbm_size;
> +
> +	bool codeword_fixup;
> +	bool use_ecc;
> +	bool bch_enabled;
>  	u8 status;
>  	int last_command;
>  
> @@ -490,7 +492,6 @@ struct qcom_nand_host {
>  	u32 clrflashstatus;
>  	u32 clrreadstatus;
>  
> -	bool codeword_fixup;
>  	int nr_boot_partitions;
>  	struct qcom_nand_boot_partition *boot_partitions;
>  };
> -- 
> 2.36.1
>
Christian Marangi June 9, 2022, 10:26 a.m. UTC | #2
On Thu, Jun 09, 2022 at 12:52:40PM +0530, Manivannan Sadhasivam wrote:
> On Wed, Jun 08, 2022 at 02:10:30AM +0200, Ansuel Smith wrote:
> > Reorder qcom_nand_host to save holes in the struct.
> > 
> > Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> 
> If this patch gets moved to 2/3, you could save few changes. Also, do the same
> for other structs as well.
> 
> Thanks,
> Mani
>

Since 2/3 already had lots of changes didn't want to put a struct
reorder in it since it does touch also other values. Tell me if I should
squash the 2 commit.

> > ---
> >  drivers/mtd/nand/raw/qcom_nandc.c | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> > index 06ee9a836a3b..110f839c9e51 100644
> > --- a/drivers/mtd/nand/raw/qcom_nandc.c
> > +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> > @@ -475,11 +475,13 @@ struct qcom_nand_host {
> >  	int cs;
> >  	int cw_size;
> >  	int cw_data;
> > -	bool use_ecc;
> > -	bool bch_enabled;
> >  	int ecc_bytes_hw;
> >  	int spare_bytes;
> >  	int bbm_size;
> > +
> > +	bool codeword_fixup;
> > +	bool use_ecc;
> > +	bool bch_enabled;
> >  	u8 status;
> >  	int last_command;
> >  
> > @@ -490,7 +492,6 @@ struct qcom_nand_host {
> >  	u32 clrflashstatus;
> >  	u32 clrreadstatus;
> >  
> > -	bool codeword_fixup;
> >  	int nr_boot_partitions;
> >  	struct qcom_nand_boot_partition *boot_partitions;
> >  };
> > -- 
> > 2.36.1
> > 
> 
> -- 
> மணிவண்ணன் சதாசிவம்
Manivannan Sadhasivam June 9, 2022, 10:48 a.m. UTC | #3
On Thu, Jun 09, 2022 at 12:26:53PM +0200, Ansuel Smith wrote:
> On Thu, Jun 09, 2022 at 12:52:40PM +0530, Manivannan Sadhasivam wrote:
> > On Wed, Jun 08, 2022 at 02:10:30AM +0200, Ansuel Smith wrote:
> > > Reorder qcom_nand_host to save holes in the struct.
> > > 
> > > Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> > 
> > If this patch gets moved to 2/3, you could save few changes. Also, do the same
> > for other structs as well.
> > 
> > Thanks,
> > Mani
> >
> 
> Since 2/3 already had lots of changes didn't want to put a struct
> reorder in it since it does touch also other values. Tell me if I should
> squash the 2 commit.
> 

Not squashing but I mean to move this patch before the driver change (1/3), so
that "codeword_fixup" can be added in the correct place.

Also move the respective Kdoc comments.

Thanks,
Mani

> > > ---
> > >  drivers/mtd/nand/raw/qcom_nandc.c | 7 ++++---
> > >  1 file changed, 4 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> > > index 06ee9a836a3b..110f839c9e51 100644
> > > --- a/drivers/mtd/nand/raw/qcom_nandc.c
> > > +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> > > @@ -475,11 +475,13 @@ struct qcom_nand_host {
> > >  	int cs;
> > >  	int cw_size;
> > >  	int cw_data;
> > > -	bool use_ecc;
> > > -	bool bch_enabled;
> > >  	int ecc_bytes_hw;
> > >  	int spare_bytes;
> > >  	int bbm_size;
> > > +
> > > +	bool codeword_fixup;
> > > +	bool use_ecc;
> > > +	bool bch_enabled;
> > >  	u8 status;
> > >  	int last_command;
> > >  
> > > @@ -490,7 +492,6 @@ struct qcom_nand_host {
> > >  	u32 clrflashstatus;
> > >  	u32 clrreadstatus;
> > >  
> > > -	bool codeword_fixup;
> > >  	int nr_boot_partitions;
> > >  	struct qcom_nand_boot_partition *boot_partitions;
> > >  };
> > > -- 
> > > 2.36.1
> > > 
> > 
> > -- 
> > மணிவண்ணன் சதாசிவம்
> 
> -- 
> 	Ansuel
diff mbox series

Patch

diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index 06ee9a836a3b..110f839c9e51 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -475,11 +475,13 @@  struct qcom_nand_host {
 	int cs;
 	int cw_size;
 	int cw_data;
-	bool use_ecc;
-	bool bch_enabled;
 	int ecc_bytes_hw;
 	int spare_bytes;
 	int bbm_size;
+
+	bool codeword_fixup;
+	bool use_ecc;
+	bool bch_enabled;
 	u8 status;
 	int last_command;
 
@@ -490,7 +492,6 @@  struct qcom_nand_host {
 	u32 clrflashstatus;
 	u32 clrreadstatus;
 
-	bool codeword_fixup;
 	int nr_boot_partitions;
 	struct qcom_nand_boot_partition *boot_partitions;
 };