mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
[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>
This commit is contained in:
parent
a29591c475
commit
0788fea4d5
1 changed files with 4 additions and 14 deletions
|
@ -14,6 +14,7 @@
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/reboot.h>
|
#include <linux/reboot.h>
|
||||||
#include <linux/ctype.h>
|
#include <linux/ctype.h>
|
||||||
|
#include <linux/fs.h>
|
||||||
#include <asm/ipl.h>
|
#include <asm/ipl.h>
|
||||||
#include <asm/smp.h>
|
#include <asm/smp.h>
|
||||||
#include <asm/setup.h>
|
#include <asm/setup.h>
|
||||||
|
@ -338,14 +339,8 @@ static struct kobj_attribute sys_ipl_device_attr =
|
||||||
static ssize_t ipl_parameter_read(struct kobject *kobj, struct bin_attribute *attr,
|
static ssize_t ipl_parameter_read(struct kobject *kobj, struct bin_attribute *attr,
|
||||||
char *buf, loff_t off, size_t count)
|
char *buf, loff_t off, size_t count)
|
||||||
{
|
{
|
||||||
unsigned int size = IPL_PARMBLOCK_SIZE;
|
return memory_read_from_buffer(buf, count, &off, IPL_PARMBLOCK_START,
|
||||||
|
IPL_PARMBLOCK_SIZE);
|
||||||
if (off > size)
|
|
||||||
return 0;
|
|
||||||
if (off + count > size)
|
|
||||||
count = size - off;
|
|
||||||
memcpy(buf, (void *)IPL_PARMBLOCK_START + off, count);
|
|
||||||
return count;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct bin_attribute ipl_parameter_attr = {
|
static struct bin_attribute ipl_parameter_attr = {
|
||||||
|
@ -363,12 +358,7 @@ static ssize_t ipl_scp_data_read(struct kobject *kobj, struct bin_attribute *att
|
||||||
unsigned int size = IPL_PARMBLOCK_START->ipl_info.fcp.scp_data_len;
|
unsigned int size = IPL_PARMBLOCK_START->ipl_info.fcp.scp_data_len;
|
||||||
void *scp_data = &IPL_PARMBLOCK_START->ipl_info.fcp.scp_data;
|
void *scp_data = &IPL_PARMBLOCK_START->ipl_info.fcp.scp_data;
|
||||||
|
|
||||||
if (off > size)
|
return memory_read_from_buffer(buf, count, &off, scp_data, size);
|
||||||
return 0;
|
|
||||||
if (off + count > size)
|
|
||||||
count = size - off;
|
|
||||||
memcpy(buf, scp_data + off, count);
|
|
||||||
return count;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct bin_attribute ipl_scp_data_attr = {
|
static struct bin_attribute ipl_scp_data_attr = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue