On Sun, Jun 19, 2016 at 10:50:14AM +0200, Johannes Sixt wrote: > Am 19.06.2016 um 00:13 schrieb brian m. carlson: > > * Adjust the Coccinelle patches to transform plain structs before > > pointers to structs to avoid misconversions. This addresses the issue > > that Peff caught originally. > > To avoid future mistakes, can you write down how "transform plain structs > before pointers to structs" looks like? Is it a particular order of > Coccinelle rules? Which part of the interdiff between the previous round and > this round makes the difference? Yeah, I'd also like a better understanding of what went wrong in the original (just to be able to better evaluate the tool). Also, for the record, the issue was noticed by Johannes originally, not me, as indicated above (I just found a similar case after seeing his report). > On a tangent, I wondered recently, why we need oidcpy() and oidclr(). After > all, in place of, e.g., > > oidcpy(&pair->two->oid, &p->oid); > oidclr(&one->oid); > > we can write > > pair->two->oid = p->oid; > one->oid = null_oid; > > Is there a particular reason *not* to make this transition? I find the > latter less cluttered with equal clarity. I think traditionally we've avoided struct assignment because some ancient compilers didn't do it. But it's in C89, and I suspect it's crept into the code base anyway over the years without anyone complaining. -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html