From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757479AbYFAXek (ORCPT ); Sun, 1 Jun 2008 19:34:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756206AbYFAX3A (ORCPT ); Sun, 1 Jun 2008 19:29:00 -0400 Received: from rv-out-0506.google.com ([209.85.198.232]:26550 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756868AbYFAX26 (ORCPT ); Sun, 1 Jun 2008 19:28:58 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:references:user-agent:date:from:to:cc:subject:content-disposition; b=nODVbgk5L6/SU/MiRwjZnGiiFRSlq6AmYPMqFsQh7ZX6EjeOVEVClALCwamHal01YaGL+9P1UkzqWWjQmhv2Hbz+ueJfe/FJOYZJS3pO0jza2QJq3hveCvTmiepV15g/n+kKRNFdJ1k5KsiY2RD3/gSCxk/UxnIcOffnptRdk7g= Message-Id: <20080601231643.286530029@gmail.com> References: <20080601231329.223608711@gmail.com> User-Agent: quilt/0.46-1 Date: Mon, 02 Jun 2008 08:13:50 +0900 From: akinobu.mita@gmail.com To: linux-kernel@vger.kernel.org Cc: Martin Schwidefsky , Heiko Carstens , linux390@de.ibm.com, linux-s390@vger.kernel.org Subject: [patch -v2 21/23] s390: use memory_read_from_buffer Content-Disposition: inline; filename=s390-ipl-use-memory-read-from-buffer.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Akinobu Mita Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: linux390@de.ibm.com Cc: linux-s390@vger.kernel.org --- arch/s390/kernel/ipl.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) Index: 2.6-git/arch/s390/kernel/ipl.c =================================================================== --- 2.6-git.orig/arch/s390/kernel/ipl.c +++ 2.6-git/arch/s390/kernel/ipl.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -285,14 +286,8 @@ static struct kobj_attribute sys_ipl_dev static ssize_t ipl_parameter_read(struct kobject *kobj, struct bin_attribute *attr, char *buf, loff_t off, size_t count) { - unsigned int size = 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; + return memory_read_from_buffer(buf, count, &off, IPL_PARMBLOCK_START, + IPL_PARMBLOCK_SIZE); } static struct bin_attribute ipl_parameter_attr = { @@ -310,12 +305,7 @@ static ssize_t ipl_scp_data_read(struct unsigned int size = IPL_PARMBLOCK_START->ipl_info.fcp.scp_data_len; void *scp_data = &IPL_PARMBLOCK_START->ipl_info.fcp.scp_data; - if (off > size) - return 0; - if (off + count > size) - count = size - off; - memcpy(buf, scp_data + off, count); - return count; + return memory_read_from_buffer(buf, count, &off, scp_data, size); } static struct bin_attribute ipl_scp_data_attr = { --