diff options
| author | Panagiotis Issaris <takis@issaris.org> | 2006-09-27 04:49:39 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-27 11:26:10 -0400 |
| commit | f52720ca5f48574e347dff35ffe6b389ace61537 (patch) | |
| tree | 7efc8ec6bad32b98e406a5c553149d57e46bd07e /fs/ntfs | |
| parent | f8314dc60ccba7e41f425048c4160dc7f63377d5 (diff) | |
[PATCH] fs: Removing useless casts
* Removing useless casts
* Removing useless wrapper
* Conversion from kmalloc+memset to kzalloc
Signed-off-by: Panagiotis Issaris <takis@issaris.org>
Acked-by: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ntfs')
| -rw-r--r-- | fs/ntfs/dir.c | 5 | ||||
| -rw-r--r-- | fs/ntfs/inode.c | 2 | ||||
| -rw-r--r-- | fs/ntfs/mft.c | 4 | ||||
| -rw-r--r-- | fs/ntfs/unistr.c | 4 |
4 files changed, 7 insertions, 8 deletions
diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c index d1e2c6f9f05e..85c36b8ca452 100644 --- a/fs/ntfs/dir.c +++ b/fs/ntfs/dir.c | |||
| @@ -1149,8 +1149,7 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
| 1149 | * Allocate a buffer to store the current name being processed | 1149 | * Allocate a buffer to store the current name being processed |
| 1150 | * converted to format determined by current NLS. | 1150 | * converted to format determined by current NLS. |
| 1151 | */ | 1151 | */ |
| 1152 | name = (u8*)kmalloc(NTFS_MAX_NAME_LEN * NLS_MAX_CHARSET_SIZE + 1, | 1152 | name = kmalloc(NTFS_MAX_NAME_LEN * NLS_MAX_CHARSET_SIZE + 1, GFP_NOFS); |
| 1153 | GFP_NOFS); | ||
| 1154 | if (unlikely(!name)) { | 1153 | if (unlikely(!name)) { |
| 1155 | err = -ENOMEM; | 1154 | err = -ENOMEM; |
| 1156 | goto err_out; | 1155 | goto err_out; |
| @@ -1191,7 +1190,7 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
| 1191 | * map the mft record without deadlocking. | 1190 | * map the mft record without deadlocking. |
| 1192 | */ | 1191 | */ |
| 1193 | rc = le32_to_cpu(ctx->attr->data.resident.value_length); | 1192 | rc = le32_to_cpu(ctx->attr->data.resident.value_length); |
| 1194 | ir = (INDEX_ROOT*)kmalloc(rc, GFP_NOFS); | 1193 | ir = kmalloc(rc, GFP_NOFS); |
| 1195 | if (unlikely(!ir)) { | 1194 | if (unlikely(!ir)) { |
| 1196 | err = -ENOMEM; | 1195 | err = -ENOMEM; |
| 1197 | goto err_out; | 1196 | goto err_out; |
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index d313f356e66a..31852121b3f5 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c | |||
| @@ -137,7 +137,7 @@ static int ntfs_init_locked_inode(struct inode *vi, ntfs_attr *na) | |||
| 137 | 137 | ||
| 138 | BUG_ON(!na->name); | 138 | BUG_ON(!na->name); |
| 139 | i = na->name_len * sizeof(ntfschar); | 139 | i = na->name_len * sizeof(ntfschar); |
| 140 | ni->name = (ntfschar*)kmalloc(i + sizeof(ntfschar), GFP_ATOMIC); | 140 | ni->name = kmalloc(i + sizeof(ntfschar), GFP_ATOMIC); |
| 141 | if (!ni->name) | 141 | if (!ni->name) |
| 142 | return -ENOMEM; | 142 | return -ENOMEM; |
| 143 | memcpy(ni->name, na->name, i); | 143 | memcpy(ni->name, na->name, i); |
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index 2438c00ec0ce..578fb3d5e803 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c | |||
| @@ -331,7 +331,7 @@ map_err_out: | |||
| 331 | ntfs_inode **tmp; | 331 | ntfs_inode **tmp; |
| 332 | int new_size = (base_ni->nr_extents + 4) * sizeof(ntfs_inode *); | 332 | int new_size = (base_ni->nr_extents + 4) * sizeof(ntfs_inode *); |
| 333 | 333 | ||
| 334 | tmp = (ntfs_inode **)kmalloc(new_size, GFP_NOFS); | 334 | tmp = kmalloc(new_size, GFP_NOFS); |
| 335 | if (unlikely(!tmp)) { | 335 | if (unlikely(!tmp)) { |
| 336 | ntfs_error(base_ni->vol->sb, "Failed to allocate " | 336 | ntfs_error(base_ni->vol->sb, "Failed to allocate " |
| 337 | "internal buffer."); | 337 | "internal buffer."); |
| @@ -2893,7 +2893,7 @@ rollback: | |||
| 2893 | if (!(base_ni->nr_extents & 3)) { | 2893 | if (!(base_ni->nr_extents & 3)) { |
| 2894 | int new_size = (base_ni->nr_extents + 4) * sizeof(ntfs_inode*); | 2894 | int new_size = (base_ni->nr_extents + 4) * sizeof(ntfs_inode*); |
| 2895 | 2895 | ||
| 2896 | extent_nis = (ntfs_inode**)kmalloc(new_size, GFP_NOFS); | 2896 | extent_nis = kmalloc(new_size, GFP_NOFS); |
| 2897 | if (unlikely(!extent_nis)) { | 2897 | if (unlikely(!extent_nis)) { |
| 2898 | ntfs_error(vol->sb, "Failed to allocate internal " | 2898 | ntfs_error(vol->sb, "Failed to allocate internal " |
| 2899 | "buffer during rollback.%s", es); | 2899 | "buffer during rollback.%s", es); |
diff --git a/fs/ntfs/unistr.c b/fs/ntfs/unistr.c index b123c0fa6bf6..a1b572196fe4 100644 --- a/fs/ntfs/unistr.c +++ b/fs/ntfs/unistr.c | |||
| @@ -350,7 +350,7 @@ int ntfs_ucstonls(const ntfs_volume *vol, const ntfschar *ins, | |||
| 350 | } | 350 | } |
| 351 | if (!ns) { | 351 | if (!ns) { |
| 352 | ns_len = ins_len * NLS_MAX_CHARSET_SIZE; | 352 | ns_len = ins_len * NLS_MAX_CHARSET_SIZE; |
| 353 | ns = (unsigned char*)kmalloc(ns_len + 1, GFP_NOFS); | 353 | ns = kmalloc(ns_len + 1, GFP_NOFS); |
| 354 | if (!ns) | 354 | if (!ns) |
| 355 | goto mem_err_out; | 355 | goto mem_err_out; |
| 356 | } | 356 | } |
| @@ -365,7 +365,7 @@ retry: wc = nls->uni2char(le16_to_cpu(ins[i]), ns + o, | |||
| 365 | else if (wc == -ENAMETOOLONG && ns != *outs) { | 365 | else if (wc == -ENAMETOOLONG && ns != *outs) { |
| 366 | unsigned char *tc; | 366 | unsigned char *tc; |
| 367 | /* Grow in multiples of 64 bytes. */ | 367 | /* Grow in multiples of 64 bytes. */ |
| 368 | tc = (unsigned char*)kmalloc((ns_len + 64) & | 368 | tc = kmalloc((ns_len + 64) & |
| 369 | ~63, GFP_NOFS); | 369 | ~63, GFP_NOFS); |
| 370 | if (tc) { | 370 | if (tc) { |
| 371 | memcpy(tc, ns, ns_len); | 371 | memcpy(tc, ns, ns_len); |
