diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2010-06-12 20:29:07 +0200 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2010-06-19 13:01:40 +0200 |
commit | e847cc832bab50aad939a0c30414cd986637564d (patch) | |
tree | 35b5d7af3e3f3337b8f7c9c43029618bec3a1f69 /drivers/firewire/core-card.c | |
parent | 65b2742ac002f554f6ca0c2eab84cc62400eafdf (diff) | |
download | linux-e847cc832bab50aad939a0c30414cd986637564d.tar.gz linux-e847cc832bab50aad939a0c30414cd986637564d.tar.bz2 linux-e847cc832bab50aad939a0c30414cd986637564d.zip |
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: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/core-card.c')
-rw-r--r-- | drivers/firewire/core-card.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c index ef6f2616cac7..156b098b0ada 100644 --- a/drivers/firewire/core-card.c +++ b/drivers/firewire/core-card.c @@ -296,8 +296,7 @@ static void fw_card_bm_work(struct work_struct *work) rcode = fw_run_transaction(card, TCODE_LOCK_COMPARE_SWAP, irm_id, generation, SCODE_100, CSR_REGISTER_BASE + CSR_BUS_MANAGER_ID, - card->bm_transaction_data, - sizeof(card->bm_transaction_data)); + card->bm_transaction_data, 8); if (rcode == RCODE_GENERATION) /* Another bus reset, BM work has been rescheduled. */ @@ -422,7 +421,7 @@ static void fw_card_bm_work(struct work_struct *work) rcode = fw_run_transaction(card, TCODE_WRITE_QUADLET_REQUEST, root_id, generation, SCODE_100, CSR_REGISTER_BASE + CSR_STATE_SET, - card->bm_transaction_data, sizeof(u32)); + card->bm_transaction_data, 4); if (rcode == RCODE_GENERATION) goto out; } |