From 9fdc723abf50e3317387f712c5c1b70f86ac0d74 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 9 Oct 2014 12:59:39 +0300 Subject: [PATCH] ipw2x00: clean up a condition The original condition was "(PAGE_SIZE - len)" when "(len < PAGE_SIZE)" is intended. This condition is not really sufficient, but also not really needed... If "len > PAGE_SIZE" then it we will print a warning message in dmesg but there are no other effects. Maybe we should just remove the condition? Signed-off-by: Dan Carpenter Signed-off-by: John W. Linville --- drivers/net/wireless/ipw2x00/ipw2200.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index edc344334a75..67cad9b05ad8 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c @@ -1363,7 +1363,7 @@ static ssize_t show_cmd_log(struct device *d, if (!priv->cmdlog) return 0; for (i = (priv->cmdlog_pos + 1) % priv->cmdlog_len; - (i != priv->cmdlog_pos) && (PAGE_SIZE - len); + (i != priv->cmdlog_pos) && (len < PAGE_SIZE); i = (i + 1) % priv->cmdlog_len) { len += snprintf(buf + len, PAGE_SIZE - len, -- 2.30.2