summaryrefslogtreecommitdiff
path: root/arch/s390/mm/cmm.c
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2018-06-24 12:28:46 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2018-07-06 08:47:53 +0200
commit196851bed5221a7670024e3ad39704c6d92b2014 (patch)
treefa2ee6a6ab285514eea75ae451ec8de29e475039 /arch/s390/mm/cmm.c
parentf149371e9e02d23495fc796c09075adeb376a375 (diff)
s390/topology: correct topology mode proc handler
Reuse proc_douintvec_minmax to simplify topology mode proc handler. This also enforces correct range of 0-1 on proc writes and correctly handles numbers starting with 0 or spaces. Before: $ echo 01 > /proc/sys/s390/topology $ cat /proc/sys/s390/topology 0 $ echo ' 1' > /proc/sys/s390/topology -bash: echo: write error: Invalid argument $ echo 2 > /proc/sys/s390/topology -bash: echo: write error: Invalid argument $ echo 12 > /proc/sys/s390/topology $ cat /proc/sys/s390/topology 1 After: $ echo 01 > /proc/sys/s390/topology $ cat /proc/sys/s390/topology 1 $ echo ' 1' > /proc/sys/s390/topology $ cat /proc/sys/s390/topology 1 $ echo 2 > /proc/sys/s390/topology -bash: echo: write error: Invalid argument $ echo 12 > /proc/sys/s390/topology -bash: echo: write error: Invalid argument $ echo ' 0' > /proc/sys/s390/topology $ cat /proc/sys/s390/topology 0 Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm/cmm.c')
0 files changed, 0 insertions, 0 deletions