# \[PATCH\] powerpc/iommu: Code cleanup for cell/iommu.c

- Subsystems: CELL BROADBAND ENGINE ARCHITECTURE, LINUX FOR POWERPC (32-BIT AND 64-BIT), THE REST
- Maintainers: Madhavan Srinivasan, Linus Torvalds
- List: linuxppc-dev
- 3 messages, 2 authors
- Page: https://ratatoskr.run/linuxppc-dev/2024/01/2471021/t

## \[PATCH\] powerpc/iommu: Code cleanup for cell/iommu.c

- From: Kunwu Chan \<hidden\>
- Date: 2024-01-25 02:52:05 
- Message: https://ratatoskr.run/linuxppc-dev/2024/01/2471021.md

```text
This part was commented from commit 165785e5c0be ("[POWERPC] Cell
iommu support") in about 17 years before.

If there are no plans to enable this part code in the future,
we can remove this dead code.

Signed-off-by: Kunwu Chan <redacted>
---
 arch/powerpc/platforms/cell/iommu.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 1202a69b0a20..afce9e64a443 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -424,22 +424,6 @@ static void __init cell_iommu_setup_hardware(struct cbe_iommu *iommu,
 	cell_iommu_enable_hardware(iommu);
 }
 
-#if 0/* Unused for now */
-static struct iommu_window *find_window(struct cbe_iommu *iommu,
-		unsigned long offset, unsigned long size)
-{
-	struct iommu_window *window;
-
-	/* todo: check for overlapping (but not equal) windows) */
-
-	list_for_each_entry(window, &(iommu->windows), list) {
-		if (window->offset == offset && window->size == size)
-			return window;
-	}
-
-	return NULL;
-}
-#endif
 
 static inline u32 cell_iommu_get_ioid(struct device_node *np)
 {
-- 
2.39.2

```

## Re: \[PATCH\] powerpc/iommu: Code cleanup for cell/iommu.c

- From: Christophe Leroy \<hidden\>
- Date: 2024-01-25 06:49:14 
- Message: https://ratatoskr.run/linuxppc-dev/2024/01/2471170.md

```text


Le 25/01/2024 à 03:46, Kunwu Chan a écrit :
> This part was commented from commit 165785e5c0be ("[POWERPC] Cell
> iommu support") in about 17 years before.
> 
> If there are no plans to enable this part code in the future,
> we can remove this dead code.
> 
> Signed-off-by: Kunwu Chan <redacted>
> ---
>   arch/powerpc/platforms/cell/iommu.c | 16 ----------------
>   1 file changed, 16 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
> index 1202a69b0a20..afce9e64a443 100644
> --- a/arch/powerpc/platforms/cell/iommu.c
> +++ b/arch/powerpc/platforms/cell/iommu.c
> @@ -424,22 +424,6 @@ static void __init cell_iommu_setup_hardware(struct cbe_iommu *iommu,
>   	cell_iommu_enable_hardware(iommu);
>   }
>   
> -#if 0/* Unused for now */
> -static struct iommu_window *find_window(struct cbe_iommu *iommu,
> -		unsigned long offset, unsigned long size)
> -{
> -	struct iommu_window *window;
> -
> -	/* todo: check for overlapping (but not equal) windows) */
> -
> -	list_for_each_entry(window, &(iommu->windows), list) {
> -		if (window->offset == offset && window->size == size)
> -			return window;
> -	}
> -
> -	return NULL;
> -}
> -#endif

Same as the other one, please remove the second blank line, don't leave 
two blank lines between the remaining functions.

>   
>   static inline u32 cell_iommu_get_ioid(struct device_node *np)
>   {
```

## Re: \[PATCH\] powerpc/iommu: Code cleanup for cell/iommu.c

- From: Kunwu Chan \<hidden\>
- Date: 2024-01-25 08:21:19 
- Message: https://ratatoskr.run/linuxppc-dev/2024/01/2471279.md

```text
On 2024/1/25 14:49, Christophe Leroy wrote:
>
>
> Le 25/01/2024 à 03:46, Kunwu Chan a écrit :
>> This part was commented from commit 165785e5c0be ("[POWERPC] Cell
>> iommu support") in about 17 years before.
>>
>> If there are no plans to enable this part code in the future,
>> we can remove this dead code.
>>
>> Signed-off-by: Kunwu Chan <redacted>
>> ---
>>    arch/powerpc/platforms/cell/iommu.c | 16 ----------------
>>    1 file changed, 16 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
>> index 1202a69b0a20..afce9e64a443 100644
>> --- a/arch/powerpc/platforms/cell/iommu.c
>> +++ b/arch/powerpc/platforms/cell/iommu.c
>> @@ -424,22 +424,6 @@ static void __init cell_iommu_setup_hardware(struct cbe_iommu *iommu,
>>    	cell_iommu_enable_hardware(iommu);
>>    }
>>    
>> -#if 0/* Unused for now */
>> -static struct iommu_window *find_window(struct cbe_iommu *iommu,
>> -		unsigned long offset, unsigned long size)
>> -{
>> -	struct iommu_window *window;
>> -
>> -	/* todo: check for overlapping (but not equal) windows) */
>> -
>> -	list_for_each_entry(window, &(iommu->windows), list) {
>> -		if (window->offset == offset && window->size == size)
>> -			return window;
>> -	}
>> -
>> -	return NULL;
>> -}
>> -#endif
>
> Same as the other one, please remove the second blank line, don't leave
> two blank lines between the remaining functions.
Thanks for your reply.

I'll check my patches and update in v2.

>
>>    
>>    static inline u32 cell_iommu_get_ioid(struct device_node *np)
>>    {
-- 
Thanks,
  Kunwu

```
