Re: [Qemu-devel] [PATCH v3 4/7] net/eepro100: Fix code style
Hi, Michael On 06/06/2017 11:31 PM, Michael S. Tsirkin wrote: On Tue, Jun 06, 2017 at 07:26:29PM +0800, Mao Zhongyi wrote: It reports a code style problem(ERROR: "foo * bar" should be "foo *bar") when running checkpatch.pl. So fix it to conform to the coding standards. Cc: jasow...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi We don't generally do this kind of drive-by coding cleanups. Wait until you actually make some changes to this file. I'm also not merging this through the pci tree, pls split this out. The e100_pci_reset() in this file will be modified in the patch5. it will reports a code style problem such as 'ERROR: "foo * bar" should be "foo *bar"' when executing the checkpatch.pl for patch5. Of course, I could simply modify the e100_pci_reset() to avoid this error, but I think it's not a good idea. Since fix, all the same error should be fixed absolutely. So I make a separate patch to fix it, meanwhile prepare for patch5. Thanks Mao --- hw/net/eepro100.c | 62 +++ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index da36816..62e989c 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -405,7 +405,7 @@ enum scb_stat_ack { stat_ack_tx = (stat_ack_cu_idle | stat_ack_cu_cmd_done), }; -static void disable_interrupt(EEPRO100State * s) +static void disable_interrupt(EEPRO100State *s) { if (s->int_stat) { TRACE(INT, logout("interrupt disabled\n")); @@ -414,7 +414,7 @@ static void disable_interrupt(EEPRO100State * s) } } -static void enable_interrupt(EEPRO100State * s) +static void enable_interrupt(EEPRO100State *s) { if (!s->int_stat) { TRACE(INT, logout("interrupt enabled\n")); @@ -423,7 +423,7 @@ static void enable_interrupt(EEPRO100State * s) } } -static void eepro100_acknowledge(EEPRO100State * s) +static void eepro100_acknowledge(EEPRO100State *s) { s->scb_stat &= ~s->mem[SCBAck]; s->mem[SCBAck] = s->scb_stat; @@ -432,7 +432,7 @@ static void eepro100_acknowledge(EEPRO100State * s) } } -static void eepro100_interrupt(EEPRO100State * s, uint8_t status) +static void eepro100_interrupt(EEPRO100State *s, uint8_t status) { uint8_t mask = ~s->mem[SCBIntmask]; s->mem[SCBAck] |= status; @@ -449,52 +449,52 @@ static void eepro100_interrupt(EEPRO100State * s, uint8_t status) } } -static void eepro100_cx_interrupt(EEPRO100State * s) +static void eepro100_cx_interrupt(EEPRO100State *s) { /* CU completed action command. */ /* Transmit not ok (82557 only, not in emulation). */ eepro100_interrupt(s, 0x80); } -static void eepro100_cna_interrupt(EEPRO100State * s) +static void eepro100_cna_interrupt(EEPRO100State *s) { /* CU left the active state. */ eepro100_interrupt(s, 0x20); } -static void eepro100_fr_interrupt(EEPRO100State * s) +static void eepro100_fr_interrupt(EEPRO100State *s) { /* RU received a complete frame. */ eepro100_interrupt(s, 0x40); } -static void eepro100_rnr_interrupt(EEPRO100State * s) +static void eepro100_rnr_interrupt(EEPRO100State *s) { /* RU is not ready. */ eepro100_interrupt(s, 0x10); } -static void eepro100_mdi_interrupt(EEPRO100State * s) +static void eepro100_mdi_interrupt(EEPRO100State *s) { /* MDI completed read or write cycle. */ eepro100_interrupt(s, 0x08); } -static void eepro100_swi_interrupt(EEPRO100State * s) +static void eepro100_swi_interrupt(EEPRO100State *s) { /* Software has requested an interrupt. */ eepro100_interrupt(s, 0x04); } #if 0 -static void eepro100_fcp_interrupt(EEPRO100State * s) +static void eepro100_fcp_interrupt(EEPRO100State *s) { /* Flow control pause interrupt (82558 and later). */ eepro100_interrupt(s, 0x01); } #endif -static void e100_pci_reset(EEPRO100State * s) +static void e100_pci_reset(EEPRO100State *s) { E100PCIDeviceInfo *info = eepro100_get_class(s); uint32_t device = s->device; @@ -598,7 +598,7 @@ static void e100_pci_reset(EEPRO100State * s) #endif /* EEPROM_SIZE > 0 */ } -static void nic_selective_reset(EEPRO100State * s) +static void nic_selective_reset(EEPRO100State *s) { size_t i; uint16_t *eeprom_contents = eeprom93xx_data(s->eeprom); @@ -669,7 +669,7 @@ static char *regname(uint32_t addr) / #if 0 -static uint16_t eepro100_read_command(EEPRO100State * s) +static uint16_t eepro100_read_command(EEPRO100State *s) { uint16_t val = 0x; TRACE(OTHER, logout("val=0x%04x\n", val)); @@ -694,27 +694,27 @@ enum commands { CmdTxFlex = 0x0008, /* Use "Flexible mode" for CmdTx command. */ }; -static cu_state_t get_cu_state(EEPRO100State * s) +static cu_state_t get_cu_state(EEPRO100State *s) { return ((s->mem[SCBStatus] & BITS(7, 6)) >> 6); } -static void set_cu_state(EEPRO100State * s, cu_
Re: [Qemu-devel] [PATCH v3 4/7] net/eepro100: Fix code style
On Tue, Jun 06, 2017 at 07:26:29PM +0800, Mao Zhongyi wrote: > It reports a code style problem(ERROR: "foo * bar" should be "foo *bar") > when running checkpatch.pl. So fix it to conform to the coding standards. > > Cc: jasow...@redhat.com > Cc: arm...@redhat.com > Signed-off-by: Mao Zhongyi We don't generally do this kind of drive-by coding cleanups. Wait until you actually make some changes to this file. I'm also not merging this through the pci tree, pls split this out. > --- > hw/net/eepro100.c | 62 > +++ > 1 file changed, 31 insertions(+), 31 deletions(-) > > diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c > index da36816..62e989c 100644 > --- a/hw/net/eepro100.c > +++ b/hw/net/eepro100.c > @@ -405,7 +405,7 @@ enum scb_stat_ack { > stat_ack_tx = (stat_ack_cu_idle | stat_ack_cu_cmd_done), > }; > > -static void disable_interrupt(EEPRO100State * s) > +static void disable_interrupt(EEPRO100State *s) > { > if (s->int_stat) { > TRACE(INT, logout("interrupt disabled\n")); > @@ -414,7 +414,7 @@ static void disable_interrupt(EEPRO100State * s) > } > } > > -static void enable_interrupt(EEPRO100State * s) > +static void enable_interrupt(EEPRO100State *s) > { > if (!s->int_stat) { > TRACE(INT, logout("interrupt enabled\n")); > @@ -423,7 +423,7 @@ static void enable_interrupt(EEPRO100State * s) > } > } > > -static void eepro100_acknowledge(EEPRO100State * s) > +static void eepro100_acknowledge(EEPRO100State *s) > { > s->scb_stat &= ~s->mem[SCBAck]; > s->mem[SCBAck] = s->scb_stat; > @@ -432,7 +432,7 @@ static void eepro100_acknowledge(EEPRO100State * s) > } > } > > -static void eepro100_interrupt(EEPRO100State * s, uint8_t status) > +static void eepro100_interrupt(EEPRO100State *s, uint8_t status) > { > uint8_t mask = ~s->mem[SCBIntmask]; > s->mem[SCBAck] |= status; > @@ -449,52 +449,52 @@ static void eepro100_interrupt(EEPRO100State * s, > uint8_t status) > } > } > > -static void eepro100_cx_interrupt(EEPRO100State * s) > +static void eepro100_cx_interrupt(EEPRO100State *s) > { > /* CU completed action command. */ > /* Transmit not ok (82557 only, not in emulation). */ > eepro100_interrupt(s, 0x80); > } > > -static void eepro100_cna_interrupt(EEPRO100State * s) > +static void eepro100_cna_interrupt(EEPRO100State *s) > { > /* CU left the active state. */ > eepro100_interrupt(s, 0x20); > } > > -static void eepro100_fr_interrupt(EEPRO100State * s) > +static void eepro100_fr_interrupt(EEPRO100State *s) > { > /* RU received a complete frame. */ > eepro100_interrupt(s, 0x40); > } > > -static void eepro100_rnr_interrupt(EEPRO100State * s) > +static void eepro100_rnr_interrupt(EEPRO100State *s) > { > /* RU is not ready. */ > eepro100_interrupt(s, 0x10); > } > > -static void eepro100_mdi_interrupt(EEPRO100State * s) > +static void eepro100_mdi_interrupt(EEPRO100State *s) > { > /* MDI completed read or write cycle. */ > eepro100_interrupt(s, 0x08); > } > > -static void eepro100_swi_interrupt(EEPRO100State * s) > +static void eepro100_swi_interrupt(EEPRO100State *s) > { > /* Software has requested an interrupt. */ > eepro100_interrupt(s, 0x04); > } > > #if 0 > -static void eepro100_fcp_interrupt(EEPRO100State * s) > +static void eepro100_fcp_interrupt(EEPRO100State *s) > { > /* Flow control pause interrupt (82558 and later). */ > eepro100_interrupt(s, 0x01); > } > #endif > > -static void e100_pci_reset(EEPRO100State * s) > +static void e100_pci_reset(EEPRO100State *s) > { > E100PCIDeviceInfo *info = eepro100_get_class(s); > uint32_t device = s->device; > @@ -598,7 +598,7 @@ static void e100_pci_reset(EEPRO100State * s) > #endif /* EEPROM_SIZE > 0 */ > } > > -static void nic_selective_reset(EEPRO100State * s) > +static void nic_selective_reset(EEPRO100State *s) > { > size_t i; > uint16_t *eeprom_contents = eeprom93xx_data(s->eeprom); > @@ -669,7 +669,7 @@ static char *regname(uint32_t addr) > > / > > #if 0 > -static uint16_t eepro100_read_command(EEPRO100State * s) > +static uint16_t eepro100_read_command(EEPRO100State *s) > { > uint16_t val = 0x; > TRACE(OTHER, logout("val=0x%04x\n", val)); > @@ -694,27 +694,27 @@ enum commands { > CmdTxFlex = 0x0008, /* Use "Flexible mode" for CmdTx command. */ > }; > > -static cu_state_t get_cu_state(EEPRO100State * s) > +static cu_state_t get_cu_state(EEPRO100State *s) > { > return ((s->mem[SCBStatus] & BITS(7, 6)) >> 6); > } > > -static void set_cu_state(EEPRO100State * s, cu_state_t state) > +static void set_cu_state(EEPRO100State *s, cu_state_t state) > { > s->mem[SCBStatus] = (s->mem[SCBStatus] & ~BITS(7, 6)) + (state << 6); > } > > -static ru_state_t get_ru_state(EEPRO100St
[Qemu-devel] [PATCH v3 4/7] net/eepro100: Fix code style
It reports a code style problem(ERROR: "foo * bar" should be "foo *bar") when running checkpatch.pl. So fix it to conform to the coding standards. Cc: jasow...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/net/eepro100.c | 62 +++ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index da36816..62e989c 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -405,7 +405,7 @@ enum scb_stat_ack { stat_ack_tx = (stat_ack_cu_idle | stat_ack_cu_cmd_done), }; -static void disable_interrupt(EEPRO100State * s) +static void disable_interrupt(EEPRO100State *s) { if (s->int_stat) { TRACE(INT, logout("interrupt disabled\n")); @@ -414,7 +414,7 @@ static void disable_interrupt(EEPRO100State * s) } } -static void enable_interrupt(EEPRO100State * s) +static void enable_interrupt(EEPRO100State *s) { if (!s->int_stat) { TRACE(INT, logout("interrupt enabled\n")); @@ -423,7 +423,7 @@ static void enable_interrupt(EEPRO100State * s) } } -static void eepro100_acknowledge(EEPRO100State * s) +static void eepro100_acknowledge(EEPRO100State *s) { s->scb_stat &= ~s->mem[SCBAck]; s->mem[SCBAck] = s->scb_stat; @@ -432,7 +432,7 @@ static void eepro100_acknowledge(EEPRO100State * s) } } -static void eepro100_interrupt(EEPRO100State * s, uint8_t status) +static void eepro100_interrupt(EEPRO100State *s, uint8_t status) { uint8_t mask = ~s->mem[SCBIntmask]; s->mem[SCBAck] |= status; @@ -449,52 +449,52 @@ static void eepro100_interrupt(EEPRO100State * s, uint8_t status) } } -static void eepro100_cx_interrupt(EEPRO100State * s) +static void eepro100_cx_interrupt(EEPRO100State *s) { /* CU completed action command. */ /* Transmit not ok (82557 only, not in emulation). */ eepro100_interrupt(s, 0x80); } -static void eepro100_cna_interrupt(EEPRO100State * s) +static void eepro100_cna_interrupt(EEPRO100State *s) { /* CU left the active state. */ eepro100_interrupt(s, 0x20); } -static void eepro100_fr_interrupt(EEPRO100State * s) +static void eepro100_fr_interrupt(EEPRO100State *s) { /* RU received a complete frame. */ eepro100_interrupt(s, 0x40); } -static void eepro100_rnr_interrupt(EEPRO100State * s) +static void eepro100_rnr_interrupt(EEPRO100State *s) { /* RU is not ready. */ eepro100_interrupt(s, 0x10); } -static void eepro100_mdi_interrupt(EEPRO100State * s) +static void eepro100_mdi_interrupt(EEPRO100State *s) { /* MDI completed read or write cycle. */ eepro100_interrupt(s, 0x08); } -static void eepro100_swi_interrupt(EEPRO100State * s) +static void eepro100_swi_interrupt(EEPRO100State *s) { /* Software has requested an interrupt. */ eepro100_interrupt(s, 0x04); } #if 0 -static void eepro100_fcp_interrupt(EEPRO100State * s) +static void eepro100_fcp_interrupt(EEPRO100State *s) { /* Flow control pause interrupt (82558 and later). */ eepro100_interrupt(s, 0x01); } #endif -static void e100_pci_reset(EEPRO100State * s) +static void e100_pci_reset(EEPRO100State *s) { E100PCIDeviceInfo *info = eepro100_get_class(s); uint32_t device = s->device; @@ -598,7 +598,7 @@ static void e100_pci_reset(EEPRO100State * s) #endif /* EEPROM_SIZE > 0 */ } -static void nic_selective_reset(EEPRO100State * s) +static void nic_selective_reset(EEPRO100State *s) { size_t i; uint16_t *eeprom_contents = eeprom93xx_data(s->eeprom); @@ -669,7 +669,7 @@ static char *regname(uint32_t addr) / #if 0 -static uint16_t eepro100_read_command(EEPRO100State * s) +static uint16_t eepro100_read_command(EEPRO100State *s) { uint16_t val = 0x; TRACE(OTHER, logout("val=0x%04x\n", val)); @@ -694,27 +694,27 @@ enum commands { CmdTxFlex = 0x0008, /* Use "Flexible mode" for CmdTx command. */ }; -static cu_state_t get_cu_state(EEPRO100State * s) +static cu_state_t get_cu_state(EEPRO100State *s) { return ((s->mem[SCBStatus] & BITS(7, 6)) >> 6); } -static void set_cu_state(EEPRO100State * s, cu_state_t state) +static void set_cu_state(EEPRO100State *s, cu_state_t state) { s->mem[SCBStatus] = (s->mem[SCBStatus] & ~BITS(7, 6)) + (state << 6); } -static ru_state_t get_ru_state(EEPRO100State * s) +static ru_state_t get_ru_state(EEPRO100State *s) { return ((s->mem[SCBStatus] & BITS(5, 2)) >> 2); } -static void set_ru_state(EEPRO100State * s, ru_state_t state) +static void set_ru_state(EEPRO100State *s, ru_state_t state) { s->mem[SCBStatus] = (s->mem[SCBStatus] & ~BITS(5, 2)) + (state << 2); } -static void dump_statistics(EEPRO100State * s) +static void dump_statistics(EEPRO100State *s) { /* Dump statistical data. Most data is never changed by the emulation * and always 0, so we first just copy the