Sorry for the late reply. I totally lost track of this thread. :/
pahole shows exactly the same output either if cf is a zero-length array or
a flexible-array member:
$ pahole -C 'can_skb_priv' drivers/net/can/dev.o
struct can_skb_priv {
int ifindex; /* 0 4 */
int skbcnt; /* 4 4 */
struct can_frame cf[] __attribute__((__aligned__(8))); /* 8 0 */
/* size: 8, cachelines: 1, members: 3 */
/* forced alignments: 1 */
/* last cacheline: 8 bytes */
} __attribute__((__aligned__(8)));
So, it seems everything should fine. :)