aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/ipl.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2008-07-14 03:59:17 -0400
committerHeiko Carstens <heiko.carstens@de.ibm.com>2008-07-14 04:02:16 -0400
commit0788fea4d583a3b7d199696819940ff3387d79a3 (patch)
tree9d5623b1331b04d2f870fb683fb488c595f4f2b1 /arch/s390/kernel/ipl.c
parenta29591c47524dde594c84a279a5f1827e688a4c4 (diff)
[S390] s390: use memory_read_from_buffer()
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Michael Holzheu <holzheu@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/ipl.c')
-rw-r--r--arch/s390/kernel/ipl.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 9f6dfd306abb..54b2779b5e2f 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -14,6 +14,7 @@
14#include <linux/delay.h> 14#include <linux/delay.h>
15#include <linux/reboot.h> 15#include <linux/reboot.h>
16#include <linux/ctype.h> 16#include <linux/ctype.h>
17#include <linux/fs.h>
17#include <asm/ipl.h> 18#include <asm/ipl.h>
18#include <asm/smp.h> 19#include <asm/smp.h>
19#include <asm/setup.h> 20#include <asm/setup.h>
@@ -338,14 +339,8 @@ static struct kobj_attribute sys_ipl_device_attr =
338static ssize_t ipl_parameter_read(struct kobject *kobj, struct bin_attribute *attr, 339static ssize_t ipl_parameter_read(struct kobject *kobj, struct bin_attribute *attr,
339 char *buf, loff_t off, size_t count) 340 char *buf, loff_t off, size_t count)
340{ 341{
341 unsigned int size = IPL_PARMBLOCK_SIZE; 342 return memory_read_from_buffer(buf, count, &off, IPL_PARMBLOCK_START,
342 343 IPL_PARMBLOCK_SIZE);
343 if (off > size)
344 return 0;
345 if (off + count > size)
346 count = size - off;
347 memcpy(buf, (void *)IPL_PARMBLOCK_START + off, count);
348 return count;
349} 344}
350 345
351static struct bin_attribute ipl_parameter_attr = { 346static struct bin_attribute ipl_parameter_attr = {
@@ -363,12 +358,7 @@ static ssize_t ipl_scp_data_read(struct kobject *kobj, struct bin_attribute *att
363 unsigned int size = IPL_PARMBLOCK_START->ipl_info.fcp.scp_data_len; 358 unsigned int size = IPL_PARMBLOCK_START->ipl_info.fcp.scp_data_len;
364 void *scp_data = &IPL_PARMBLOCK_START->ipl_info.fcp.scp_data; 359 void *scp_data = &IPL_PARMBLOCK_START->ipl_info.fcp.scp_data;
365 360
366 if (off > size) 361 return memory_read_from_buffer(buf, count, &off, scp_data, size);
367 return 0;
368 if (off + count > size)
369 count = size - off;
370 memcpy(buf, scp_data + off, count);
371 return count;
372} 362}
373 363
374static struct bin_attribute ipl_scp_data_attr = { 364static struct bin_attribute ipl_scp_data_attr = {