[PATCH 7/8] s390/sclp: remove unhandled memory notifier type

Sumanth Korikkar posted 8 patches 2 years, 1 month ago
There is a newer version of this series
[PATCH 7/8] s390/sclp: remove unhandled memory notifier type
Posted by Sumanth Korikkar 2 years, 1 month ago
Remove memory notifier types which are unhandled by s390.  Unhandled
memory notifier types are covered by default case.

Suggested-by: Alexander Gordeev <agordeev@linux.ibm.com>
Reviewed-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
---
 drivers/s390/char/sclp_cmd.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c
index 12f3d4af7e4e..428f8a583e8f 100644
--- a/drivers/s390/char/sclp_cmd.c
+++ b/drivers/s390/char/sclp_cmd.c
@@ -349,11 +349,6 @@ static int sclp_mem_notifier(struct notifier_block *nb,
 		if (contains_standby_increment(start, start + size))
 			rc = -EPERM;
 		break;
-	case MEM_ONLINE:
-	case MEM_CANCEL_OFFLINE:
-		break;
-	case MEM_GOING_ONLINE:
-		break;
 	case MEM_PHYS_ONLINE:
 		rc = sclp_mem_change_state(start, size, 1);
 		if (rc || !memory_block->altmap)
@@ -369,9 +364,6 @@ static int sclp_mem_notifier(struct notifier_block *nb,
 		 */
 		__arch_set_page_nodat((void *)start, memory_block->altmap->free);
 		break;
-	case MEM_CANCEL_ONLINE:
-	case MEM_OFFLINE:
-		break;
 	case MEM_PHYS_OFFLINE:
 		if (memory_block->altmap)
 			__remove_pages(arg->start_pfn, arg->nr_pages, memory_block->altmap);
-- 
2.41.0
Re: [PATCH 7/8] s390/sclp: remove unhandled memory notifier type
Posted by David Hildenbrand 2 years, 1 month ago
On 14.11.23 19:02, Sumanth Korikkar wrote:
> Remove memory notifier types which are unhandled by s390.  Unhandled
> memory notifier types are covered by default case.
> 
> Suggested-by: Alexander Gordeev <agordeev@linux.ibm.com>
> Reviewed-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
> Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
> ---
>   drivers/s390/char/sclp_cmd.c | 8 --------
>   1 file changed, 8 deletions(-)
> 
> diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c
> index 12f3d4af7e4e..428f8a583e8f 100644
> --- a/drivers/s390/char/sclp_cmd.c
> +++ b/drivers/s390/char/sclp_cmd.c
> @@ -349,11 +349,6 @@ static int sclp_mem_notifier(struct notifier_block *nb,
>   		if (contains_standby_increment(start, start + size))
>   			rc = -EPERM;
>   		break;
> -	case MEM_ONLINE:
> -	case MEM_CANCEL_OFFLINE:
> -		break;
> -	case MEM_GOING_ONLINE:
> -		break;
>   	case MEM_PHYS_ONLINE:
>   		rc = sclp_mem_change_state(start, size, 1);
>   		if (rc || !memory_block->altmap)
> @@ -369,9 +364,6 @@ static int sclp_mem_notifier(struct notifier_block *nb,
>   		 */
>   		__arch_set_page_nodat((void *)start, memory_block->altmap->free);
>   		break;
> -	case MEM_CANCEL_ONLINE:
> -	case MEM_OFFLINE:
> -		break;
>   	case MEM_PHYS_OFFLINE:
>   		if (memory_block->altmap)
>   			__remove_pages(arg->start_pfn, arg->nr_pages, memory_block->altmap);


You can remove MEM_ONLINE + MEM_CANCEL_OFFLINE ahead of time and just 
cleanup the others in the patch where you touch these cases.

-- 
Cheers,

David / dhildenb