eepro100: Remove unused structure element
cppcheck reports that 'packet' is unused. It was only used to calculate the size of the preceding data. Removing it saves a lot of stack space (local variable rx). Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
		
							parent
							
								
									77bee84e6a
								
							
						
					
					
						commit
						27112f18f9
					
				@ -173,7 +173,7 @@ typedef struct {
 | 
				
			|||||||
    uint32_t rx_buf_addr;       /* void * */
 | 
					    uint32_t rx_buf_addr;       /* void * */
 | 
				
			||||||
    uint16_t count;
 | 
					    uint16_t count;
 | 
				
			||||||
    uint16_t size;
 | 
					    uint16_t size;
 | 
				
			||||||
    char packet[MAX_ETH_FRAME_SIZE + 4];
 | 
					    /* Ethernet frame data follows. */
 | 
				
			||||||
} eepro100_rx_t;
 | 
					} eepro100_rx_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef enum {
 | 
					typedef enum {
 | 
				
			||||||
@ -1722,7 +1722,7 @@ static ssize_t nic_receive(VLANClientState *nc, const uint8_t * buf, size_t size
 | 
				
			|||||||
    /* !!! */
 | 
					    /* !!! */
 | 
				
			||||||
    eepro100_rx_t rx;
 | 
					    eepro100_rx_t rx;
 | 
				
			||||||
    cpu_physical_memory_read(s->ru_base + s->ru_offset, &rx,
 | 
					    cpu_physical_memory_read(s->ru_base + s->ru_offset, &rx,
 | 
				
			||||||
                             offsetof(eepro100_rx_t, packet));
 | 
					                             sizeof(eepro100_rx_t));
 | 
				
			||||||
    uint16_t rfd_command = le16_to_cpu(rx.command);
 | 
					    uint16_t rfd_command = le16_to_cpu(rx.command);
 | 
				
			||||||
    uint16_t rfd_size = le16_to_cpu(rx.size);
 | 
					    uint16_t rfd_size = le16_to_cpu(rx.size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1753,7 +1753,7 @@ static ssize_t nic_receive(VLANClientState *nc, const uint8_t * buf, size_t size
 | 
				
			|||||||
    assert(!(s->configuration[17] & BIT(0)));
 | 
					    assert(!(s->configuration[17] & BIT(0)));
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    cpu_physical_memory_write(s->ru_base + s->ru_offset +
 | 
					    cpu_physical_memory_write(s->ru_base + s->ru_offset +
 | 
				
			||||||
                              offsetof(eepro100_rx_t, packet), buf, size);
 | 
					                              sizeof(eepro100_rx_t), buf, size);
 | 
				
			||||||
    s->statistics.rx_good_frames++;
 | 
					    s->statistics.rx_good_frames++;
 | 
				
			||||||
    eepro100_fr_interrupt(s);
 | 
					    eepro100_fr_interrupt(s);
 | 
				
			||||||
    s->ru_offset = le32_to_cpu(rx.link);
 | 
					    s->ru_offset = le32_to_cpu(rx.link);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user