[PATCH] scst: Remove casts from INIT_DELAYED_WORK() statements

This is a source code cleanup patch that does not change any functionality.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5221 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2014-01-22 02:57:49 +00:00
parent 2ee6484c6d
commit 85ea152e0c
4 changed files with 12 additions and 15 deletions

View File

@@ -599,14 +599,14 @@ out:
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
static void conn_nop_in_delayed_work_fn(void *p)
#else
static void conn_nop_in_delayed_work_fn(struct delayed_work *work)
static void conn_nop_in_delayed_work_fn(struct work_struct *work)
#endif
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
struct iscsi_conn *conn = (struct iscsi_conn *)p;
#else
struct iscsi_conn *conn = container_of(work, struct iscsi_conn,
nop_in_delayed_work);
nop_in_delayed_work.work);
#endif
unsigned long next_timeout = 0;
@@ -933,7 +933,7 @@ static int iscsi_conn_alloc(struct iscsi_session *session,
conn->nop_in_ttt = 0;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20))
INIT_DELAYED_WORK(&conn->nop_in_delayed_work,
(void (*)(struct work_struct *))conn_nop_in_delayed_work_fn);
conn_nop_in_delayed_work_fn);
#else
INIT_WORK(&conn->nop_in_delayed_work, conn_nop_in_delayed_work_fn,
conn);

View File

@@ -1146,10 +1146,10 @@ static void q2t_undelete_sess(struct q2t_sess *sess)
return;
}
static void q2t_del_sess_work_fn(struct delayed_work *work)
static void q2t_del_sess_work_fn(struct work_struct *work)
{
struct q2t_tgt *tgt = container_of(work, struct q2t_tgt,
sess_del_work);
sess_del_work.work);
scsi_qla_host_t *ha = tgt->ha;
scsi_qla_host_t *pha = to_qla_parent(ha);
struct q2t_sess *sess;
@@ -5875,8 +5875,7 @@ static int q2t_add_target(scsi_qla_host_t *ha)
init_waitqueue_head(&tgt->waitQ);
INIT_LIST_HEAD(&tgt->sess_list);
INIT_LIST_HEAD(&tgt->del_sess_list);
INIT_DELAYED_WORK(&tgt->sess_del_work,
(void (*)(struct work_struct *))q2t_del_sess_work_fn);
INIT_DELAYED_WORK(&tgt->sess_del_work, q2t_del_sess_work_fn);
spin_lock_init(&tgt->sess_work_lock);
INIT_WORK(&tgt->sess_work, q2t_sess_work_fn);
INIT_LIST_HEAD(&tgt->sess_works_list);

View File

@@ -3167,14 +3167,14 @@ out:
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
static void scst_hw_pending_work_fn(void *p)
#else
static void scst_hw_pending_work_fn(struct delayed_work *work)
static void scst_hw_pending_work_fn(struct work_struct *work)
#endif
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
struct scst_session *sess = (struct scst_session *)p;
#else
struct scst_session *sess = container_of(work, struct scst_session,
hw_pending_work);
hw_pending_work.work);
#endif
struct scst_tgt_template *tgtt = sess->tgt->tgtt;
struct scst_cmd *cmd;
@@ -5096,8 +5096,7 @@ struct scst_session *scst_alloc_session(struct scst_tgt *tgt, gfp_t gfp_mask,
INIT_LIST_HEAD(&sess->init_deferred_cmd_list);
INIT_LIST_HEAD(&sess->init_deferred_mcmd_list);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20))
INIT_DELAYED_WORK(&sess->hw_pending_work,
(void (*)(struct work_struct *))scst_hw_pending_work_fn);
INIT_DELAYED_WORK(&sess->hw_pending_work, scst_hw_pending_work_fn);
#else
INIT_WORK(&sess->hw_pending_work, scst_hw_pending_work_fn, sess);
#endif

View File

@@ -424,7 +424,7 @@ static int sgv_shrink(struct shrinker *shrinker, struct shrink_control *sc)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
static void sgv_purge_work_fn(void *p)
#else
static void sgv_purge_work_fn(struct delayed_work *work)
static void sgv_purge_work_fn(struct work_struct *work)
#endif
{
unsigned long cur_time = jiffies;
@@ -432,7 +432,7 @@ static void sgv_purge_work_fn(struct delayed_work *work)
struct sgv_pool *pool = (struct sgv_pool *)p;
#else
struct sgv_pool *pool = container_of(work, struct sgv_pool,
sgv_purge_work);
sgv_purge_work.work);
#endif
TRACE_ENTRY();
@@ -1500,8 +1500,7 @@ static int sgv_pool_init(struct sgv_pool *pool, const char *name,
INIT_LIST_HEAD(&pool->recycling_lists[i]);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20))
INIT_DELAYED_WORK(&pool->sgv_purge_work,
(void (*)(struct work_struct *))sgv_purge_work_fn);
INIT_DELAYED_WORK(&pool->sgv_purge_work, sgv_purge_work_fn);
#else
INIT_WORK(&pool->sgv_purge_work, sgv_purge_work_fn, pool);
#endif