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
|
* Should we set the mode explicitly during chip
|
||||||
* Initialization?
|
* Initialization?
|
||||||
*/
|
*/
|
||||||
switch(reg % 4)
|
shift = 8 * (reg & 3);
|
||||||
{
|
|
||||||
case 3:
|
|
||||||
shift = 24;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
shift = 16;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
shift = 8;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
shift = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(bytes)
|
switch(bytes)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user