Re: [PATCH 2/2] staging: rlt8192u: conditional compilation in r8192U_core.c

2014-08-01 Thread Greg KH
On Tue, Jun 24, 2014 at 02:46:55PM +0200, Antoine Schweitzer-Chaput wrote:
 function dump_eprom is only used when DEBUG_EPROM is set.
 function txqueue2outpipe is only used when USE_ONE_PIPE is unset.
 function GetRxPacketShiftBytes819xUsb is only used when 
 USB_RX_AGGREGATION_SUPPORT is set.
 Compile these functions only when they will actually be used.
 
 Signed-off-by: Antoine Schweitzer-Chaput anto...@schweitzer-chaput.fr
 ---
  drivers/staging/rtl8192u/r8192U_core.c | 8 ++--
  1 file changed, 6 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
 b/drivers/staging/rtl8192u/r8192U_core.c
 index 4536a87..b6718c0 100644
 --- a/drivers/staging/rtl8192u/r8192U_core.c
 +++ b/drivers/staging/rtl8192u/r8192U_core.c
 @@ -667,12 +667,14 @@ static void tx_timeout(struct net_device *dev)
  
  
  /* this is only for debug */
 +#ifdef DEBUG_EPROM

how can this ever be set?  If no one sets it, just remove the code
entirely please.

  static void dump_eprom(struct net_device *dev)
  {
   int i;
   for (i = 0; i  63; i++)
   RT_TRACE(COMP_EPROM, EEPROM addr %x : %x, i, eprom_read(dev, 
 i));
  }
 +#endif
  
  void rtl8192_update_msr(struct net_device *dev)
  {
 @@ -1553,6 +1555,7 @@ u16 N_DBPSOfRate(u16 DataRate)
   return N_DBPS;
  }
  
 +#ifndef USE_ONE_PIPE

Same here, if the option can never be selected, just delete the code.

  static unsigned int txqueue2outpipe(struct r8192_priv *priv,
   unsigned int tx_queue)
  {
 @@ -1562,6 +1565,7 @@ static unsigned int txqueue2outpipe(struct r8192_priv 
 *priv,
   }
   return priv-txqueue_to_outpipemap[tx_queue];
  }
 +#endif
  
  short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb)
  {
 @@ -4874,18 +4878,18 @@ static void query_rxdesc_status(struct sk_buff *skb,
  
  }
  
 +#ifdef USB_RX_AGGREGATION_SUPPORT

Same here.

Care to do this series all over, just delete the functions entirely.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/2] staging: rlt8192u: conditional compilation in r8192U_core.c

2014-08-01 Thread Antoine Schweitzer-Chaput
On Fri, Aug 01, 2014 at 12:59:43AM -0700, Greg KH wrote:
   /* this is only for debug */
  +#ifdef DEBUG_EPROM
 
 how can this ever be set?  If no one sets it, just remove the code
 entirely please.

I guess it's supposed to be set manually in the code (there's a large
list around l.60).

  +#ifndef USE_ONE_PIPE
 
 Same here, if the option can never be selected, just delete the code.
 
  +#ifdef USB_RX_AGGREGATION_SUPPORT
 
 Same here.

These two are set in the Makefile, but not configurable from the
outside.

I'll remove all of these, and possibly other options in the same case.

Antoine
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel