* [PATCH 1/1] fs/xfs/xfs_log.c: Fix comparison to bool
@ 2014-04-13 20:09 Fabian Frederick
2014-04-16 22:15 ` Andrew Morton
0 siblings, 1 reply; 4+ messages in thread
From: Fabian Frederick @ 2014-04-13 20:09 UTC (permalink / raw)
To: linux-kernel; +Cc: hch, akpm
Fixing coccinelle warning
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
fs/xfs/xfs_log.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 8497a00..efb8f92 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -2376,7 +2376,7 @@ next_lv:
if (lv)
vecp = lv->lv_iovecp;
}
- if (record_cnt == 0 && ordered == false) {
+ if (record_cnt == 0 && !ordered) {
if (!lv)
return 0;
break;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] fs/xfs/xfs_log.c: Fix comparison to bool
2014-04-13 20:09 [PATCH 1/1] fs/xfs/xfs_log.c: Fix comparison to bool Fabian Frederick
@ 2014-04-16 22:15 ` Andrew Morton
2014-04-16 22:47 ` Joe Perches
2014-04-23 1:58 ` Dave Chinner
0 siblings, 2 replies; 4+ messages in thread
From: Andrew Morton @ 2014-04-16 22:15 UTC (permalink / raw)
To: Fabian Frederick; +Cc: linux-kernel, hch
On Sun, 13 Apr 2014 22:09:17 +0200 Fabian Frederick <fabf@skynet.be> wrote:
> Fixing coccinelle warning
Please always quote the full error message or warning text when fixing
such things.
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -2376,7 +2376,7 @@ next_lv:
> if (lv)
> vecp = lv->lv_iovecp;
> }
> - if (record_cnt == 0 && ordered == false) {
> + if (record_cnt == 0 && !ordered) {
> if (!lv)
> return 0;
There was nothing wrong with that code. I suspect coccinelle bustage.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] fs/xfs/xfs_log.c: Fix comparison to bool
2014-04-16 22:15 ` Andrew Morton
@ 2014-04-16 22:47 ` Joe Perches
2014-04-23 1:58 ` Dave Chinner
1 sibling, 0 replies; 4+ messages in thread
From: Joe Perches @ 2014-04-16 22:47 UTC (permalink / raw)
To: Andrew Morton; +Cc: Fabian Frederick, linux-kernel, hch
On Wed, 2014-04-16 at 15:15 -0700, Andrew Morton wrote:
> On Sun, 13 Apr 2014 22:09:17 +0200 Fabian Frederick <fabf@skynet.be> wrote:
> > Fixing coccinelle warning
[]
> > @@ -2376,7 +2376,7 @@ next_lv:
[]
> > - if (record_cnt == 0 && ordered == false) {
> > + if (record_cnt == 0 && !ordered) {
[]
> There was nothing wrong with that code. I suspect coccinelle bustage.
Not really.
It's more a conceit that consistent uses of direct
boolean variable tests are less likely to be error
prone than variable comparisons to boolean literals.
Many style guides, CodingStyle not included, suggest
avoiding comparisons to boolean literals.
There is a checkpatch --strict message when comparing
a literal true/false.
I tend not to change these unless there are multiple
styles in the same subsystem/file.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] fs/xfs/xfs_log.c: Fix comparison to bool
2014-04-16 22:15 ` Andrew Morton
2014-04-16 22:47 ` Joe Perches
@ 2014-04-23 1:58 ` Dave Chinner
1 sibling, 0 replies; 4+ messages in thread
From: Dave Chinner @ 2014-04-23 1:58 UTC (permalink / raw)
To: Andrew Morton; +Cc: Fabian Frederick, linux-kernel, hch
On Wed, Apr 16, 2014 at 03:15:57PM -0700, Andrew Morton wrote:
> On Sun, 13 Apr 2014 22:09:17 +0200 Fabian Frederick <fabf@skynet.be> wrote:
>
> > Fixing coccinelle warning
>
> Please always quote the full error message or warning text when fixing
> such things.
And CC the correct lists (xfs@oss.sgi.com) and/or the subsystem
maintainer (me). LKML is extremely lossy - I got behind on reading
it and so simply deleted the 10,000 queued emails, one of which was
this patch....
> > --- a/fs/xfs/xfs_log.c
> > +++ b/fs/xfs/xfs_log.c
> > @@ -2376,7 +2376,7 @@ next_lv:
> > if (lv)
> > vecp = lv->lv_iovecp;
> > }
> > - if (record_cnt == 0 && ordered == false) {
> > + if (record_cnt == 0 && !ordered) {
> > if (!lv)
> > return 0;
>
> There was nothing wrong with that code. I suspect coccinelle bustage.
Agreed, especially given that the variable is declared as:
bool ordered = false;
So it can only have the values of false and true....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-04-23 1:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-13 20:09 [PATCH 1/1] fs/xfs/xfs_log.c: Fix comparison to bool Fabian Frederick
2014-04-16 22:15 ` Andrew Morton
2014-04-16 22:47 ` Joe Perches
2014-04-23 1:58 ` Dave Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox