lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210829044947.14703-1-xi.fengfei@h3c.com>
Date:   Sun, 29 Aug 2021 12:49:47 +0800
From:   Fengfei Xi <xi.fengfei@....com>
To:     <colyli@...e.de>, <kent.overstreet@...il.com>
CC:     <linux-bcache@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        Fengfei Xi <xi.fengfei@....com>
Subject: [PATCH] bcache: remove the redundant judgment on bi_size

The bi_size is unsigned int type data not less than 0,
so we can directly add bi_size without extra judgment

Signed-off-by: Fengfei Xi <xi.fengfei@....com>
---
 drivers/md/bcache/request.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 6d1de889b..2788eec3a 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -423,9 +423,7 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio)
 	add_sequential(task);
 	i->sequential = 0;
 found:
-	if (i->sequential + bio->bi_iter.bi_size > i->sequential)
-		i->sequential	+= bio->bi_iter.bi_size;
-
+	i->sequential		+= bio->bi_iter.bi_size;
 	i->last			 = bio_end_sector(bio);
 	i->jiffies		 = jiffies + msecs_to_jiffies(5000);
 	task->sequential_io	 = i->sequential;
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ