Jeff Garzik wrote:
Tejun Heo wrote:
+struct ata_ering {
+ int cursor;
+ int size;
+ struct ata_ering_entry ring[];
+};
+
+#define DEFINE_ATA_ERING(name, size) \
+ struct ata_ering name; \
+ struct ata_ering_entry name_entries[size];
ACK, but this is creeping dangerously close to C abuse :)
This sort of code will confuse debuggers and source checkers.
Well, as ering is currently used in only one place and it will stay in
libata in the future, it might be better to remove the macro and shove
the allocation into where it's used; however, I prefer the macro because
it's safer and I don't use any debuggers or source checkers.
Linux source has lots of cpp macros like above and IMHO the above
doesn't even rank among C abuses. lxr and sparse would be fine.
--
tejun
-
: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html