o Simplify code: trade 15 lines of case for one multiplication

This commit is contained in:
Oleksandr Tymoshenko 2009-01-14 22:32:43 +00:00
parent 31fade0527
commit 00582be0e9

View File

@ -457,21 +457,7 @@ gt_pci_write_config(device_t dev, int bus, int slot, int func, int reg,
* Should we set the mode explicitly during chip
* Initialization?
*/
switch(reg % 4)
{
case 3:
shift = 24;
break;
case 2:
shift = 16;
break;
case 1:
shift = 8;
break;
default:
shift = 0;
break;
}
shift = 8 * (reg & 3);
switch(bytes)
{