Commit e847cc83 authored by Stefan Richter's avatar Stefan Richter

firewire: drop sizeof expressions from some request size arguments

In case of fw_card_bm_work()'s lock request, the present sizeof
expression is going to be wrong if somebody changes the fw_card's DMA
scratch buffer's size in the future.

In case of quadlet write requests, sizeof(u32) is just silly; it's 4.

In case of SBP-2 ORB pointer write requests, 8 is arguably quicker to
understand as the correct and only possible value than
sizeof(some_datum).
Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
parent 65b2742a
...@@ -296,8 +296,7 @@ static void fw_card_bm_work(struct work_struct *work) ...@@ -296,8 +296,7 @@ static void fw_card_bm_work(struct work_struct *work)
rcode = fw_run_transaction(card, TCODE_LOCK_COMPARE_SWAP, rcode = fw_run_transaction(card, TCODE_LOCK_COMPARE_SWAP,
irm_id, generation, SCODE_100, irm_id, generation, SCODE_100,
CSR_REGISTER_BASE + CSR_BUS_MANAGER_ID, CSR_REGISTER_BASE + CSR_BUS_MANAGER_ID,
card->bm_transaction_data, card->bm_transaction_data, 8);
sizeof(card->bm_transaction_data));
if (rcode == RCODE_GENERATION) if (rcode == RCODE_GENERATION)
/* Another bus reset, BM work has been rescheduled. */ /* Another bus reset, BM work has been rescheduled. */
...@@ -422,7 +421,7 @@ static void fw_card_bm_work(struct work_struct *work) ...@@ -422,7 +421,7 @@ static void fw_card_bm_work(struct work_struct *work)
rcode = fw_run_transaction(card, TCODE_WRITE_QUADLET_REQUEST, rcode = fw_run_transaction(card, TCODE_WRITE_QUADLET_REQUEST,
root_id, generation, SCODE_100, root_id, generation, SCODE_100,
CSR_REGISTER_BASE + CSR_STATE_SET, CSR_REGISTER_BASE + CSR_STATE_SET,
card->bm_transaction_data, sizeof(u32)); card->bm_transaction_data, 4);
if (rcode == RCODE_GENERATION) if (rcode == RCODE_GENERATION)
goto out; goto out;
} }
......
...@@ -508,8 +508,7 @@ static void sbp2_send_orb(struct sbp2_orb *orb, struct sbp2_logical_unit *lu, ...@@ -508,8 +508,7 @@ static void sbp2_send_orb(struct sbp2_orb *orb, struct sbp2_logical_unit *lu,
fw_send_request(device->card, &orb->t, TCODE_WRITE_BLOCK_REQUEST, fw_send_request(device->card, &orb->t, TCODE_WRITE_BLOCK_REQUEST,
node_id, generation, device->max_speed, offset, node_id, generation, device->max_speed, offset,
&orb->pointer, sizeof(orb->pointer), &orb->pointer, 8, complete_transaction, orb);
complete_transaction, orb);
} }
static int sbp2_cancel_orbs(struct sbp2_logical_unit *lu) static int sbp2_cancel_orbs(struct sbp2_logical_unit *lu)
...@@ -654,7 +653,7 @@ static void sbp2_agent_reset(struct sbp2_logical_unit *lu) ...@@ -654,7 +653,7 @@ static void sbp2_agent_reset(struct sbp2_logical_unit *lu)
fw_run_transaction(device->card, TCODE_WRITE_QUADLET_REQUEST, fw_run_transaction(device->card, TCODE_WRITE_QUADLET_REQUEST,
lu->tgt->node_id, lu->generation, device->max_speed, lu->tgt->node_id, lu->generation, device->max_speed,
lu->command_block_agent_address + SBP2_AGENT_RESET, lu->command_block_agent_address + SBP2_AGENT_RESET,
&d, sizeof(d)); &d, 4);
} }
static void complete_agent_reset_write_no_wait(struct fw_card *card, static void complete_agent_reset_write_no_wait(struct fw_card *card,
...@@ -676,7 +675,7 @@ static void sbp2_agent_reset_no_wait(struct sbp2_logical_unit *lu) ...@@ -676,7 +675,7 @@ static void sbp2_agent_reset_no_wait(struct sbp2_logical_unit *lu)
fw_send_request(device->card, t, TCODE_WRITE_QUADLET_REQUEST, fw_send_request(device->card, t, TCODE_WRITE_QUADLET_REQUEST,
lu->tgt->node_id, lu->generation, device->max_speed, lu->tgt->node_id, lu->generation, device->max_speed,
lu->command_block_agent_address + SBP2_AGENT_RESET, lu->command_block_agent_address + SBP2_AGENT_RESET,
&d, sizeof(d), complete_agent_reset_write_no_wait, t); &d, 4, complete_agent_reset_write_no_wait, t);
} }
static inline void sbp2_allow_block(struct sbp2_logical_unit *lu) static inline void sbp2_allow_block(struct sbp2_logical_unit *lu)
...@@ -866,8 +865,7 @@ static void sbp2_set_busy_timeout(struct sbp2_logical_unit *lu) ...@@ -866,8 +865,7 @@ static void sbp2_set_busy_timeout(struct sbp2_logical_unit *lu)
fw_run_transaction(device->card, TCODE_WRITE_QUADLET_REQUEST, fw_run_transaction(device->card, TCODE_WRITE_QUADLET_REQUEST,
lu->tgt->node_id, lu->generation, device->max_speed, lu->tgt->node_id, lu->generation, device->max_speed,
CSR_REGISTER_BASE + CSR_BUSY_TIMEOUT, CSR_REGISTER_BASE + CSR_BUSY_TIMEOUT, &d, 4);
&d, sizeof(d));
} }
static void sbp2_reconnect(struct work_struct *work); static void sbp2_reconnect(struct work_struct *work);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment