Skip to contentSkip to conversation

iommu: dart: DART_T8110_ERROR range should be 0 to 5

PATCH In review Eric Curtin 3 participants 3 messages Feb 1, 2023 – Feb 3, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 iommu: dart: DART_T8110_ERROR range should be 0 to 5

This was detected by smatch as one "else if" statement could never be reached. Confirmed bit order by comparing with python implementation [1].

drivers/iommu/apple-dart.c:991 apple_dart_t8110_irq()
warn: duplicate check 'error_code == ((((1))) << (3))'
(previous on line 989)

Fixes d8bcc870d99d ("iommu: dart: Add t8110 DART support")

---
Changes in v2: Remove DART_T8110_ERROR_ADDR_HI change

---
 drivers/iommu/apple-dart.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/apple-dart.c +2 -2
index 42666617803d..fd09abe8d29e 100644
@@ -111,8 +111,8 @@
 
 #define DART_T8110_ERROR_MASK 0x104
 
-#define DART_T8110_ERROR_READ_FAULT BIT(4)
-#define DART_T8110_ERROR_WRITE_FAULT BIT(3)
+#define DART_T8110_ERROR_READ_FAULT BIT(5)
+#define DART_T8110_ERROR_WRITE_FAULT BIT(4)
 #define DART_T8110_ERROR_NO_PTE BIT(3)
 #define DART_T8110_ERROR_NO_PMD BIT(2)
 #define DART_T8110_ERROR_NO_PGD BIT(1)
Signature · 1 line
2.39.1
Reviewed-by on v2 1/1
#1 lore raw

Hi,

Quoted 7 lines · Eric Curtin

This was detected by smatch as one "else if" statement could never be reached. Confirmed bit order by comparing with python implementation [1].

drivers/iommu/apple-dart.c:991 apple_dart_t8110_irq()
warn: duplicate check 'error_code == ((((1))) << (3))'
(previous on line 989)

Quoted 5 lines
Fixes d8bcc870d99d ("iommu: dart: Add t8110 DART support")

You're missing a ">" here but I hope Joerg can fix that when merging it!

Quoted 3 lines

---
Changes in v2: Remove DART_T8110_ERROR_ADDR_HI change
---

Thanks,

Sven

maintainer
#2 lore raw
In reply to Eric Curtin
Quoted 7 lines · Eric Curtin

This was detected by smatch as one "else if" statement could never be reached. Confirmed bit order by comparing with python implementation [1].

drivers/iommu/apple-dart.c:991 apple_dart_t8110_irq()
warn: duplicate check 'error_code == ((((1))) << (3))'
(previous on line 989)

Quoted 5 lines
Fixes d8bcc870d99d ("iommu: dart: Add t8110 DART support")

Missing char ^

Fixed that and applied the patch, thanks. Please use checkpatch next time.

Regards,

Joerg