• Tang Chen's avatar
    mem-hotplug: introduce MMOP_OFFLINE to replace the hard coding -1 · 4f7c6b49
    Tang Chen authored
    
    
    In store_mem_state(), we have:
    
      ...
      334         else if (!strncmp(buf, "offline", min_t(int, count, 7)))
      335                 online_type = -1;
      ...
      355         case -1:
      356                 ret = device_offline(&mem->dev);
      357                 break;
      ...
    
    Here, "offline" is hard coded as -1.
    
    This patch does the following renaming:
    
     ONLINE_KEEP     ->  MMOP_ONLINE_KEEP
     ONLINE_KERNEL   ->  MMOP_ONLINE_KERNEL
     ONLINE_MOVABLE  ->  MMOP_ONLINE_MOVABLE
    
    and introduces MMOP_OFFLINE = -1 to avoid hard coding.
    Signed-off-by: default avatarTang Chen <tangchen@cn.fujitsu.com>
    Cc: Hu Tao <hutao@cn.fujitsu.com>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
    Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
    Cc: Gu Zheng <guz.fnst@cn.fujitsu.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    4f7c6b49
memory_hotplug.c 50.1 KB