From: Lars Ellenberg Date: Fri, 18 Feb 2011 13:13:07 +0000 (+0100) Subject: drbd: simplify condition in drbd_may_do_local_read() X-Git-Tag: firefly_0821_release~3680^2~1419^2~18^2~454 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8c387def58351f571cfcad93a3b57dff415b40c0;p=firefly-linux-kernel-4.4.55.git drbd: simplify condition in drbd_may_do_local_read() fold if (x >= (N+1)) return 0; if (x < N) return 0; into if (x != N) return 0; Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index 48d313dcae7d..733219884ab7 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c @@ -663,9 +663,7 @@ static int drbd_may_do_local_read(struct drbd_conf *mdev, sector_t sector, int s if (mdev->state.disk == D_UP_TO_DATE) return 1; - if (mdev->state.disk >= D_OUTDATED) - return 0; - if (mdev->state.disk < D_INCONSISTENT) + if (mdev->state.disk != D_INCONSISTENT) return 0; esector = sector + (size >> 9) - 1;