[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2020-07-11 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 Mark Johnston changed: What|Removed |Added Status|New |Open CC|

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-10-08 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 --- Comment #17 from Andrew Reiter --- Created attachment 208185 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=208185&action=edit Final (?) source diff with a couple cases added that were missed by coccinelle Final (?) source d

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-10-08 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 Andrew Reiter changed: What|Removed |Added Version|12.0-RELEASE|CURRENT -- You are receiving this

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-10-07 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 --- Comment #16 from Andrew Reiter --- (In reply to Andrew Reiter from comment #15) IOW, I think the last diff attached may be worth going forward with. -- You are receiving this mail because: You are the assignee for the bug. ___

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-10-07 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 --- Comment #15 from Andrew Reiter --- Created attachment 208169 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=208169&action=edit updated patch with better coverage Ok, so the cocci 2 script seems to generate some FP cases that

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-10-07 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 --- Comment #14 from Conrad Meyer --- (In reply to Andrew Reiter from comment #11) > Thanks for the comments. I am attaching a new version (titled "cocci 2" in the > attachments list) that simplifies some things. Thanks! > It probably cou

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-10-07 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 --- Comment #13 from Andrew Reiter --- (In reply to Andrew Reiter from comment #12) And this version runs in a reasonable amount of time :-P -- You are receiving this mail because: You are the assignee for the bug. ___

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-10-07 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 Andrew Reiter changed: What|Removed |Added Attachment #208157|text/x-csrc |text/plain mime type|

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-10-07 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 --- Comment #11 from Andrew Reiter --- (In reply to Conrad Meyer from comment #10) Thanks for the comments. I am attaching a new version (titled "cocci 2" in the attachments list) that simplifies some things. It probably could be a lot bett

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-10-06 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 --- Comment #10 from Conrad Meyer --- Also, I think the patch could be simplified quite a bit if we can nest the conditional matching (i.e., result cast to type or not; position of M_WAITOK in flags; even allocation function (not sure the n

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-10-06 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 --- Comment #9 from Andrew Reiter --- (In reply to Conrad Meyer from comment #8) Ahh, really good point; thank you for bringing that up. I will look into this. -- You are receiving this mail because: You are the assignee for the bug.

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-10-06 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 --- Comment #8 from Conrad Meyer --- There's some way of declaring that a coccinelle variable ('buf') hasn't been reassigned since the earlier malloc call, although I don't recall how to do it. E.g., in this code, buf = malloc(M_WAITOK)

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-10-06 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 --- Comment #7 from Andrew Reiter --- Created attachment 208142 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=208142&action=edit Coccinelle patch that generates a unified diff for this Still need to look through / basic test th

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-10-04 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 --- Comment #6 from Andrew Reiter --- Brief update: I have worked up a Coccinelle semantic patch for this, finally. I am going to do local testing and then push it here. -- You are receiving this mail because: You are the assignee for the

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-09-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 --- Comment #5 from Andrew Reiter --- Comment for posterity: the pass used to find the ones in patch: https://github.com/roachspray/mwaitok-unneeded-rv-check -- You are receiving this mail because: You are the assignee for the bug. __

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-09-12 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 Mark Linimon changed: What|Removed |Added Keywords||patch -- You are receiving this ma

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-09-12 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 --- Comment #4 from Conrad Meyer --- Yes, I've used it, pfg@ has used it some, and I believe mjg@ has as well (https://reviews.freebsd.org/D21427). -- You are receiving this mail because: You are the assignee for the bug.

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-09-12 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 --- Comment #3 from Andrew Reiter --- (In reply to Conrad Meyer from comment #2) No I have not used that tool before, but it looks handy. Is there any history of it being used in any FreeBSD processes before? Thanks for the pointer! -- Yo

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-09-12 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 Conrad Meyer changed: What|Removed |Added CC||c...@freebsd.org --- Comment #2 fro

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-09-12 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 --- Comment #1 from Conrad Meyer --- It is definitely ok for malloc, mallocarray, and realloc. (We have a kernel reallocf? Huh.) Honestly, reallocf with M_WAITOK seems like a mistake — those could instead/additionally be replaced with ju

[Bug 240545] patch to remove unneeded M_WAITOK return value checks

2019-09-12 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240545 Bug ID: 240545 Summary: patch to remove unneeded M_WAITOK return value checks Product: Base System Version: 12.0-RELEASE Hardware: Any OS: Any Status: New