Patch from Bart Van Assche <bart.vanassche@gmail.com>:

The patch below fixes the following class of checkpatch.pl errors:
  ERROR("(foo*)" should be "(foo *)".
Or: another whitespace-only change.

I have verified that the output of svn diff -w -x is empty for this patch.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@383 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2008-05-21 15:43:54 +00:00
parent de18e64e3e
commit 21cc5df121
16 changed files with 83 additions and 83 deletions
+1 -1
View File
@@ -374,7 +374,7 @@ static int iscsi_check_version(unsigned long arg)
char ver[sizeof(ISCSI_SCST_INTERFACE_VERSION)+1];
int res;
res = copy_from_user(ver, (void*)arg, sizeof(ver));
res = copy_from_user(ver, (void *)arg, sizeof(ver));
if (res < 0) {
PRINT_ERROR("%s", "Unable to get version string");
goto out;
+6 -6
View File
@@ -569,7 +569,7 @@ static void iscsi_set_datasize(struct iscsi_cmnd *cmnd, u32 offset, u32 size)
if (size & 3) {
u32 last_off = offset + size;
int idx = last_off >> PAGE_SHIFT;
u8 *p = (u8*)page_address(sg_page(&cmnd->sg[idx])) +
u8 *p = (u8 *)page_address(sg_page(&cmnd->sg[idx])) +
(last_off & ~PAGE_MASK);
int i = 4 - (size & 3);
while (i--)
@@ -1137,7 +1137,7 @@ out:
static int iscsi_pre_exec(struct scst_cmd *scst_cmd)
{
int res = SCST_PREPROCESS_STATUS_SUCCESS;
struct iscsi_cmnd *req = (struct iscsi_cmnd*)
struct iscsi_cmnd *req = (struct iscsi_cmnd *)
scst_cmd_get_tgt_priv(scst_cmd);
struct iscsi_cmnd *c, *t;
@@ -1299,7 +1299,7 @@ static int scsi_cmnd_start(struct iscsi_cmnd *req)
req->dec_active_cmnds = 1;
scst_cmd = scst_rx_cmd(session->scst_sess,
(uint8_t*)&req_hdr->lun, sizeof(req_hdr->lun),
(uint8_t *)&req_hdr->lun, sizeof(req_hdr->lun),
req_hdr->scb, sizeof(req_hdr->scb), SCST_NON_ATOMIC);
if (scst_cmd == NULL) {
create_status_rsp(req, SAM_STAT_BUSY, NULL, 0);
@@ -2468,7 +2468,7 @@ static inline void iscsi_set_state_wake_up(struct iscsi_cmnd *req,
static void iscsi_preprocessing_done(struct scst_cmd *scst_cmd)
{
struct iscsi_cmnd *req = (struct iscsi_cmnd*)
struct iscsi_cmnd *req = (struct iscsi_cmnd *)
scst_cmd_get_tgt_priv(scst_cmd);
TRACE_DBG("req %p", req);
@@ -2541,7 +2541,7 @@ static void iscsi_try_local_processing(struct iscsi_conn *conn,
static int iscsi_xmit_response(struct scst_cmd *scst_cmd)
{
int is_send_status = scst_cmd_get_is_send_status(scst_cmd);
struct iscsi_cmnd *req = (struct iscsi_cmnd*)
struct iscsi_cmnd *req = (struct iscsi_cmnd *)
scst_cmd_get_tgt_priv(scst_cmd);
struct iscsi_conn *conn = req->conn;
int status = scst_cmd_get_status(scst_cmd);
@@ -2803,7 +2803,7 @@ static inline int iscsi_get_mgmt_response(int status)
static void iscsi_task_mgmt_fn_done(struct scst_mgmt_cmd *scst_mcmd)
{
struct iscsi_cmnd *req = (struct iscsi_cmnd*)
struct iscsi_cmnd *req = (struct iscsi_cmnd *)
scst_mgmt_cmd_get_tgt_priv(scst_mcmd);
int status = iscsi_get_mgmt_response(scst_mgmt_cmd_get_status(scst_mcmd));
+2 -2
View File
@@ -874,7 +874,7 @@ static inline void __iscsi_get_page_callback(struct iscsi_cmnd *cmd)
void iscsi_get_page_callback(struct page *page)
{
struct iscsi_cmnd *cmd = (struct iscsi_cmnd*)page->net_priv;
struct iscsi_cmnd *cmd = (struct iscsi_cmnd *)page->net_priv;
TRACE_NET_PAGE("page %p, _count %d", page,
atomic_read(&page->_count));
@@ -901,7 +901,7 @@ static inline void __iscsi_put_page_callback(struct iscsi_cmnd *cmd)
void iscsi_put_page_callback(struct page *page)
{
struct iscsi_cmnd *cmd = (struct iscsi_cmnd*)page->net_priv;
struct iscsi_cmnd *cmd = (struct iscsi_cmnd *)page->net_priv;
TRACE_NET_PAGE("page %p, _count %d", page,
atomic_read(&page->_count));
+2 -2
View File
@@ -49,7 +49,7 @@ static int nl_write(int fd, void *data, int len)
nlh.nlmsg_type = 0;
memset(&msg, 0, sizeof(msg));
msg.msg_name= (void*)&dest_addr;
msg.msg_name= (void *)&dest_addr;
msg.msg_namelen = sizeof(dest_addr);
msg.msg_iov = iov;
msg.msg_iovlen = 2;
@@ -69,7 +69,7 @@ static int nl_read(int fd, void *data, int len)
iov[1].iov_len = len;
memset(&msg, 0, sizeof(msg));
msg.msg_name= (void*)&src_addr;
msg.msg_name= (void *)&src_addr;
msg.msg_namelen = sizeof(src_addr);
msg.msg_iov = iov;
msg.msg_iovlen = 2;
+1 -1
View File
@@ -914,7 +914,7 @@ static void q2t_send_term_exchange(scsi_qla_host_t *ha, struct q2t_cmd *cmd,
goto out_unlock;
}
ctio = (ctio_ret_entry_t*)tgt_data.req_pkt(ha);
ctio = (ctio_ret_entry_t *)tgt_data.req_pkt(ha);
if (ctio == NULL) {
PRINT_ERROR("qla2x00tgt(%ld): %s failed: unable to allocate "
"request packet", ha->instance, __func__);
+1 -1
View File
@@ -143,7 +143,7 @@ qla2x00_show_port_database(struct class_device *cdev, char *buffer)
dma_addr_t pmap_dma;
port_data_t *pmap;
ulong dma_size = 0x100*sizeof(*pmap);
pmap = (port_data_t*)dma_alloc_coherent(&ha->pdev->dev, dma_size,
pmap = (port_data_t *)dma_alloc_coherent(&ha->pdev->dev, dma_size,
&pmap_dma, GFP_KERNEL);
if (pmap == NULL) {
size = snprintf(buffer, max_size, "DMA Alloc failed of %ld",
+1 -1
View File
@@ -1373,7 +1373,7 @@ qla2x00_error_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
#if defined(QL_DEBUG_LEVEL_2)
if (pkt->entry_status & RF_INV_E_ORDER) {
qla_printk(KERN_ERR, ha, "%s: Invalid Entry Order:\n", __func__);
qla2x00_dump_buffer((void*)pkt, sizeof(*pkt));
qla2x00_dump_buffer((void *)pkt, sizeof(*pkt));
} else if (pkt->entry_status & RF_INV_E_COUNT)
qla_printk(KERN_ERR, ha, "%s: Invalid Entry Count\n", __func__);
else if (pkt->entry_status & RF_INV_E_PARAM)
+34 -34
View File
@@ -327,7 +327,7 @@ static void dev_user_free_ucmd(struct scst_user_cmd *ucmd)
static struct page *dev_user_alloc_pages(struct scatterlist *sg,
gfp_t gfp_mask, void *priv)
{
struct scst_user_cmd *ucmd = (struct scst_user_cmd*)priv;
struct scst_user_cmd *ucmd = (struct scst_user_cmd *)priv;
int offset = 0;
TRACE_ENTRY();
@@ -426,7 +426,7 @@ static void __dev_user_free_sg_entries(struct scst_user_cmd *ucmd)
static void dev_user_free_sg_entries(struct scatterlist *sg, int sg_count,
void *priv)
{
struct scst_user_cmd *ucmd = (struct scst_user_cmd*)priv;
struct scst_user_cmd *ucmd = (struct scst_user_cmd *)priv;
TRACE_MEM("Freeing data pages (sg=%p, sg_count=%d, priv %p)", sg,
sg_count, ucmd);
@@ -493,7 +493,7 @@ static int dev_user_alloc_sg(struct scst_user_cmd *ucmd, int cached_buff)
&cmd->sg_cnt, &ucmd->sgv, ucmd);
if (cmd->sg != NULL) {
struct scst_user_cmd *buf_ucmd =
(struct scst_user_cmd*)sgv_get_priv(ucmd->sgv);
(struct scst_user_cmd *)sgv_get_priv(ucmd->sgv);
TRACE_MEM("Buf ucmd %p", buf_ucmd);
@@ -641,7 +641,7 @@ out:
static int dev_user_get_block(struct scst_cmd *cmd)
{
struct scst_user_dev *dev = (struct scst_user_dev*)cmd->dev->dh_priv;
struct scst_user_dev *dev = (struct scst_user_dev *)cmd->dev->dh_priv;
/*
* No need for locks here, since *_detach() can not be
* called, when there are existing commands.
@@ -655,7 +655,7 @@ static int dev_user_parse(struct scst_cmd *cmd)
int rc, res = SCST_CMD_STATE_DEFAULT;
struct scst_user_cmd *ucmd;
int atomic = scst_cmd_atomic(cmd);
struct scst_user_dev *dev = (struct scst_user_dev*)cmd->dev->dh_priv;
struct scst_user_dev *dev = (struct scst_user_dev *)cmd->dev->dh_priv;
int gfp_mask = atomic ? GFP_ATOMIC : GFP_KERNEL;
TRACE_ENTRY();
@@ -674,7 +674,7 @@ static int dev_user_parse(struct scst_cmd *cmd)
ucmd->cmd = cmd;
cmd->dh_priv = ucmd;
} else {
ucmd = (struct scst_user_cmd*)cmd->dh_priv;
ucmd = (struct scst_user_cmd *)cmd->dh_priv;
TRACE_DBG("Used ucmd %p, state %x", ucmd, ucmd->state);
}
@@ -783,7 +783,7 @@ out:
static int dev_user_exec(struct scst_cmd *cmd)
{
struct scst_user_cmd *ucmd = (struct scst_user_cmd*)cmd->dh_priv;
struct scst_user_cmd *ucmd = (struct scst_user_cmd *)cmd->dh_priv;
int res = SCST_EXEC_COMPLETED;
TRACE_ENTRY();
@@ -850,7 +850,7 @@ static void dev_user_free_sgv(struct scst_user_cmd *ucmd)
static void dev_user_on_free_cmd(struct scst_cmd *cmd)
{
struct scst_user_cmd *ucmd = (struct scst_user_cmd*)cmd->dh_priv;
struct scst_user_cmd *ucmd = (struct scst_user_cmd *)cmd->dh_priv;
TRACE_ENTRY();
@@ -893,7 +893,7 @@ out:
static void dev_user_set_block(struct scst_cmd *cmd, int block)
{
struct scst_user_dev *dev = (struct scst_user_dev*)cmd->dev->dh_priv;
struct scst_user_dev *dev = (struct scst_user_dev *)cmd->dev->dh_priv;
/*
* No need for locks here, since *_detach() can not be
* called, when there are existing commands.
@@ -1282,7 +1282,7 @@ static int dev_user_process_reply_exec(struct scst_user_cmd *ucmd,
if (res != 0)
goto out_compl;
res = copy_from_user(cmd->sense,
(void*)(unsigned long)ereply->psense_buffer,
(void *)(unsigned long)ereply->psense_buffer,
min((unsigned int)SCST_SENSE_BUFFERSIZE,
(unsigned int)ereply->sense_len));
if (res < 0) {
@@ -1429,7 +1429,7 @@ static int dev_user_reply_cmd(struct file *file, unsigned long arg)
TRACE_ENTRY();
mutex_lock(&dev_priv_mutex);
dev = (struct scst_user_dev*)file->private_data;
dev = (struct scst_user_dev *)file->private_data;
res = dev_user_check_reg(dev);
if (res != 0) {
mutex_unlock(&dev_priv_mutex);
@@ -1444,7 +1444,7 @@ static int dev_user_reply_cmd(struct file *file, unsigned long arg)
goto out_up;
}
res = copy_from_user(reply, (void*)arg, sizeof(*reply));
res = copy_from_user(reply, (void *)arg, sizeof(*reply));
if (res < 0)
goto out_free;
@@ -1679,7 +1679,7 @@ static int dev_user_reply_get_cmd(struct file *file, unsigned long arg,
TRACE_ENTRY();
mutex_lock(&dev_priv_mutex);
dev = (struct scst_user_dev*)file->private_data;
dev = (struct scst_user_dev *)file->private_data;
res = dev_user_check_reg(dev);
if (res != 0) {
mutex_unlock(&dev_priv_mutex);
@@ -1688,7 +1688,7 @@ static int dev_user_reply_get_cmd(struct file *file, unsigned long arg,
down_read(&dev->dev_rwsem);
mutex_unlock(&dev_priv_mutex);
res = copy_from_user(&ureply, (void*)arg, sizeof(ureply));
res = copy_from_user(&ureply, (void *)arg, sizeof(ureply));
if (res < 0)
goto out_up;
@@ -1702,8 +1702,8 @@ static int dev_user_reply_get_cmd(struct file *file, unsigned long arg,
if (ureply != 0) {
unsigned long u = (unsigned long)ureply;
reply = (struct scst_user_reply_cmd*)cmd;
res = copy_from_user(reply, (void*)u, sizeof(*reply));
reply = (struct scst_user_reply_cmd *)cmd;
res = copy_from_user(reply, (void *)u, sizeof(*reply));
if (res < 0)
goto out_free;
@@ -1723,7 +1723,7 @@ static int dev_user_reply_get_cmd(struct file *file, unsigned long arg,
*cmd = ucmd->user_cmd;
spin_unlock_irq(&dev->cmd_lists.cmd_list_lock);
TRACE_BUFFER("UCMD", cmd, sizeof(*cmd));
res = copy_to_user((void*)arg, cmd, sizeof(*cmd));
res = copy_to_user((void *)arg, cmd, sizeof(*cmd));
} else
spin_unlock_irq(&dev->cmd_lists.cmd_list_lock);
@@ -1770,7 +1770,7 @@ static long dev_user_ioctl(struct file *file, unsigned int cmd,
res = -ENOMEM;
goto out;
}
res = copy_from_user(dev_desc, (void*)arg, sizeof(*dev_desc));
res = copy_from_user(dev_desc, (void *)arg, sizeof(*dev_desc));
if (res < 0) {
kfree(dev_desc);
goto out;
@@ -1786,7 +1786,7 @@ static long dev_user_ioctl(struct file *file, unsigned int cmd,
{
struct scst_user_opt opt;
TRACE_DBG("%s", "SET_OPTIONS");
res = copy_from_user(&opt, (void*)arg, sizeof(opt));
res = copy_from_user(&opt, (void *)arg, sizeof(opt));
if (res < 0)
goto out;
TRACE_BUFFER("opt", &opt, sizeof(opt));
@@ -1796,7 +1796,7 @@ static long dev_user_ioctl(struct file *file, unsigned int cmd,
case SCST_USER_GET_OPTIONS:
TRACE_DBG("%s", "GET_OPTIONS");
res = dev_user_get_opt(file, (void*)arg);
res = dev_user_get_opt(file, (void *)arg);
break;
default:
@@ -1818,7 +1818,7 @@ static unsigned int dev_user_poll(struct file *file, poll_table *wait)
TRACE_ENTRY();
mutex_lock(&dev_priv_mutex);
dev = (struct scst_user_dev*)file->private_data;
dev = (struct scst_user_dev *)file->private_data;
res = dev_user_check_reg(dev);
if (res != 0) {
mutex_unlock(&dev_priv_mutex);
@@ -2136,7 +2136,7 @@ static int dev_user_task_mgmt_fn(struct scst_mgmt_cmd *mcmd,
{
int res, rc;
struct scst_user_cmd *ucmd;
struct scst_user_dev *dev = (struct scst_user_dev*)tgt_dev->dev->dh_priv;
struct scst_user_dev *dev = (struct scst_user_dev *)tgt_dev->dev->dh_priv;
struct scst_user_cmd *ucmd_to_abort = NULL;
TRACE_ENTRY();
@@ -2155,7 +2155,7 @@ static int dev_user_task_mgmt_fn(struct scst_mgmt_cmd *mcmd,
ucmd->user_cmd.tm_cmd.cmd_sn_set = mcmd->cmd_sn_set;
if (mcmd->cmd_to_abort != NULL) {
ucmd_to_abort = (struct scst_user_cmd*)mcmd->cmd_to_abort->dh_priv;
ucmd_to_abort = (struct scst_user_cmd *)mcmd->cmd_to_abort->dh_priv;
if (ucmd_to_abort != NULL)
ucmd->user_cmd.tm_cmd.cmd_h_to_abort = ucmd_to_abort->h;
}
@@ -2261,7 +2261,7 @@ out:
static void dev_user_detach(struct scst_device *sdev)
{
struct scst_user_dev *dev = (struct scst_user_dev*)sdev->dh_priv;
struct scst_user_dev *dev = (struct scst_user_dev *)sdev->dh_priv;
TRACE_ENTRY();
@@ -2315,7 +2315,7 @@ static int dev_user_process_reply_sess(struct scst_user_cmd *ucmd, int status)
static int dev_user_attach_tgt(struct scst_tgt_dev *tgt_dev)
{
struct scst_user_dev *dev =
(struct scst_user_dev*)tgt_dev->dev->dh_priv;
(struct scst_user_dev *)tgt_dev->dev->dh_priv;
int res = 0, rc;
struct scst_user_cmd *ucmd;
@@ -2401,14 +2401,14 @@ static void dev_user_pre_unreg_sess_work_fn(struct work_struct *work)
#endif
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
struct scst_user_pre_unreg_sess_obj *pd = (struct scst_user_pre_unreg_sess_obj*)p;
struct scst_user_pre_unreg_sess_obj *pd = (struct scst_user_pre_unreg_sess_obj *)p;
#else
struct scst_user_pre_unreg_sess_obj *pd = container_of(
(struct delayed_work*)work, struct scst_user_pre_unreg_sess_obj,
(struct delayed_work *)work, struct scst_user_pre_unreg_sess_obj,
pre_unreg_sess_work);
#endif
struct scst_user_dev *dev =
(struct scst_user_dev*)pd->tgt_dev->dev->dh_priv;
(struct scst_user_dev *)pd->tgt_dev->dev->dh_priv;
TRACE_ENTRY();
@@ -2433,7 +2433,7 @@ static void dev_user_pre_unreg_sess_work_fn(struct work_struct *work)
static void dev_user_pre_unreg_sess(struct scst_tgt_dev *tgt_dev)
{
struct scst_user_dev *dev =
(struct scst_user_dev*)tgt_dev->dev->dh_priv;
(struct scst_user_dev *)tgt_dev->dev->dh_priv;
struct scst_user_pre_unreg_sess_obj *pd;
TRACE_ENTRY();
@@ -2465,7 +2465,7 @@ static void dev_user_pre_unreg_sess(struct scst_tgt_dev *tgt_dev)
static void dev_user_detach_tgt(struct scst_tgt_dev *tgt_dev)
{
struct scst_user_dev *dev =
(struct scst_user_dev*)tgt_dev->dev->dh_priv;
(struct scst_user_dev *)tgt_dev->dev->dh_priv;
struct scst_user_cmd *ucmd;
struct scst_user_pre_unreg_sess_obj *pd = NULL, *p;
@@ -2578,7 +2578,7 @@ static int dev_user_check_version(const struct scst_user_dev_desc *dev_desc)
char ver[sizeof(DEV_USER_VERSION)+1];
int res;
res = copy_from_user(ver, (void*)(unsigned long)dev_desc->version_str,
res = copy_from_user(ver, (void *)(unsigned long)dev_desc->version_str,
sizeof(ver));
if (res < 0) {
PRINT_ERROR("%s", "Unable to get version string");
@@ -2840,7 +2840,7 @@ static int dev_user_set_opt(struct file *file, const struct scst_user_opt *opt)
TRACE_ENTRY();
mutex_lock(&dev_priv_mutex);
dev = (struct scst_user_dev*)file->private_data;
dev = (struct scst_user_dev *)file->private_data;
res = dev_user_check_reg(dev);
if (res != 0) {
mutex_unlock(&dev_priv_mutex);
@@ -2869,7 +2869,7 @@ static int dev_user_get_opt(struct file *file, void *arg)
TRACE_ENTRY();
mutex_lock(&dev_priv_mutex);
dev = (struct scst_user_dev*)file->private_data;
dev = (struct scst_user_dev *)file->private_data;
res = dev_user_check_reg(dev);
if (res != 0) {
mutex_unlock(&dev_priv_mutex);
@@ -2926,7 +2926,7 @@ static int dev_user_release(struct inode *inode, struct file *file)
TRACE_ENTRY();
mutex_lock(&dev_priv_mutex);
dev = (struct scst_user_dev*)file->private_data;
dev = (struct scst_user_dev *)file->private_data;
if (dev == NULL) {
mutex_unlock(&dev_priv_mutex);
goto out;
+5 -5
View File
@@ -813,7 +813,7 @@ static int vdisk_do_job(struct scst_cmd *cmd)
if (likely(!virt_dev->rd_only_flag)) {
int do_fsync = vdisk_sync_queue_type(cmd->queue_type);
struct scst_vdisk_tgt_dev *ftgt_dev =
(struct scst_vdisk_tgt_dev*)
(struct scst_vdisk_tgt_dev *)
cmd->tgt_dev->dh_priv;
enum scst_cmd_queue_type last_queue_type =
ftgt_dev->last_write_cmd_queue_type;
@@ -848,7 +848,7 @@ static int vdisk_do_job(struct scst_cmd *cmd)
if (likely(!virt_dev->rd_only_flag)) {
int do_fsync = vdisk_sync_queue_type(cmd->queue_type);
struct scst_vdisk_tgt_dev *ftgt_dev =
(struct scst_vdisk_tgt_dev*)
(struct scst_vdisk_tgt_dev *)
cmd->tgt_dev->dh_priv;
enum scst_cmd_queue_type last_queue_type =
ftgt_dev->last_write_cmd_queue_type;
@@ -2165,7 +2165,7 @@ restart:
eiv_count--;
} else {
eiv->iov_base =
(uint8_t*)eiv->iov_base + err;
(uint8_t *)eiv->iov_base + err;
eiv->iov_len -= err;
break;
}
@@ -2439,7 +2439,7 @@ static void vdisk_exec_verify(struct scst_cmd *cmd,
TRACE_DBG("Verify: length %zd - len_mem %zd", length, len_mem);
if (!virt_dev->nullio)
err = fd->f_op->read(fd, (char*)mem_verify, len_mem, &fd->f_pos);
err = fd->f_op->read(fd, (char *)mem_verify, len_mem, &fd->f_pos);
else
err = len_mem;
if ((err < 0) || (err < len_mem)) {
@@ -3267,7 +3267,7 @@ out:
static int vdisk_help_info_show(struct seq_file *seq, void *v)
{
char *s = (char*)seq->private;
char *s = (char *)seq->private;
TRACE_ENTRY();
+4 -4
View File
@@ -1458,7 +1458,7 @@ void scst_check_retries(struct scst_tgt *tgt)
void scst_tgt_retry_timer_fn(unsigned long arg)
{
struct scst_tgt *tgt = (struct scst_tgt*)arg;
struct scst_tgt *tgt = (struct scst_tgt *)arg;
unsigned long flags;
TRACE_RETRY("Retry timer expired (retry_cmds %d)", tgt->retry_cmds);
@@ -1854,16 +1854,16 @@ lun_t scst_unpack_lun(const uint8_t *lun, int len)
if (len > 2) {
switch (len) {
case 8:
if ((*((uint64_t*)lun) &
if ((*((uint64_t *)lun) &
__constant_cpu_to_be64(0x0000FFFFFFFFFFFFLL)) != 0)
goto out_err;
break;
case 4:
if (*((uint16_t*)&lun[2]) != 0)
if (*((uint16_t *)&lun[2]) != 0)
goto out_err;
break;
case 6:
if (*((uint32_t*)&lun[2]) != 0)
if (*((uint32_t *)&lun[2]) != 0)
goto out_err;
break;
default:
+1 -1
View File
@@ -1630,7 +1630,7 @@ static int __init init_scst(void)
for (i = 0; i < (int)ARRAY_SIZE(scst_tasklets); i++) {
spin_lock_init(&scst_tasklets[i].tasklet_lock);
INIT_LIST_HEAD(&scst_tasklets[i].tasklet_cmd_list);
tasklet_init(&scst_tasklets[i].tasklet, (void*)scst_cmd_tasklet,
tasklet_init(&scst_tasklets[i].tasklet, (void *)scst_cmd_tasklet,
(unsigned long)&scst_tasklets[i]);
}
+6 -6
View File
@@ -264,7 +264,7 @@ static int sgv_alloc_arrays(struct sgv_pool_obj *obj,
sz = pages_to_alloc * sizeof(obj->sg_entries[0]);
obj->sg_entries = (struct scatterlist*)kmalloc(sz, gfp_mask);
obj->sg_entries = (struct scatterlist *)kmalloc(sz, gfp_mask);
if (unlikely(obj->sg_entries == NULL)) {
TRACE(TRACE_OUT_OF_MEM, "Allocation of sgv_pool_obj "
"SG vector failed (size %d)", sz);
@@ -276,14 +276,14 @@ static int sgv_alloc_arrays(struct sgv_pool_obj *obj,
if (obj->owner_pool->clustered) {
if (order <= sgv_pools_mgr.sgv_max_trans_order) {
obj->trans_tbl = (struct trans_tbl_ent*)obj->sg_entries_data;
obj->trans_tbl = (struct trans_tbl_ent *)obj->sg_entries_data;
/*
* No need to clear trans_tbl, if needed, it will be
* fully rewritten in scst_alloc_sg_entries()
*/
} else {
tsz = pages_to_alloc * sizeof(obj->trans_tbl[0]);
obj->trans_tbl = (struct trans_tbl_ent*)kzalloc(tsz, gfp_mask);
obj->trans_tbl = (struct trans_tbl_ent *)kzalloc(tsz, gfp_mask);
if (unlikely(obj->trans_tbl == NULL)) {
TRACE(TRACE_OUT_OF_MEM, "Allocation of trans_tbl "
"failed (size %d)", tsz);
@@ -314,7 +314,7 @@ static void sgv_dtor_and_free(struct sgv_pool_obj *obj)
obj->sg_count, obj->allocator_priv);
}
if (obj->sg_entries != obj->sg_entries_data) {
if (obj->trans_tbl != (struct trans_tbl_ent*)obj->sg_entries_data) {
if (obj->trans_tbl != (struct trans_tbl_ent *)obj->sg_entries_data) {
/* kfree() handles NULL parameter */
kfree(obj->trans_tbl);
obj->trans_tbl = NULL;
@@ -566,7 +566,7 @@ struct scatterlist *sgv_pool_alloc(struct sgv_pool *pool, unsigned int size,
sg_init_table(obj->sg_entries, pages_to_alloc);
TRACE_MEM("sg_entries %p", obj->sg_entries);
if (pool->clustered) {
obj->trans_tbl = (struct trans_tbl_ent*)
obj->trans_tbl = (struct trans_tbl_ent *)
(obj->sg_entries + pages_to_alloc);
TRACE_MEM("trans_tbl %p", obj->trans_tbl);
/*
@@ -696,7 +696,7 @@ out_return2:
out_fail_free_sg_entries:
if (obj->sg_entries != obj->sg_entries_data) {
if (obj->trans_tbl != (struct trans_tbl_ent*)obj->sg_entries_data) {
if (obj->trans_tbl != (struct trans_tbl_ent *)obj->sg_entries_data) {
/* kfree() handles NULL parameter */
kfree(obj->trans_tbl);
obj->trans_tbl = NULL;
+1 -1
View File
@@ -977,7 +977,7 @@ int scst_build_proc_target_entries(struct scst_tgt *vtt)
if (vtt->tgtt->read_proc || vtt->tgtt->write_proc) {
/* create the proc file entry for the device */
scnprintf(name, sizeof(name), "%d", vtt->tgtt->proc_dev_num);
scst_scsi_tgt_proc_data.data = (void*)vtt;
scst_scsi_tgt_proc_data.data = (void *)vtt;
p = scst_create_proc_entry(vtt->tgtt->proc_tgt_root,
name,
&scst_scsi_tgt_proc_data);
+5 -5
View File
@@ -1214,7 +1214,7 @@ static void scst_cmd_done_local(struct scst_cmd *cmd, int next_state)
int i;
struct scatterlist *sg = cmd->sg;
TRACE_RECV_TOP("Exec'd %d S/G(s) at %p sg[0].page at "
"%p", cmd->sg_cnt, sg, (void*)sg_page(&sg[0]));
"%p", cmd->sg_cnt, sg, (void *)sg_page(&sg[0]));
for (i = 0; i < cmd->sg_cnt; ++i) {
TRACE_BUFF_FLAG(TRACE_RCV_TOP,
"Exec'd sg", sg_virt(&sg[i]),
@@ -2571,7 +2571,7 @@ static int scst_xmit_response(struct scst_cmd *cmd)
int i;
struct scatterlist *sg = cmd->sg;
TRACE_SEND_BOT("Xmitting %d S/G(s) at %p sg[0].page at %p",
cmd->sg_cnt, sg, (void*)sg_page(&sg[0]));
cmd->sg_cnt, sg, (void *)sg_page(&sg[0]));
for (i = 0; i < cmd->sg_cnt; ++i) {
TRACE_BUFF_FLAG(TRACE_SND_BOT,
"Xmitting sg", sg_virt(&sg[i]),
@@ -3239,7 +3239,7 @@ static inline int test_cmd_lists(struct scst_cmd_lists *p_cmd_lists)
int scst_cmd_thread(void *arg)
{
struct scst_cmd_lists *p_cmd_lists = (struct scst_cmd_lists*)arg;
struct scst_cmd_lists *p_cmd_lists = (struct scst_cmd_lists *)arg;
TRACE_ENTRY();
@@ -3302,7 +3302,7 @@ int scst_cmd_thread(void *arg)
void scst_cmd_tasklet(long p)
{
struct scst_tasklet *t = (struct scst_tasklet*)p;
struct scst_tasklet *t = (struct scst_tasklet *)p;
TRACE_ENTRY();
@@ -4947,7 +4947,7 @@ void scst_unregister_session_ex(struct scst_session *sess, int wait,
/* Abort all outstanding commands and clear reservation, if necessary */
lun = 0;
rc = scst_rx_mgmt_fn_lun(sess, SCST_UNREG_SESS_TM,
(uint8_t*)&lun, sizeof(lun), SCST_ATOMIC, NULL);
(uint8_t *)&lun, sizeof(lun), SCST_ATOMIC, NULL);
if (rc != 0) {
PRINT_ERROR("SCST_UNREG_SESS_TM failed %d (sess %p)",
rc, sess);
+3 -3
View File
@@ -815,7 +815,7 @@ static void srpt_handle_new_iu(struct srpt_rdma_ch *ch,
if (ret) {
srpt_build_cmd_rsp(ch, ioctx, NO_SENSE,
NO_ADD_SENSE, srp_cmd->tag);
((struct srp_rsp*)ioctx->buf)->status =
((struct srp_rsp *)ioctx->buf)->status =
SAM_STAT_TASK_SET_FULL;
goto send_rsp;
}
@@ -823,7 +823,7 @@ static void srpt_handle_new_iu(struct srpt_rdma_ch *ch,
if (indirect_desc) {
srpt_build_cmd_rsp(ch, ioctx, NO_SENSE,
NO_ADD_SENSE, srp_cmd->tag);
((struct srp_rsp*)ioctx->buf)->status =
((struct srp_rsp *)ioctx->buf)->status =
SAM_STAT_TASK_SET_FULL;
goto send_rsp;
}
@@ -843,7 +843,7 @@ static void srpt_handle_new_iu(struct srpt_rdma_ch *ch,
if (!scmnd) {
srpt_build_cmd_rsp(ch, ioctx, NO_SENSE,
NO_ADD_SENSE, srp_cmd->tag);
((struct srp_rsp*)ioctx->buf)->status =
((struct srp_rsp *)ioctx->buf)->status =
SAM_STAT_TASK_SET_FULL;
goto send_rsp;
}
+10 -10
View File
@@ -521,7 +521,7 @@ static int do_cached_mem_free(struct vdisk_cmd *vcmd)
TRACE_MEM("Cached mem free (cmd %d, buf %"PRIx64")", cmd->cmd_h,
cmd->on_cached_mem_free.pbuf);
free((void*)(unsigned long)cmd->on_cached_mem_free.pbuf);
free((void *)(unsigned long)cmd->on_cached_mem_free.pbuf);
memset(reply, 0, sizeof(*reply));
reply->cmd_h = cmd->cmd_h;
@@ -550,7 +550,7 @@ static int do_on_free_cmd(struct vdisk_cmd *vcmd)
if (!cmd->on_free_cmd.buffer_cached && (cmd->on_free_cmd.pbuf != 0)) {
TRACE_MEM("Freeing buf %"PRIx64, cmd->on_free_cmd.pbuf);
free((void*)(unsigned long)cmd->on_free_cmd.pbuf);
free((void *)(unsigned long)cmd->on_free_cmd.pbuf);
}
memset(reply, 0, sizeof(*reply));
@@ -667,7 +667,7 @@ static int open_dev_fd(struct vdisk_dev *dev)
void *main_loop(void *arg)
{
int res = 0;
struct vdisk_dev *dev = (struct vdisk_dev*)arg;
struct vdisk_dev *dev = (struct vdisk_dev *)arg;
struct scst_user_get_cmd cmd;
struct scst_user_reply_cmd reply;
struct vdisk_cmd vcmd = { -1, &cmd, dev, &reply, {0}};
@@ -757,7 +757,7 @@ again_poll:
case SCST_USER_EXEC:
if (cmd.exec_cmd.data_direction == SCST_DATA_WRITE) {
TRACE_BUFFER("Received cmd data",
(void*)(unsigned long)cmd.exec_cmd.pbuf,
(void *)(unsigned long)cmd.exec_cmd.pbuf,
cmd.exec_cmd.bufflen);
}
res = do_exec(&vcmd);
@@ -769,7 +769,7 @@ again_poll:
#endif
if (reply.exec_reply.resp_data_len != 0) {
TRACE_BUFFER("Reply data",
(void*)(unsigned long)reply.exec_reply.pbuf,
(void *)(unsigned long)reply.exec_reply.pbuf,
reply.exec_reply.resp_data_len);
}
break;
@@ -829,13 +829,13 @@ out:
PRINT_INFO("Thread %d exiting (res=%d)", gettid(), res);
TRACE_EXIT_RES(res);
return (void*)(long)res;
return (void *)(long)res;
}
void *prio_loop(void *arg)
{
int res = 0;
struct vdisk_dev *dev = (struct vdisk_dev*)arg;
struct vdisk_dev *dev = (struct vdisk_dev *)arg;
struct scst_user_get_cmd cmd;
struct scst_user_reply_cmd reply;
struct vdisk_cmd vcmd = { -1, &cmd, dev, &reply, {0}};
@@ -901,7 +901,7 @@ out_close:
PRINT_INFO("Prio thread %d exited (res=%d)", gettid(), res);
TRACE_EXIT_RES(res);
return (void*)(long)res;
return (void *)(long)res;
}
static void exec_inquiry(struct vdisk_cmd *vcmd)
@@ -958,7 +958,7 @@ static void exec_inquiry(struct vdisk_cmd *vcmd)
else
usn_len = len;
buf[3] = usn_len;
strncpy((char*)&buf[4], dev->usn, usn_len);
strncpy((char *)&buf[4], dev->usn, usn_len);
}
resp_len = buf[3] + 4;
} else if (0x83 == cmd->cdb[2]) { /* device identification */
@@ -1731,7 +1731,7 @@ static void exec_verify(struct vdisk_cmd *vcmd, loff_t loff)
TRACE_DBG("Verify: length %d - len_mem %d", length, len_mem);
if (!dev->nullio)
err = read(fd, (char*)mem_verify, len_mem);
err = read(fd, (char *)mem_verify, len_mem);
else
err = len_mem;
if ((err < 0) || (err < len_mem)) {