Hi, > 1) What is this WARN_ON() and BUG_ON()? I've never seen them. I suspect > their purpose but I need to be sure.
They are the kernel's version of assert(), they trigger if the confition is true (which is opposite to assert). WARN isn't fatal while BUG is. They are in include/asm-generic/bug.h > 2) struct ptd is __attribute__((packed)). What does this mean? Why do > you use it? This stops gcc from adding padding to the structure. It is used because the struct needs to match precisely the H/W definition. gcc can and will (especially on ARM which has alignment requirements) align struct members to the natural alignment. > 3) Fld(), FInsrt() and FExtr()? I didn't find them anywhere.. from include/asm-arm/arch-pxa/bitfield.h. They are for defining and using bitfields. Do you know about the 'grep' tool? It's very useful for finding this kind of thing in a source tree. grep -r Fld include/ > 4) what about #if 0 and #if 1? What do they mean? These preprocessor directives comment out chunks of code. #if 0 cuts it out #if 1 puts it back in. I presume they are experimental bits or debugging code etc. > 5) finally, this DPRINTK thing, you write "#define _DPRINTK(fmt...) do > {} while (0)", inside ohci-isp1362.h . Now, what does that mean? and why > don't you use the functions of ohci, like ohci_debug etc? the "do {} while (0)" is a statement that has no effect but that can still safely be substituted for the DPRINTK by the preprocessor anywhere it is used. If you just define DPRINTK to nothing then things like if (x) DPRINTK(xxxxx); break. It is also used to wrap macros with multiple statements in them so they don't break in the same case. I guess the use of DPRINTK over ohci_debug or whatever is a personal thing while actively working on new code. Ian -- Ian Campbell, Senior Design Engineer Web: http://www.arcom.com Arcom, Clifton Road, Direct: +44 (0)1223 403 465 Cambridge CB1 7EA, United Kingdom Phone: +44 (0)1223 411 200 ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel