[6/6] spi: altera: fix size mismatch on 64 bit processors
diff mbox series

Message ID 1591845911-10197-7-git-send-email-yilun.xu@intel.com
State New, archived
Headers show
Series
  • Add more configuration and regmap support for spi-altera
Related show

Commit Message

Xu Yilun June 11, 2020, 3:25 a.m. UTC
From: Matthew Gerlach <matthew.gerlach@linux.intel.com>

The spi-altera driver was originally written with a 32
bit processor, where sizeof(unsigned long) is 4.  On a
64 bit processor sizeof(unsigned long) is 8.  Change the structure
member to u32 to match the actual size of the control
register.

Signed-off-by: Matthew Gerlach <matthew.gerlach@linux.intel.com>
---
 drivers/spi/spi-altera.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown June 11, 2020, 11:04 a.m. UTC | #1
On Thu, Jun 11, 2020 at 11:25:11AM +0800, Xu Yilun wrote:
> From: Matthew Gerlach <matthew.gerlach@linux.intel.com>
> 
> The spi-altera driver was originally written with a 32
> bit processor, where sizeof(unsigned long) is 4.  On a
> 64 bit processor sizeof(unsigned long) is 8.  Change the structure
> member to u32 to match the actual size of the control
> register.
> 
> Signed-off-by: Matthew Gerlach <matthew.gerlach@linux.intel.com>
> ---

You've not provided a Signed-off-by for this, I can't do anything with
it.  For details on what Signed-off-by means and why it's important
please see Documentation/process/submitting-patches.rst.
Xu Yilun June 12, 2020, 3:39 a.m. UTC | #2
On Thu, Jun 11, 2020 at 12:04:08PM +0100, Mark Brown wrote:
> On Thu, Jun 11, 2020 at 11:25:11AM +0800, Xu Yilun wrote:
> > From: Matthew Gerlach <matthew.gerlach@linux.intel.com>
> > 
> > The spi-altera driver was originally written with a 32
> > bit processor, where sizeof(unsigned long) is 4.  On a
> > 64 bit processor sizeof(unsigned long) is 8.  Change the structure
> > member to u32 to match the actual size of the control
> > register.
> > 
> > Signed-off-by: Matthew Gerlach <matthew.gerlach@linux.intel.com>
> > ---
> 
> You've not provided a Signed-off-by for this, I can't do anything with
> it.  For details on what Signed-off-by means and why it's important
> please see Documentation/process/submitting-patches.rst.

Thanks for your explanation. I'll add my Signed-off-by.

Patch
diff mbox series

diff --git a/drivers/spi/spi-altera.c b/drivers/spi/spi-altera.c
index 2c12c7a..468fbd5 100644
--- a/drivers/spi/spi-altera.c
+++ b/drivers/spi/spi-altera.c
@@ -46,7 +46,7 @@  struct altera_spi {
 	int len;
 	int count;
 	int bytes_per_word;
-	unsigned long imr;
+	u32 imr;
 
 	/* data buffers */
 	const unsigned char *tx;