* [patch 2/2] ipw2x00: clean up a condition
@ 2014-10-09 9:59 Dan Carpenter
2014-10-15 20:52 ` Stanislav Yakovlev
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-10-09 9:59 UTC (permalink / raw)
To: Stanislav Yakovlev; +Cc: John W. Linville, linux-wireless, kernel-janitors
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 <dan.carpenter@oracle.com>
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index edc3443..67cad9b 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,
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch 2/2] ipw2x00: clean up a condition
2014-10-09 9:59 [patch 2/2] ipw2x00: clean up a condition Dan Carpenter
@ 2014-10-15 20:52 ` Stanislav Yakovlev
0 siblings, 0 replies; 2+ messages in thread
From: Stanislav Yakovlev @ 2014-10-15 20:52 UTC (permalink / raw)
To: Dan Carpenter; +Cc: John W. Linville, wireless, kernel-janitors
Hello Dan,
On 9 October 2014 02:59, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 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 <dan.carpenter@oracle.com>
Looks fine, thanks.
Stanislav.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-15 20:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-09 9:59 [patch 2/2] ipw2x00: clean up a condition Dan Carpenter
2014-10-15 20:52 ` Stanislav Yakovlev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox