diff mbox series

[v2] iommu: dart: DART_T8110_ERROR range should be 0 to 5

Message ID 20230201124257.7801-1-ecurtin@redhat.com (mailing list archive)
State New, archived
Headers show
Series [v2] iommu: dart: DART_T8110_ERROR range should be 0 to 5 | expand

Commit Message

Eric Curtin Feb. 1, 2023, 12:42 p.m. UTC
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)

Link: https://github.com/AsahiLinux/m1n1/commit/96b2d584feec1e3f7bfa [1]

Fixes: d8bcc870d99d ("iommu: dart: Add t8110 DART support")
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Eric Curtin <ecurtin@redhat.com
---
Changes in v2: Remove DART_T8110_ERROR_ADDR_HI change
---
 drivers/iommu/apple-dart.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Sven Peter Feb. 1, 2023, 5 p.m. UTC | #1
Hi,

On Wed, Feb 1, 2023, at 13:42, Eric Curtin wrote:
> 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)
>
> Link: https://github.com/AsahiLinux/m1n1/commit/96b2d584feec1e3f7bfa [1]
>
> Fixes: d8bcc870d99d ("iommu: dart: Add t8110 DART support")
> Reported-by: Dan Carpenter <error27@gmail.com>
> Signed-off-by: Eric Curtin <ecurtin@redhat.com

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

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

Reviewed-by: Sven Peter <sven@svenpeter.dev>


Thanks,


Sven
Joerg Roedel Feb. 3, 2023, 10:12 a.m. UTC | #2
On Wed, Feb 01, 2023 at 12:42:58PM +0000, Eric Curtin wrote:
> 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)
> 
> Link: https://github.com/AsahiLinux/m1n1/commit/96b2d584feec1e3f7bfa [1]
> 
> Fixes: d8bcc870d99d ("iommu: dart: Add t8110 DART support")
> Reported-by: Dan Carpenter <error27@gmail.com>
> Signed-off-by: Eric Curtin <ecurtin@redhat.com
                                   Missing char ^

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

Regards,

	Joerg
diff mbox series

Patch

diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c
index 42666617803d..fd09abe8d29e 100644
--- a/drivers/iommu/apple-dart.c
+++ b/drivers/iommu/apple-dart.c
@@ -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)