o Simplify code: trade 15 lines of case for one multiplication
This commit is contained in:
parent
31fade0527
commit
00582be0e9
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user