Messages in this thread | | | Subject | Re: [PATCH 2/3] freevxfs: minor cleanups | From | Pekka Enberg <> | Date | Wed, 29 Jun 2005 07:20:21 +0300 |
| |
Hi,
On Tue, 2005-06-28 at 16:31 -0700, Andrew Morton wrote: > That struct initialisation: > > > + *infp = (struct vxfs_sb_info) { > > + .vsi_raw = rsbp, > > + .vsi_bp = bp, > > + .vsi_oltext = rsbp->vs_oltext[0], > > + .vsi_oltsize = rsbp->vs_oltsize, > > + }; > > Is a bit unconventional, but it doesn't alter the size of the .o file, so > whatever.
The rationale for this is that since NULL is not guaranteed to be zero by the C standard, memset() doesn't really initialize pointers properly. The above does. This came up when I wanted to replace explicit NULL assignments from the NTFS code with kcalloc() and the maintainer refused. Al Viro suggested the above form and was accepted by the NTFS maintainer as well.
Pekka
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |