axs101: Fix type mismatch warning
PATCH 1/1 axs101: Fix type mismatch warning
Initialization of pointer from integer shall be designated by explicit type cast.
--- board/synopsys/axs101/nand.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
board/synopsys/axs101/nand.c +2 -2
@@ -62,8 +62,8 @@ struct nand_bd {uint32_t buffer_ptr1;/* DES3 */ }; -#define NAND_REG_WRITE (r, v) writel(v, CONFIG_SYS_NAND_BASE + r) -#define NAND_REG_READ (r) readl(CONFIG_SYS_NAND_BASE + r) +#define NAND_REG_WRITE (r, v) writel(v, (volatile void __iomem *)(CONFIG_SYS_NAND_BASE + r)) +#define NAND_REG_READ (r) readl((const volatile void __iomem *)(CONFIG_SYS_NAND_BASE + r))static struct nand_bd *bd;/* DMA buffer descriptors */
Signature · 1 line
1.7.9
PATCH 1/1 axs101: Fix type mismatch warning
Hi Vasili,
Quoted 14 lines · Vasili Galka
Initialization of pointer from integer shall be designated by explicit type cast.
Signed-off-by Vasili Galka <[email protected]>Cc Alexey Brodkin <[email protected]>--- board/synopsys/axs101/nand.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)board/synopsys/axs101/nand.c +0
-0
board/synopsys/axs101/nand.c struct nand_bd { · line 69
Quoted 10 lines
board/synopsys/axs101/nand.c +2
-2@@ -62,8 +62,8 @@ struct nand_bd {uint32_t buffer_ptr1;/* DES3 */ }; -#define NAND_REG_WRITE (r, v) writel(v, CONFIG_SYS_NAND_BASE + r) -#define NAND_REG_READ (r) readl(CONFIG_SYS_NAND_BASE + r) +#define NAND_REG_WRITE (r, v) writel(v, (volatile void __iomem *)(CONFIG_SYS_NAND_BASE + r)) +#define NAND_REG_READ (r) readl((const volatile void __iomem *)(CONFIG_SYS_NAND_BASE + r))static struct nand_bd *bd;/* DMA buffer descriptors */
Thanks a lot for your patch.
It does fix warnings in "board/synopsys/axs101/nand.c"
But could you please make sure lines are properly wrapped?
This is what checkpatch.pl reports:
--->---
$ scripts/checkpatch.pl \[PATCH\]_axs101 \:_Fix_type_mismatch_warning.mbox WARNING: line over 80 characters #83: FILE: board/synopsys/axs101/nand.c:65: +#define NAND_REG_WRITE(r, v) writel(v, (volatile void __iomem *)(CONFIG_SYS_NAND_BASE + r))
WARNING: Use of volatile is usually wrong: seeDocumentation/volatile-considered-harmful.txt
#83: FILE: board/synopsys/axs101/nand.c:65:
+#define NAND_REG_WRITE(r, v) writel(v, (volatile void __iomem
*)(CONFIG_SYS_NAND_BASE + r))
WARNING: line over 80 characters
#84: FILE: board/synopsys/axs101/nand.c:66:
+#define NAND_REG_READ(r) readl((const volatile void __iomem
*)(CONFIG_SYS_NAND_BASE + r))
WARNING: Use of volatile is usually wrong: seeDocumentation/volatile-considered-harmful.txt
#84: FILE: board/synopsys/axs101/nand.c:66:
+#define NAND_REG_READ(r) readl((const volatile void __iomem
*)(CONFIG_SYS_NAND_BASE + r))
total: 0 errors, 4 warnings, 0 checks, 10 lines checked
NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX MULTISTATEMENT_MACRO_USE_DO_WHILE NETWORKING_BLOCK_COMMENT_STYLE USLEEP_RANGE
[PATCH]_axs101:_Fix_type_mismatch_warning.mbox has style problems, please review.
--->---
I mean messages saying "WARNING: line over 80 characters".
Regards,
Alexey
PATCH 1/1 axs101: Fix type mismatch warning
Hi Alexey,
Quoted 66 lines · Alexey Brodkin
Hi Vasili,
Quoted 14 lines · Vasili Galka
Initialization of pointer from integer shall be designated by explicit type cast.
Signed-off-by Vasili Galka <[email protected]>Cc Alexey Brodkin <[email protected]>--- board/synopsys/axs101/nand.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)board/synopsys/axs101/nand.c +0
-0board/synopsys/axs101/nand.c struct nand_bd { · line 69
Quoted 10 lines
board/synopsys/axs101/nand.c +2
-2@@ -62,8 +62,8 @@ struct nand_bd {uint32_t buffer_ptr1;/* DES3 */ }; -#define NAND_REG_WRITE (r, v) writel(v, CONFIG_SYS_NAND_BASE + r) -#define NAND_REG_READ (r) readl(CONFIG_SYS_NAND_BASE + r) +#define NAND_REG_WRITE (r, v) writel(v, (volatile void __iomem *)(CONFIG_SYS_NAND_BASE + r)) +#define NAND_REG_READ (r) readl((const volatile void __iomem *)(CONFIG_SYS_NAND_BASE + r))static struct nand_bd *bd;/* DMA buffer descriptors */ Thanks a lot for your patch.
It does fix warnings in "board/synopsys/axs101/nand.c"But could you please make sure lines are properly wrapped?
This is what checkpatch.pl reports:
--->---$ scripts/checkpatch.pl \[PATCH\]_axs101 \:_Fix_type_mismatch_warning.mbox WARNING: line over 80 characters #83: FILE: board/synopsys/axs101/nand.c:65: +#define NAND_REG_WRITE(r, v) writel(v, (volatile void __iomem *)(CONFIG_SYS_NAND_BASE + r))WARNING: Use of volatile is usually wrong: see
Documentation/volatile-considered-harmful.txt
#83: FILE:board/synopsys/axs101/nand.c:65:
+#defineNAND_REG_WRITE(r, v)writel(v, (volatile void__iomem
*)(CONFIG_SYS_NAND_BASE + r))WARNING: line over 80 characters
#84: FILE:board/synopsys/axs101/nand.c:66:
+#defineNAND_REG_READ(r)readl((const volatile void__iomem
*)(CONFIG_SYS_NAND_BASE + r))WARNING: Use of volatile is usually wrong: see
Documentation/volatile-considered-harmful.txt
#84: FILE:board/synopsys/axs101/nand.c:66:
+#defineNAND_REG_READ(r)readl((const volatile void__iomem
*)(CONFIG_SYS_NAND_BASE + r))total: 0 errors, 4 warnings, 0 checks, 10 lines checked
NOTE: Ignored message types:
COMPLEX_MACROCONSIDER_KSTRTOMINMAXMULTISTATEMENT_MACRO_USE_DO_WHILENETWORKING_BLOCK_COMMENT_STYLEUSLEEP_RANGE
Quoted 8 lines
[PATCH]_axs101:_Fix_type_mismatch_warning.mbox has style problems, please review.
--->---I mean messages saying "WARNING: line over 80 characters".
Regards,
Alexey
You're absolutely correct. I forgot to run the checkpatch.pl script. My mistake. I'll send an update shortly.
Many thanks,
Vasili
PATCH v2 1/1 axs101: Fix type mismatch warning
In reply to Alexey BrodkinInitialization of pointer from integer shall be designated by explicit type cast.
---
Changes for v2:
- Verified complience with checkpatch.pl (wrapped long lines)
board/synopsys/axs101/nand.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
board/synopsys/axs101/nand.c +4 -2
@@ -62,8 +62,10 @@ struct nand_bd {uint32_t buffer_ptr1;/* DES3 */ }; -#define NAND_REG_WRITE (r, v) writel(v, CONFIG_SYS_NAND_BASE + r) -#define NAND_REG_READ (r) readl(CONFIG_SYS_NAND_BASE + r) +#define NAND_REG_WRITE (r, v) \ + writel(v, (volatile void __iomem *)(CONFIG_SYS_NAND_BASE + r)) +#define NAND_REG_READ (r) \ + readl((const volatile void __iomem *)(CONFIG_SYS_NAND_BASE + r))static struct nand_bd *bd;/* DMA buffer descriptors */
Signature · 1 line
1.8.1.msysgit.1
Alexey Brodkin
AppliedPATCH v2 1/1 axs101: Fix type mismatch warning
Hi Vasili,
Quoted 19 lines · Vasili Galka
Initialization of pointer from integer shall be designated by explicit type cast.
Signed-off-by Vasili Galka <[email protected]>Cc Alexey Brodkin <[email protected]>---
Changes for v2:
- Verified complience with checkpatch.pl (wrapped long lines)board/synopsys/axs101/nand.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)board/synopsys/axs101/nand.c +0
-0@@ -62,8 +62,10 @@ struct nand_bd {uint32_t buffer_ptr1;/* DES3 */ };
board/synopsys/axs101/nand.c struct nand_bd { · line 71
Quoted 10 lines
board/synopsys/axs101/nand.c +4
-2-#define NAND_REG_WRITE (r, v) writel(v, CONFIG_SYS_NAND_BASE + r) -#define NAND_REG_READ (r) readl(CONFIG_SYS_NAND_BASE + r) +#define NAND_REG_WRITE (r, v) \ + writel(v, (volatile void __iomem *)(CONFIG_SYS_NAND_BASE + r)) +#define NAND_REG_READ (r) \ + readl((const volatile void __iomem *)(CONFIG_SYS_NAND_BASE + r))static struct nand_bd *bd;/* DMA buffer descriptors */
Applied,
Thanks!