提交 bd937d53 编写于 作者: C chenxiang 提交者: Xie XiuQi

scsi: hisi_sas: do some changes for coding standard

There are two changes including:
- move input parameter before output parameter;
- change signed int to unsigned int;

Feature or Bugfix:Bugfix
Signed-off-by: Nchenxiang (M) <chenxiang66@hisilicon.com>
Reviewed-by: Nhuangdaode <huangdaode@hisilicon.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 efea11f2
......@@ -183,7 +183,7 @@ struct hisi_sas_device {
struct hisi_sas_dq *dq;
struct list_head list;
enum sas_device_type dev_type;
int device_id;
unsigned int device_id;
int sata_idx;
spinlock_t lock;
};
......@@ -255,8 +255,9 @@ struct hisi_sas_hw {
void (*prep_stp)(struct hisi_hba *hisi_hba,
struct hisi_sas_slot *slot);
void (*prep_abort)(struct hisi_hba *hisi_hba,
struct hisi_sas_slot *slot,
int device_id, int abort_flag, int tag_to_abort);
struct hisi_sas_slot *slot,
unsigned int device_id,
int abort_flag, int tag_to_abort);
int (*slot_complete)(struct hisi_hba *hisi_hba,
struct hisi_sas_slot *slot);
void (*phys_init)(struct hisi_hba *hisi_hba);
......
......@@ -301,7 +301,7 @@ static void hisi_sas_task_prep_ata(struct hisi_hba *hisi_hba,
static void hisi_sas_task_prep_abort(struct hisi_hba *hisi_hba,
struct hisi_sas_slot *slot,
int device_id, int abort_flag, int tag_to_abort)
unsigned int device_id, int abort_flag, int tag_to_abort)
{
hisi_hba->hw->prep_abort(hisi_hba, slot,
device_id, abort_flag, tag_to_abort);
......@@ -446,9 +446,8 @@ static int hisi_sas_dif_dma_map(struct hisi_hba *hisi_hba,
}
static int hisi_sas_task_prep(struct sas_task *task,
struct hisi_sas_dq **dq_pointer,
bool is_tmf, struct hisi_sas_tmf_task *tmf,
int *pass)
int *pass, struct hisi_sas_dq **dq_pointer)
{
struct domain_device *device = task->dev;
struct hisi_hba *hisi_hba = dev_to_hisi_hba(device);
......@@ -634,7 +633,7 @@ static int hisi_sas_task_exec(struct sas_task *task, gfp_t gfp_flags,
}
/* protect task_prep and start_delivery sequence */
rc = hisi_sas_task_prep(task, &dq, is_tmf, tmf, &pass);
rc = hisi_sas_task_prep(task, is_tmf, tmf, &pass, &dq);
if (rc)
dev_err(dev, "task exec: failed[%d]!\n", rc);
......@@ -1889,7 +1888,8 @@ static int hisi_sas_query_task(struct sas_task *task)
}
static int
hisi_sas_internal_abort_task_exec(struct hisi_hba *hisi_hba, int device_id,
hisi_sas_internal_abort_task_exec(struct hisi_hba *hisi_hba,
unsigned int device_id,
struct sas_task *task, int abort_flag,
int task_tag, struct hisi_sas_dq *dq)
{
......
......@@ -928,9 +928,9 @@ static void start_delivery_v1_hw(struct hisi_sas_dq *dq)
static void prep_prd_sge_v1_hw(struct hisi_hba *hisi_hba,
struct hisi_sas_slot *slot,
struct hisi_sas_cmd_hdr *hdr,
struct scatterlist *scatter,
int n_elem)
u64 n_elem,
struct hisi_sas_cmd_hdr *hdr)
{
struct hisi_sas_sge_page *sge_page = hisi_sas_sge_addr_mem(slot);
struct scatterlist *sg;
......@@ -999,9 +999,9 @@ static void prep_ssp_v1_hw(struct hisi_hba *hisi_hba,
struct sas_ssp_task *ssp_task = &task->ssp_task;
struct scsi_cmnd *scsi_cmnd = ssp_task->cmd;
struct hisi_sas_tmf_task *tmf = slot->tmf;
int has_data = 0, priority = !!tmf;
int has_data = 0;
u8 *buf_cmd, fburst = 0;
u32 dw1, dw2;
u32 dw1, dw2, priority = !!tmf;
/* create header */
hdr->dw0 = cpu_to_le32((1 << CMD_HDR_RESP_REPORT_OFF) |
......@@ -1049,8 +1049,8 @@ static void prep_ssp_v1_hw(struct hisi_hba *hisi_hba,
hdr->transfer_tags = cpu_to_le32(slot->idx << CMD_HDR_IPTT_OFF);
if (has_data)
prep_prd_sge_v1_hw(hisi_hba, slot, hdr, task->scatter,
slot->n_elem);
prep_prd_sge_v1_hw(hisi_hba, slot, task->scatter,
slot->n_elem, hdr);
hdr->data_transfer_len = cpu_to_le32(task->total_xfer_len);
hdr->cmd_table_addr = cpu_to_le64(hisi_sas_cmd_hdr_addr_dma(slot));
......
......@@ -1692,9 +1692,9 @@ static void start_delivery_v2_hw(struct hisi_sas_dq *dq)
static void prep_prd_sge_v2_hw(struct hisi_hba *hisi_hba,
struct hisi_sas_slot *slot,
struct hisi_sas_cmd_hdr *hdr,
struct scatterlist *scatter,
int n_elem)
u64 n_elem,
struct hisi_sas_cmd_hdr *hdr)
{
struct hisi_sas_sge_page *sge_page = hisi_sas_sge_addr_mem(slot);
struct scatterlist *sg;
......@@ -1764,9 +1764,9 @@ static void prep_ssp_v2_hw(struct hisi_hba *hisi_hba,
struct sas_ssp_task *ssp_task = &task->ssp_task;
struct scsi_cmnd *scsi_cmnd = ssp_task->cmd;
struct hisi_sas_tmf_task *tmf = slot->tmf;
int has_data = 0, priority = !!tmf;
int has_data = 0;
u8 *buf_cmd;
u32 dw1 = 0, dw2 = 0;
u32 dw1 = 0, dw2 = 0, priority = !!tmf;
hdr->dw0 = cpu_to_le32((1 << CMD_HDR_RESP_REPORT_OFF) |
(2 << CMD_HDR_TLR_CTRL_OFF) |
......@@ -1807,8 +1807,8 @@ static void prep_ssp_v2_hw(struct hisi_hba *hisi_hba,
hdr->transfer_tags = cpu_to_le32(slot->idx);
if (has_data)
prep_prd_sge_v2_hw(hisi_hba, slot, hdr, task->scatter,
slot->n_elem);
prep_prd_sge_v2_hw(hisi_hba, slot, task->scatter,
slot->n_elem, hdr);
hdr->data_transfer_len = cpu_to_le32(task->total_xfer_len);
hdr->cmd_table_addr = cpu_to_le64(hisi_sas_cmd_hdr_addr_dma(slot));
......@@ -2523,8 +2523,8 @@ static void prep_ata_v2_hw(struct hisi_hba *hisi_hba,
struct hisi_sas_port *port = to_hisi_sas_port(sas_port);
struct hisi_sas_tmf_task *tmf = slot->tmf;
u8 *buf_cmd;
int has_data = 0, hdr_tag = 0;
u32 dw1 = 0, dw2 = 0;
int has_data = 0;
u32 dw1 = 0, dw2 = 0, hdr_tag = 0;
/* create header */
/* dw0 */
......@@ -2578,8 +2578,8 @@ static void prep_ata_v2_hw(struct hisi_hba *hisi_hba,
hdr->transfer_tags = cpu_to_le32(slot->idx);
if (has_data)
prep_prd_sge_v2_hw(hisi_hba, slot, hdr, task->scatter,
slot->n_elem);
prep_prd_sge_v2_hw(hisi_hba, slot, task->scatter,
slot->n_elem, hdr);
hdr->data_transfer_len = cpu_to_le32(task->total_xfer_len);
hdr->cmd_table_addr = cpu_to_le64(hisi_sas_cmd_hdr_addr_dma(slot));
......@@ -2629,7 +2629,7 @@ static void hisi_sas_internal_abort_quirk_timeout(struct timer_list *t)
static void prep_abort_v2_hw(struct hisi_hba *hisi_hba,
struct hisi_sas_slot *slot,
int device_id, int abort_flag, int tag_to_abort)
unsigned int device_id, int abort_flag, int tag_to_abort)
{
struct sas_task *task = slot->task;
struct domain_device *dev = task->dev;
......
......@@ -1006,9 +1006,9 @@ static void start_delivery_v3_hw(struct hisi_sas_dq *dq)
static void prep_prd_sge_v3_hw(struct hisi_hba *hisi_hba,
struct hisi_sas_slot *slot,
struct hisi_sas_cmd_hdr *hdr,
struct scatterlist *scatter,
int n_elem)
u64 n_elem,
struct hisi_sas_cmd_hdr *hdr)
{
struct hisi_sas_sge_page *sge_page = hisi_sas_sge_addr_mem(slot);
struct scatterlist *sg;
......@@ -1149,9 +1149,9 @@ static void prep_ssp_v3_hw(struct hisi_hba *hisi_hba,
struct sas_ssp_task *ssp_task = &task->ssp_task;
struct scsi_cmnd *scsi_cmnd = ssp_task->cmd;
struct hisi_sas_tmf_task *tmf = slot->tmf;
int has_data = 0, priority = !!tmf;
int has_data = 0;
u8 *buf_cmd;
u32 dw1 = 0, dw2 = 0, len = 0;
u32 dw1 = 0, dw2 = 0, len = 0, priority = !!tmf;
hdr->dw0 = cpu_to_le32((1 << CMD_HDR_RESP_REPORT_OFF) |
(2 << CMD_HDR_TLR_CTRL_OFF) |
......@@ -1191,8 +1191,8 @@ static void prep_ssp_v3_hw(struct hisi_hba *hisi_hba,
hdr->transfer_tags = cpu_to_le32(slot->idx);
if (has_data) {
prep_prd_sge_v3_hw(hisi_hba, slot, hdr, task->scatter,
slot->n_elem);
prep_prd_sge_v3_hw(hisi_hba, slot, task->scatter,
slot->n_elem, hdr);
if (scsi_prot_sg_count(scsi_cmnd)) {
prep_prd_sge_dif_v3_hw(hisi_hba, slot, hdr,
scsi_prot_sglist(scsi_cmnd),
......@@ -1302,8 +1302,8 @@ static void prep_ata_v3_hw(struct hisi_hba *hisi_hba,
struct asd_sas_port *sas_port = device->port;
struct hisi_sas_port *port = to_hisi_sas_port(sas_port);
u8 *buf_cmd;
int has_data = 0, hdr_tag = 0;
u32 dw1 = 0, dw2 = 0;
int has_data = 0;
u32 dw1 = 0, dw2 = 0, hdr_tag = 0;
hdr->dw0 = cpu_to_le32(port->id << CMD_HDR_PORT_OFF);
if (parent_dev && DEV_IS_EXPANDER(parent_dev->dev_type))
......@@ -1352,8 +1352,8 @@ static void prep_ata_v3_hw(struct hisi_hba *hisi_hba,
hdr->transfer_tags = cpu_to_le32(slot->idx);
if (has_data)
prep_prd_sge_v3_hw(hisi_hba, slot, hdr, task->scatter,
slot->n_elem);
prep_prd_sge_v3_hw(hisi_hba, slot, task->scatter,
slot->n_elem, hdr);
hdr->data_transfer_len = cpu_to_le32(task->total_xfer_len);
hdr->cmd_table_addr = cpu_to_le64(hisi_sas_cmd_hdr_addr_dma(slot));
......@@ -1369,7 +1369,7 @@ static void prep_ata_v3_hw(struct hisi_hba *hisi_hba,
static void prep_abort_v3_hw(struct hisi_hba *hisi_hba,
struct hisi_sas_slot *slot,
int device_id, int abort_flag, int tag_to_abort)
unsigned int device_id, int abort_flag, int tag_to_abort)
{
struct sas_task *task = slot->task;
struct domain_device *dev = task->dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册