aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2011-01-31 05:58:58 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2011-02-26 09:11:03 -0500
commit5aaffc65a27dd9db65455c2c9ab3ede57238d2f5 (patch)
tree70f621a701752d255907956e76b8983892142ccd /drivers
parent8fd2af11d2fe1d50621e958747744f1c93e5b758 (diff)
firewire: core: rename some variables
In manage_channel(), rename the variables "c" and "i" to the more expressive "bit" and "channel". Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firewire/core-iso.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c
index c003fa4e2db..95bc01a02a8 100644
--- a/drivers/firewire/core-iso.c
+++ b/drivers/firewire/core-iso.c
@@ -235,45 +235,45 @@ static int manage_bandwidth(struct fw_card *card, int irm_id, int generation,
235static int manage_channel(struct fw_card *card, int irm_id, int generation, 235static int manage_channel(struct fw_card *card, int irm_id, int generation,
236 u32 channels_mask, u64 offset, bool allocate, __be32 data[2]) 236 u32 channels_mask, u64 offset, bool allocate, __be32 data[2])
237{ 237{
238 __be32 c, all, old; 238 __be32 bit, all, old;
239 int i, ret = -EIO, retry = 5; 239 int channel, ret = -EIO, retry = 5;
240 240
241 old = all = allocate ? cpu_to_be32(~0) : 0; 241 old = all = allocate ? cpu_to_be32(~0) : 0;
242 242
243 for (i = 0; i < 32; i++) { 243 for (channel = 0; channel < 32; channel++) {
244 if (!(channels_mask & 1 << i)) 244 if (!(channels_mask & 1 << channel))
245 continue; 245 continue;
246 246
247 ret = -EBUSY; 247 ret = -EBUSY;
248 248
249 c = cpu_to_be32(1 << (31 - i)); 249 bit = cpu_to_be32(1 << (31 - channel));
250 if ((old & c) != (all & c)) 250 if ((old & bit) != (all & bit))
251 continue; 251 continue;
252 252
253 data[0] = old; 253 data[0] = old;
254 data[1] = old ^ c; 254 data[1] = old ^ bit;
255 switch (fw_run_transaction(card, TCODE_LOCK_COMPARE_SWAP, 255 switch (fw_run_transaction(card, TCODE_LOCK_COMPARE_SWAP,
256 irm_id, generation, SCODE_100, 256 irm_id, generation, SCODE_100,
257 offset, data, 8)) { 257 offset, data, 8)) {
258 case RCODE_GENERATION: 258 case RCODE_GENERATION:
259 /* A generation change frees all channels. */ 259 /* A generation change frees all channels. */
260 return allocate ? -EAGAIN : i; 260 return allocate ? -EAGAIN : channel;
261 261
262 case RCODE_COMPLETE: 262 case RCODE_COMPLETE:
263 if (data[0] == old) 263 if (data[0] == old)
264 return i; 264 return channel;
265 265
266 old = data[0]; 266 old = data[0];
267 267
268 /* Is the IRM 1394a-2000 compliant? */ 268 /* Is the IRM 1394a-2000 compliant? */
269 if ((data[0] & c) == (data[1] & c)) 269 if ((data[0] & bit) == (data[1] & bit))
270 continue; 270 continue;
271 271
272 /* 1394-1995 IRM, fall through to retry. */ 272 /* 1394-1995 IRM, fall through to retry. */
273 default: 273 default:
274 if (retry) { 274 if (retry) {
275 retry--; 275 retry--;
276 i--; 276 channel--;
277 } else { 277 } else {
278 ret = -EIO; 278 ret = -EIO;
279 } 279 }