firewire: sbp2: define some magic numbers as macros

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

+12 -11
+12 -11
drivers/firewire/fw-sbp2.c
··· 311 311 dma_addr_t page_table_bus; 312 312 }; 313 313 314 + #define SBP2_ROM_VALUE_WILDCARD ~0 /* match all */ 315 + #define SBP2_ROM_VALUE_MISSING 0xff000000 /* not present in the unit dir. */ 316 + 314 317 /* 315 318 * List of devices with known bugs. 316 319 * 317 320 * The firmware_revision field, masked with 0xffff00, is the best 318 321 * indicator for the type of bridge chip of a device. It yields a few 319 322 * false positives but this did not break correctly behaving devices 320 - * so far. We use ~0 as a wildcard, since the 24 bit values we get 321 - * from the config rom can never match that. 323 + * so far. 322 324 */ 323 325 static const struct { 324 326 u32 firmware_revision; ··· 342 340 }, 343 341 /* Initio bridges, actually only needed for some older ones */ { 344 342 .firmware_revision = 0x000200, 345 - .model = ~0, 343 + .model = SBP2_ROM_VALUE_WILDCARD, 346 344 .workarounds = SBP2_WORKAROUND_INQUIRY_36, 347 345 }, 348 346 /* PL-3507 bridge with Prolific firmware */ { 349 347 .firmware_revision = 0x012800, 350 - .model = ~0, 348 + .model = SBP2_ROM_VALUE_WILDCARD, 351 349 .workarounds = SBP2_WORKAROUND_POWER_CONDITION, 352 350 }, 353 351 /* Symbios bridge */ { 354 352 .firmware_revision = 0xa0b800, 355 - .model = ~0, 353 + .model = SBP2_ROM_VALUE_WILDCARD, 356 354 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS, 357 355 }, 358 356 /* Datafab MD2-FW2 with Symbios/LSILogic SYM13FW500 bridge */ { 359 357 .firmware_revision = 0x002600, 360 - .model = ~0, 358 + .model = SBP2_ROM_VALUE_WILDCARD, 361 359 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS, 362 360 }, 363 361 ··· 1095 1093 continue; 1096 1094 1097 1095 if (sbp2_workarounds_table[i].model != model && 1098 - sbp2_workarounds_table[i].model != ~0) 1096 + sbp2_workarounds_table[i].model != SBP2_ROM_VALUE_WILDCARD) 1099 1097 continue; 1100 1098 1101 1099 w |= sbp2_workarounds_table[i].workarounds; ··· 1145 1143 fw_device_get(device); 1146 1144 fw_unit_get(unit); 1147 1145 1148 - /* Initialize to values that won't match anything in our table. */ 1149 - firmware_revision = 0xff000000; 1150 - model = 0xff000000; 1151 - 1152 1146 /* implicit directory ID */ 1153 1147 tgt->directory_id = ((unit->directory - device->config_rom) * 4 1154 1148 + CSR_CONFIG_ROM) & 0xffffff; 1149 + 1150 + firmware_revision = SBP2_ROM_VALUE_MISSING; 1151 + model = SBP2_ROM_VALUE_MISSING; 1155 1152 1156 1153 if (sbp2_scan_unit_dir(tgt, unit->directory, &model, 1157 1154 &firmware_revision) < 0)