From mboxrd@z Thu Jan 1 00:00:00 1970 From: Akinobu Mita Subject: [patch -v3 17/22] aty: use memory_read_from_buffer Date: Wed, 04 Jun 2008 20:56:50 +0900 Message-ID: <20080604115828.992854080@gmail.com> References: <20080604115633.116832712@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1K3rpM-0001TH-6M for linux-fbdev-devel@lists.sourceforge.net; Wed, 04 Jun 2008 05:10:52 -0700 Received: from py-out-1112.google.com ([64.233.166.178]) by mail.sourceforge.net with esmtp (Exim 4.44) id 1K3rpL-0005qB-RN for linux-fbdev-devel@lists.sourceforge.net; Wed, 04 Jun 2008 05:10:52 -0700 Received: by py-out-1112.google.com with SMTP id n24so31639pyh.20 for ; Wed, 04 Jun 2008 05:10:51 -0700 (PDT) Content-Disposition: inline; filename=aty-use-memory-read-from-buffer.patch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-fbdev-devel-bounces@lists.sourceforge.net Errors-To: linux-fbdev-devel-bounces@lists.sourceforge.net To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org Cc: Benjamin Herrenschmidt , linux-fbdev-devel@lists.sourceforge.net Signed-off-by: Akinobu Mita Cc: Benjamin Herrenschmidt Cc: linux-fbdev-devel@lists.sourceforge.net --- drivers/video/aty/radeon_base.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) Index: 2.6-git/drivers/video/aty/radeon_base.c =================================================================== --- 2.6-git.orig/drivers/video/aty/radeon_base.c +++ 2.6-git/drivers/video/aty/radeon_base.c @@ -70,6 +70,7 @@ #include #include #include +#include #include #include @@ -2098,15 +2099,7 @@ static void radeon_identify_vram(struct static ssize_t radeon_show_one_edid(char *buf, loff_t off, size_t count, const u8 *edid) { - if (off > EDID_LENGTH) - return 0; - - if (off + count > EDID_LENGTH) - count = EDID_LENGTH - off; - - memcpy(buf, edid + off, count); - - return count; + return memory_read_from_buffer(buf, count, &off, edid, EDID_LENGTH); } -- ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762300AbYFDMPy (ORCPT ); Wed, 4 Jun 2008 08:15:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754918AbYFDMKx (ORCPT ); Wed, 4 Jun 2008 08:10:53 -0400 Received: from py-out-1112.google.com ([64.233.166.182]:64902 "EHLO py-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760305AbYFDMKv (ORCPT ); Wed, 4 Jun 2008 08:10:51 -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=B7K3aZAytBst0H4P8W0mzFbfY6zFlEpVKzQTkKGlgDmZCu1IOGxuLm4v2xM+GT5d+/ C9rcflO3Zx8AjK+3y8VC/PHkshhFRjBnMIOCo/BO0zd+eOIMcgk8z0hzWz3F++JUscSa j++3fIA1IA2ZlrfK7VwUvcUV2Uvb7+fQs2QuE= Message-Id: <20080604115828.992854080@gmail.com> References: <20080604115633.116832712@gmail.com> User-Agent: quilt/0.46-1 Date: Wed, 04 Jun 2008 20:56:50 +0900 From: Akinobu Mita To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org Cc: Benjamin Herrenschmidt , linux-fbdev-devel@lists.sourceforge.net Subject: [patch -v3 17/22] aty: use memory_read_from_buffer Content-Disposition: inline; filename=aty-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: Benjamin Herrenschmidt Cc: linux-fbdev-devel@lists.sourceforge.net --- drivers/video/aty/radeon_base.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) Index: 2.6-git/drivers/video/aty/radeon_base.c =================================================================== --- 2.6-git.orig/drivers/video/aty/radeon_base.c +++ 2.6-git/drivers/video/aty/radeon_base.c @@ -70,6 +70,7 @@ #include #include #include +#include #include #include @@ -2098,15 +2099,7 @@ static void radeon_identify_vram(struct static ssize_t radeon_show_one_edid(char *buf, loff_t off, size_t count, const u8 *edid) { - if (off > EDID_LENGTH) - return 0; - - if (off + count > EDID_LENGTH) - count = EDID_LENGTH - off; - - memcpy(buf, edid + off, count); - - return count; + return memory_read_from_buffer(buf, count, &off, edid, EDID_LENGTH); } --