From 73c992f7dd460d694a8b66dda989bf45a15e1631 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 10 Oct 2012 02:55:31 +0000 Subject: [PATCH] Convert sizeof expr into sizeof(expr) Avoids that the checkpatch tool included in kernel 3.6 emits the following warning: WARNING: sizeof *attr should be sizeof(*attr) This patch has been generated by running the following command over the SCST source tree and by reviewing these changes manually: find -name '*.[ch]' | xargs -d\\n sed -i.tmp -e 's/sizeof *\([^(][^(),; ]*\)/sizeof(\1)/g' From: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4556 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/usr/iscsid.c | 4 ++-- scst/src/scst_tg.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iscsi-scst/usr/iscsid.c b/iscsi-scst/usr/iscsid.c index 21663a9cf..a1797b67b 100644 --- a/iscsi-scst/usr/iscsid.c +++ b/iscsi-scst/usr/iscsid.c @@ -105,7 +105,7 @@ static char *next_key(char **data, int *datasize, char **value) static struct buf_segment *conn_alloc_buf_segment(struct connection *conn, size_t sz) { - struct buf_segment *seg = malloc(sizeof *seg + sz); + struct buf_segment *seg = malloc(sizeof(*seg) + sz); if (seg) { seg->len = 0; @@ -640,7 +640,7 @@ static void cmnd_reject(struct connection *conn, u8 reason) conn_free_rsp_buf_list(conn); seg = conn_alloc_buf_segment(conn, data_sz); - memset(rej, 0x0, sizeof *rej); + memset(rej, 0x0, sizeof(*rej)); rej->opcode = ISCSI_OP_REJECT_MSG; rej->reason = reason; rej->ffffffff = ISCSI_RESERVED_TAG; diff --git a/scst/src/scst_tg.c b/scst/src/scst_tg.c index 403b16b57..7a2686ce9 100644 --- a/scst/src/scst_tg.c +++ b/scst/src/scst_tg.c @@ -178,7 +178,7 @@ int scst_tg_tgt_add(struct scst_target_group *tg, const char *name) BUG_ON(!tg); BUG_ON(!name); res = -ENOMEM; - tg_tgt = kzalloc(sizeof *tg_tgt, GFP_KERNEL); + tg_tgt = kzalloc(sizeof(*tg_tgt), GFP_KERNEL); if (!tg_tgt) goto out; tg_tgt->tg = tg; @@ -298,7 +298,7 @@ int scst_tg_add(struct scst_dev_group *dg, const char *name) TRACE_ENTRY(); res = -ENOMEM; - tg = kzalloc(sizeof *tg, GFP_KERNEL); + tg = kzalloc(sizeof(*tg), GFP_KERNEL); if (!tg) goto out; #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 24) @@ -424,7 +424,7 @@ int scst_dg_dev_add(struct scst_dev_group *dg, const char *name) int res; res = -ENOMEM; - dgdev = kzalloc(sizeof *dgdev, GFP_KERNEL); + dgdev = kzalloc(sizeof(*dgdev), GFP_KERNEL); if (!dgdev) goto out;