Hi, On Thu, Aug 6, 2009 at 1:04 PM, Prasad Joshi<prasadjoshi124@xxxxxxxxx> wrote: > Hi All, > > I am porting a Windows device driver to Linux. > > I defined a macro for CONTANING_RECORD like > #define CONTAINING_RECORD(ptr, type, member) list_entry((ptr), (type), > (member)) > > When i compiled my module, i got following errors > > $ make 2>&1 | grep 1132 > alloc.c:1132: error: expected expression before ‘)’ token > alloc.c:1132: error: expected identifier before ‘(’ token > alloc.c:1132: warning: type defaults to ‘int’ in declaration of ‘__mptr’ > alloc.c:1132: warning: initialization from incompatible pointer type > alloc.c:1132: error: expected expression before ‘)’ token > > > Corresponding code snippet > > 1130 list_for_each(Entry, &Ptr->ActiveList[target]) { > 1131 > 1132 node = CONTAINING_RECORD(Entry, IFTL_EU, link); Could you please post also what type is IFTL_EU? list_entry is just wrapper for container_of and I think there could be a problem. > 1133 > 1134 die = DIE_FROM_EU(node->eu); > 1135 > 1136 if (Ptr->LastDie != die) { > 1137 Ptr->LastDie = die; > 1138 break; > 1139 } > 1140 } > > > > Then I changed macro with > #define CONTAINING_RECORD list_entry > $ make 2>&1 | grep 1132 > $ > > And it worked, but I am not getting what was problem with the first macro > definition. > > Thanks and Regards, > Prasad > > > > > good luck, Marek -- as simple as primitive as possible ------------------------------------------------- Marek Belisko - OPEN-NANDRA Ruska Nova Ves 219 | Presov, 08005 Slovak Republic Tel: +421 915 052 184 skype: marekwhite icq: 290551086 web: http://open-nandra.com -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ