Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755399AbbGZV0H (ORCPT ); Sun, 26 Jul 2015 17:26:07 -0400 Received: from li271-223.members.linode.com ([178.79.152.223]:55687 "EHLO mail.mleia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755256AbbGZV0B (ORCPT ); Sun, 26 Jul 2015 17:26:01 -0400 From: Vladimir Zapolskiy To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Maxime Ripard Subject: [PATCH 8/8] misc: eeprom: sunxi_sid: clean up sid_read() Date: Mon, 27 Jul 2015 00:18:53 +0300 Message-Id: <1437945533-27996-8-git-send-email-vz@mleia.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1437945502-27944-1-git-send-email-vz@mleia.com> References: <1437945502-27944-1-git-send-email-vz@mleia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20150726_222437_275635_01EE7010 X-CRM114-Status: GOOD ( 13.46 ) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1182 Lines: 34 The change removes redundant sysfs binary file boundary checks, since this task is already done on caller side in fs/sysfs/file.c Signed-off-by: Vladimir Zapolskiy Cc: linux-arm-kernel@lists.infradead.org Cc: Maxime Ripard --- drivers/misc/eeprom/sunxi_sid.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/misc/eeprom/sunxi_sid.c b/drivers/misc/eeprom/sunxi_sid.c index 8385177..26ce99d 100644 --- a/drivers/misc/eeprom/sunxi_sid.c +++ b/drivers/misc/eeprom/sunxi_sid.c @@ -70,11 +70,6 @@ static ssize_t sid_read(struct file *fd, struct kobject *kobj, pdev = to_platform_device(kobj_to_dev(kobj)); sid_data = platform_get_drvdata(pdev); - if (pos < 0 || pos >= sid_data->keysize) - return 0; - if (size > sid_data->keysize - pos) - size = sid_data->keysize - pos; - for (i = 0; i < size; i++) buf[i] = sunxi_sid_read_byte(sid_data, pos + i); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/