Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753780Ab1EOFcZ (ORCPT ); Sun, 15 May 2011 01:32:25 -0400 Received: from mail-px0-f173.google.com ([209.85.212.173]:45482 "EHLO mail-px0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752259Ab1EOFcB (ORCPT ); Sun, 15 May 2011 01:32:01 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=iv8G/hyeTQopppGlc4nCMmDi8dhU8IWUgKzU6g26sMX7bldOuU2380GHxTWEUfJHb9 POFr6btSwN0AO493fMQGBwddU4PCbfdKpZdpIMw6IKn6iCLpHzIh4+iM6ZtqaSE9hWPh r174l70njE8wk65p0wN5RtL3yrnmqBDhro4z8= From: Namhyung Kim To: FUJITA Tomonori , Jens Axboe Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] bsg: remove unnecessary conditional expressions Date: Sun, 15 May 2011 14:31:52 +0900 Message-Id: <1305437513-3914-2-git-send-email-namhyung@gmail.com> X-Mailer: git-send-email 1.7.5 In-Reply-To: <1305437513-3914-1-git-send-email-namhyung@gmail.com> References: <1305437513-3914-1-git-send-email-namhyung@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1306 Lines: 39 Second condition in OR always implies first condition is false thus bytes_read in the second is not needed. The same goes to bytes_written. Signed-off-by: Namhyung Kim --- block/bsg.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/block/bsg.c b/block/bsg.c index c4f49e255751..b7e42ad55361 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -606,7 +606,7 @@ bsg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) ret = __bsg_read(buf, count, bd, NULL, &bytes_read); *ppos = bytes_read; - if (!bytes_read || (bytes_read && err_block_err(ret))) + if (!bytes_read || err_block_err(ret)) bytes_read = ret; return bytes_read; @@ -686,7 +686,7 @@ bsg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) /* * return bytes written on non-fatal errors */ - if (!bytes_written || (bytes_written && err_block_err(ret))) + if (!bytes_written || err_block_err(ret)) bytes_written = ret; dprintk("%s: returning %Zd\n", bd->name, bytes_written); -- 1.7.5 -- 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/