Re: [PATCH 56/56] xfs: Remove void casts

From: Bert Wesarg
Date: Wed Apr 08 2009 - 08:17:19 EST


On Wed, Apr 8, 2009 at 13:22, Jack Stone <jwjstone@xxxxxxxxxxx> wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <jwjstone@xxxxxxxxxxx>
> ---
> Âfs/xfs/quota/xfs_dquot_item.c | Â Â2 +-
> Âfs/xfs/support/ktrace.c    |  Â6 +++---
> Âfs/xfs/xfs_attr_leaf.c    Â|  Â2 +-
> Âfs/xfs/xfs_buf_item.c     |  Â6 +++---
> Âfs/xfs/xfs_extfree_item.c   |  Â8 ++++----
> Âfs/xfs/xfs_inode.c      Â|  Â5 ++---
> Âfs/xfs/xfs_log_recover.c   Â|  Â9 ++++-----
> Âfs/xfs/xfs_trans.c      Â|  Â2 +-
> Âfs/xfs/xfs_trans_inode.c   Â|  Â3 +--
> Âfs/xfs/xfs_trans_item.c    |  Â6 ++----
> Â10 files changed, 22 insertions(+), 27 deletions(-)
>
> diff --git a/fs/xfs/support/ktrace.c b/fs/xfs/support/ktrace.c
> index 2d494c2..3982acf 100644
> --- a/fs/xfs/support/ktrace.c
> +++ b/fs/xfs/support/ktrace.c
> @@ -75,10 +75,10 @@ ktrace_alloc(int nentries, unsigned int __nocast sleep)
> Â Â Â Â */
> Â Â Â Âentries = roundup_pow_of_two(nentries);
> Â Â Â Âif (entries == ktrace_zentries) {
> - Â Â Â Â Â Â Â ktep = (ktrace_entry_t*)kmem_zone_zalloc(ktrace_ent_zone,
> + Â Â Â Â Â Â Â ktep = kmem_zone_zalloc(ktrace_ent_zone,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âsleep);
Dito.

> Â Â Â Â} else {
> - Â Â Â Â Â Â Â ktep = (ktrace_entry_t*)kmem_zalloc((entries * sizeof(*ktep)),
> + Â Â Â Â Â Â Â ktep = kmem_zalloc((entries * sizeof(*ktep)),
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âsleep | KM_LARGE);
Please check.

> Â Â Â Â}
>
> diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
> index 92af409..431755a 100644
> --- a/fs/xfs/xfs_buf_item.c
> +++ b/fs/xfs/xfs_buf_item.c
> @@ -726,7 +726,7 @@ xfs_buf_item_init(
> Â Â Â Âchunks = (int)((XFS_BUF_COUNT(bp) + (XFS_BLI_CHUNK - 1)) >> XFS_BLI_SHIFT);
> Â Â Â Âmap_size = (int)((chunks + NBWORD) >> BIT_TO_WORD_SHIFT);
>
> - Â Â Â bip = (xfs_buf_log_item_t*)kmem_zone_zalloc(xfs_buf_item_zone,
> + Â Â Â bip = kmem_zone_zalloc(xfs_buf_item_zone,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ÂKM_SLEEP);
Dito.

> Â Â Â Âbip->bli_item.li_type = XFS_LI_BUF;
> Â Â Â Âbip->bli_item.li_ops = &xfs_buf_item_ops;
> diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c
> index 05a4bdd..53ccdc4 100644
> --- a/fs/xfs/xfs_extfree_item.c
> +++ b/fs/xfs/xfs_extfree_item.c
> @@ -253,9 +253,9 @@ xfs_efi_init(xfs_mount_t  Â*mp,
> Â Â Â Âif (nextents > XFS_EFI_MAX_FAST_EXTENTS) {
> Â Â Â Â Â Â Â Âsize = (uint)(sizeof(xfs_efi_log_item_t) +
> Â Â Â Â Â Â Â Â Â Â Â Â((nextents - 1) * sizeof(xfs_extent_t)));
> - Â Â Â Â Â Â Â efip = (xfs_efi_log_item_t*)kmem_zalloc(size, KM_SLEEP);
> + Â Â Â Â Â Â Â efip = kmem_zalloc(size, KM_SLEEP);
> Â Â Â Â} else {
> - Â Â Â Â Â Â Â efip = (xfs_efi_log_item_t*)kmem_zone_zalloc(xfs_efi_zone,
> + Â Â Â Â Â Â Â efip = kmem_zone_zalloc(xfs_efi_zone,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â KM_SLEEP);
Dito.

> Â Â Â Â}
>
> @@ -548,9 +548,9 @@ xfs_efd_init(xfs_mount_t  Â*mp,
> Â Â Â Âif (nextents > XFS_EFD_MAX_FAST_EXTENTS) {
> Â Â Â Â Â Â Â Âsize = (uint)(sizeof(xfs_efd_log_item_t) +
> Â Â Â Â Â Â Â Â Â Â Â Â((nextents - 1) * sizeof(xfs_extent_t)));
> - Â Â Â Â Â Â Â efdp = (xfs_efd_log_item_t*)kmem_zalloc(size, KM_SLEEP);
> + Â Â Â Â Â Â Â efdp = kmem_zalloc(size, KM_SLEEP);
> Â Â Â Â} else {
> - Â Â Â Â Â Â Â efdp = (xfs_efd_log_item_t*)kmem_zone_zalloc(xfs_efd_zone,
> + Â Â Â Â Â Â Â efdp = kmem_zone_zalloc(xfs_efd_zone,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â KM_SLEEP);
Dito.

> Â Â Â Â}
>
> diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
> index 7ba4501..3037920 100644
> --- a/fs/xfs/xfs_log_recover.c
> +++ b/fs/xfs/xfs_log_recover.c
> @@ -1670,7 +1670,7 @@ xlog_recover_do_buffer_pass1(
> Â Â Â Â * the bucket.
> Â Â Â Â */
> Â Â Â Âif (*bucket == NULL) {
> - Â Â Â Â Â Â Â bcp = (xfs_buf_cancel_t *)kmem_alloc(sizeof(xfs_buf_cancel_t),
> + Â Â Â Â Â Â Â bcp = kmem_alloc(sizeof(xfs_buf_cancel_t),
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â KM_SLEEP);
Dito.

> Â Â Â Â Â Â Â Âbcp->bc_blkno = blkno;
> Â Â Â Â Â Â Â Âbcp->bc_len = len;
> @@ -1696,7 +1696,7 @@ xlog_recover_do_buffer_pass1(
> Â Â Â Â Â Â Â Ânextp = nextp->bc_next;
> Â Â Â Â}
> Â Â Â ÂASSERT(prevp != NULL);
> - Â Â Â bcp = (xfs_buf_cancel_t *)kmem_alloc(sizeof(xfs_buf_cancel_t),
> + Â Â Â bcp = kmem_alloc(sizeof(xfs_buf_cancel_t),
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â KM_SLEEP);
Dito.

> Â Â Â Âbcp->bc_blkno = blkno;
> Â Â Â Âbcp->bc_len = len;
> @@ -2316,7 +2316,7 @@ xlog_recover_do_inode_trans(
> Â Â Â Âif (item->ri_buf[0].i_len == sizeof(xfs_inode_log_format_t)) {
> Â Â Â Â Â Â Â Âin_f = (xfs_inode_log_format_t *)item->ri_buf[0].i_addr;
> Â Â Â Â} else {
> - Â Â Â Â Â Â Â in_f = (xfs_inode_log_format_t *)kmem_alloc(
> + Â Â Â Â Â Â Â in_f = kmem_alloc(
> Â Â Â Â Â Â Â Â Â Â Â Âsizeof(xfs_inode_log_format_t), KM_SLEEP);
Please check.

> Â Â Â Â Â Â Â Âneed_free = 1;
> Â Â Â Â Â Â Â Âerror = xfs_inode_item_format_convert(&item->ri_buf[0], in_f);
> diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
> index 8570b82..44d039d 100644
> --- a/fs/xfs/xfs_trans.c
> +++ b/fs/xfs/xfs_trans.c
> @@ -868,7 +868,7 @@ shut_us_down:
> Â Â Â Â} else if (nvec <= XFS_TRANS_LOGVEC_COUNT) {
> Â Â Â Â Â Â Â Âlog_vector = log_vector_fast;
> Â Â Â Â} else {
> - Â Â Â Â Â Â Â log_vector = (xfs_log_iovec_t *)kmem_alloc(nvec *
> + Â Â Â Â Â Â Â log_vector = kmem_alloc(nvec *
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â sizeof(xfs_log_iovec_t),
Move up.

> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â KM_SLEEP);
Probably realign.

> Â Â Â Â}
> --

Bert
¢éì®&Þ~º&¶¬–+-±éÝ¥Šw®žË±Êâmébžìdz¹Þ)í…æèw*jg¬±¨¶‰šŽŠÝj/êäz¹ÞŠà2ŠÞ¨è­Ú&¢)ß«a¶Úþø®G«éh®æj:+v‰¨Šwè†Ù>Wš±êÞiÛaxPjØm¶Ÿÿà -»+ƒùdš_