Re: + fix-vm_can_nonlinear-check-in-sys_remap_file_pages.patch added to -mm tree

Previous thread: [patch 00/12] 2.6.22.10 -stable review by Greg KH on Monday, October 8, 2007 - 2:05 pm. (35 messages)

Next thread: [PATCH] Documentation: Fix typo in SubmitChecklist. by James Bowes on Monday, October 8, 2007 - 2:55 pm. (2 messages)
To: <akpm@...>
Cc: <yanzheng@...>, <linux-kernel@...>
Date: Monday, October 8, 2007 - 2:40 pm

Ick.

[PATCH] typo time?

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

drivers/block/paride/pt.c | 2 -
drivers/block/pktcdvd.c | 4 +--
drivers/isdn/act2000/module.c | 22 ++++++++---------
drivers/isdn/i4l/isdn_ttyfax.c | 2 -
drivers/isdn/icn/icn.c | 22 ++++++++---------
drivers/isdn/isdnloop/isdnloop.c | 16 ++++++------
drivers/media/video/pvrusb2/pvrusb2-ctrl.c | 2 -
drivers/net/wireless/airo.c | 2 -
drivers/net/wireless/atmel.c | 2 -
drivers/net/wireless/prism54/isl_ioctl.c | 4 +--
drivers/net/wireless/zd1211rw/zd_rf_uw2453.c | 2 -
drivers/video/i810/i810_main.c | 2 -
drivers/video/sis/sis_main.c | 2 -
fs/ocfs2/alloc.c | 2 -
net/ieee80211/ieee80211_wx.c | 2 -
15 files changed, 44 insertions(+), 44 deletions(-)

--- a/drivers/block/paride/pt.c
+++ b/drivers/block/paride/pt.c
@@ -660,7 +660,7 @@ static int pt_open(struct inode *inode, struct file *file)
pt_identify(tape);

err = -ENODEV;
- if (!tape->flags & PT_MEDIA)
+ if (!(tape->flags & PT_MEDIA))
goto out;

err = -EROFS;
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2204,11 +2204,11 @@ static int pkt_media_speed(struct pktcdvd_device *pd, unsigned *speed)
return ret;
}

- if (!buf[6] & 0x40) {
+ if (!(buf[6] & 0x40)) {
printk(DRIVER_NAME": Disc type is not CD-RW\n");
return 1;
}
- if (!buf[6] & 0x4) {
+ if (!(buf[6] & 0x4)) {
printk(DRIVER_NAME": A1 values on media are not valid, maybe not CDRW?\n");
return 1;
}
--- a/drivers/isdn/act2000/module.c
+++ b/drivers/isdn/act2000/module.c
@@ -310,7 +310,7 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
}
break;
case ISDN_CMD_DIAL:
- if (!card->flags & ACT2000_FLAG...

To: Alexey Dobriyan <adobriyan@...>
Cc: <yanzheng@...>, <linux-kernel@...>
Date: Monday, October 22, 2007 - 6:17 pm

On Mon, 8 Oct 2007 22:40:44 +0400

I appreciate the patch, but that changelog is just stupid. Effectively
what it says is "Andrew, you get to type one up". I'd prefer not to,

seven different maintainers need to review and ack this. Sigh.
-

To: Alexey Dobriyan <adobriyan@...>
Cc: <akpm@...>, <yanzheng@...>, <linux-kernel@...>
Date: Tuesday, October 9, 2007 - 11:30 am

[snip]
Well, well... For the sake of experiment I'd modified sparse with
--- a/evaluate.c
+++ b/evaluate.c
@@ -916,6 +916,7 @@ static struct symbol *evaluate_binop(struct expression *expr)
rtype = integer_promotion(rtype);
} else {
// The rest do usual conversions
+ if (op == '&' && expr->left->type == EXPR_PREOP &&
+ expr->left->op == '!')
+ warning(expr->pos, "dubious: !x & y");
ltype = usual_conversions(op, expr->left, expr->right,
lclass, rclass, ltype, rtype);
ctype = rtype = ltype;

and ran cross-builds. Very nice hit rate:
* all places caught by Alexey's patch caught by that
* a bunch of additional bugs found
* a bunch of harmless but dumb (&& misspelled as & for no reason, etc.)
* one "don't know what they are doing, but it's certainly not right"
case (asus-laptop one below)

and no false positives. They _are_ possible (& deliberately used in something
like !foo() & !bar() to get both called), but none had been there in the
kernel.

Trying to go for a wider patterns like that (!x | y, x & !y, x | !y) had not
caught anything useful (one borderline case in mm/page_alloc.c - | used
instead of || for no good reason, etc.). It had found a lot of rather
revolting bitbanging, but that's it (
(!!test_bit(A, x)) << 2 | (!!test_bit(B, x)) << 1 | !!test_bit(C,x)
- that kind of thing).

Here's the list of what got caught, the patch incremental to Alexey's in the
end of posting.

arch/ia64/kernel/acpi.c:861:28: warning: dubious: !x & y
if ((lsapic->header.type != ACPI_MADT_TYPE_LOCAL_SAPIC) ||
(!lsapic->lapic_flags & ACPI_MADT_ENABLED)) {
Bug (missing parens)

arch/sparc64/kernel/time.c:1071:23: warning: dubious: !x & y
if (!mregs && !dregs & !bregs)
return -1;
Harmless, but dumb (& -> &&)

drivers/acpi/asus_acpi.c:599:22: warning: dubious: !x & y
if (invert) /* invert target...

To: Alexey Dobriyan <adobriyan@...>, Andy Whitcroft <apw@...>
Cc: <akpm@...>, <yanzheng@...>, <linux-kernel@...>
Date: Monday, October 8, 2007 - 7:09 pm

Perhaps a good candidate for checkpatch.pl? (Andy cc:d.)

Ray
-

Previous thread: [patch 00/12] 2.6.22.10 -stable review by Greg KH on Monday, October 8, 2007 - 2:05 pm. (35 messages)

Next thread: [PATCH] Documentation: Fix typo in SubmitChecklist. by James Bowes on Monday, October 8, 2007 - 2:55 pm. (2 messages)