aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/inode.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-08-15 16:45:44 +0200
committerJan Kara <jack@suse.cz>2017-08-16 16:42:03 +0200
commit033c9da00893e90dcff0a714bcb5d66890ad818a (patch)
tree393a43641ee656ae66f408b85c2f74c7bf23c35f /fs/udf/inode.c
parentfs-udf: Adjust two checks for null pointers (diff)
downloadlinux-dev-033c9da00893e90dcff0a714bcb5d66890ad818a.tar.xz
linux-dev-033c9da00893e90dcff0a714bcb5d66890ad818a.zip
fs-udf: Improve six size determinations
Replace the specification of data structures by variable references as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/inode.c')
-rw-r--r--fs/udf/inode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 18fdb9d90812..2bdb68215771 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -114,7 +114,7 @@ static void udf_update_extent_cache(struct inode *inode, loff_t estart,
__udf_clear_extent_cache(inode);
if (pos->bh)
get_bh(pos->bh);
- memcpy(&iinfo->cached_extent.epos, pos, sizeof(struct extent_position));
+ memcpy(&iinfo->cached_extent.epos, pos, sizeof(*pos));
iinfo->cached_extent.lstart = estart;
switch (iinfo->i_alloc_type) {
case ICBTAG_FLAG_AD_SHORT:
@@ -1703,7 +1703,7 @@ static int udf_update_inode(struct inode *inode, int do_sync)
dsea->impUseLength = cpu_to_le32(sizeof(struct regid));
}
eid = (struct regid *)dsea->impUse;
- memset(eid, 0, sizeof(struct regid));
+ memset(eid, 0, sizeof(*eid));
strcpy(eid->ident, UDF_ID_DEVELOPER);
eid->identSuffix[0] = UDF_OS_CLASS_UNIX;
eid->identSuffix[1] = UDF_OS_ID_LINUX;
@@ -1754,7 +1754,7 @@ static int udf_update_inode(struct inode *inode, int do_sync)
udf_time_to_disk_stamp(&efe->createTime, iinfo->i_crtime);
udf_time_to_disk_stamp(&efe->attrTime, inode->i_ctime);
- memset(&(efe->impIdent), 0, sizeof(struct regid));
+ memset(&(efe->impIdent), 0, sizeof(efe->impIdent));
strcpy(efe->impIdent.ident, UDF_ID_DEVELOPER);
efe->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX;
efe->impIdent.identSuffix[1] = UDF_OS_ID_LINUX;