From: Bj|rn A. <d3a...@dt...> - 2002-01-22 03:58:13
Attachments:
patch4-debugstuff
|
Hi! Here's a new version of the debug printing patch. I've indented it to match the existing code betteri, mostly. The patch also adds a little details to error messages, and fixes one that was plain wrong. It's against Johann's input-only patch to 2.4.17, but it should patch cleanly against the 2.5 tree, I think. /August. -- Wrong on most accounts. const Foo *foo; and Foo const *foo; mean the same: foo being a pointer to const Foo. const Foo const *foo; would mean the same but is illegal (double const). You are confusing this with Foo * const foo; and const Foo * const foo; respectively. -David Kastrup, comp.os.linux.development.system |
From: Vojtech P. <vo...@su...> - 2002-01-22 07:04:53
|
On Tue, Jan 22, 2002 at 04:58:04AM +0100, Bj|rn Augustsson wrote: > Hi! > > Here's a new version of the debug printing patch. I've indented it to > match the existing code betteri, mostly. The patch also adds a little > details to error messages, and fixes one that was plain wrong. > > It's against Johann's input-only patch to 2.4.17, but it should patch > cleanly against the 2.5 tree, I think. Thanks for the patch, with minor offsets it patched cleanly into a Dave Jones's 2.5.2-ac4-pre kernel. One minor bug in your patch - you made hid-core use dump_field, and didn't define it in case DEBUG wasn't set. -- Vojtech Pavlik SuSE Labs |
From: Bj|rn A. <d3a...@dt...> - 2002-01-22 13:18:49
|
Quoting Vojtech Pavlik <vo...@su...>: > On Tue, Jan 22, 2002 at 04:58:04AM +0100, Bj|rn Augustsson wrote: > > > Hi! > > > > Here's a new version of the debug printing patch. I've indented it to > > match the existing code betteri, mostly. The patch also adds a little > > details to error messages, and fixes one that was plain wrong. > > > > It's against Johann's input-only patch to 2.4.17, but it should patch > > cleanly against the 2.5 tree, I think. > > Thanks for the patch, with minor offsets it patched cleanly into a > Dave Jones's 2.5.2-ac4-pre kernel. One minor bug in your patch - you > made hid-core use dump_field, and didn't define it in case DEBUG wasn't > set. Ah, so I did. Hmm. One fix is to add dump_field to this section in hid.h: #ifdef DEBUG #include "hid-debug.h" #else #define hid_dump_input(a,b) do { } while (0) #define hid_dump_device(c) do { } while (0) #endif But better (IHMO) is for hid.h to include hid_debug.h unconditionally and have it define these functions as "do { } while (0)" or the real thing depending on DEBUG. That moves some cruft from hid.h to the debug file. Any problems with that? /August. -- Wrong on most accounts. const Foo *foo; and Foo const *foo; mean the same: foo being a pointer to const Foo. const Foo const *foo; would mean the same but is illegal (double const). You are confusing this with Foo * const foo; and const Foo * const foo; respectively. -David Kastrup, comp.os.linux.development.system |
From: Vojtech P. <vo...@su...> - 2002-01-22 14:16:20
|
On Tue, Jan 22, 2002 at 02:18:40PM +0100, Bj|rn Augustsson wrote: > Quoting Vojtech Pavlik <vo...@su...>: > > On Tue, Jan 22, 2002 at 04:58:04AM +0100, Bj|rn Augustsson wrote: > > > > > Hi! > > > > > > Here's a new version of the debug printing patch. I've indented it to > > > match the existing code betteri, mostly. The patch also adds a little > > > details to error messages, and fixes one that was plain wrong. > > > > > > It's against Johann's input-only patch to 2.4.17, but it should patch > > > cleanly against the 2.5 tree, I think. > > > > Thanks for the patch, with minor offsets it patched cleanly into a > > Dave Jones's 2.5.2-ac4-pre kernel. One minor bug in your patch - you > > made hid-core use dump_field, and didn't define it in case DEBUG wasn't > > set. > > Ah, so I did. > > Hmm. One fix is to add dump_field to this section in hid.h: > > #ifdef DEBUG > #include "hid-debug.h" > #else > #define hid_dump_input(a,b) do { } while (0) > #define hid_dump_device(c) do { } while (0) > #endif Yes, that's what I did. > But better (IHMO) is for hid.h to include hid_debug.h unconditionally > and have it define these functions as "do { } while (0)" or the real > thing depending on DEBUG. That moves some cruft from hid.h to the > debug file. > > Any problems with that? I'm not sure which is less ugly - #defining the name of an existing function to override it or having the #ifdef in hid.h which noone else than the hid driver is supposed to include anyway. -- Vojtech Pavlik SuSE Labs |