public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] conditionally #ifdef-out unused DiB3000M-C/P functions
@ 2005-12-21 11:37 Marc Koschewski
  2005-12-21 13:52 ` [PATCH 2/2] conditionally #ifdef-out unused DiB3000M-C/P defs Marc Koschewski
  2005-12-23  2:04 ` [PATCH] conditionally #ifdef-out unused DiB3000M-C/P functions Adrian Bunk
  0 siblings, 2 replies; 4+ messages in thread
From: Marc Koschewski @ 2005-12-21 11:37 UTC (permalink / raw)
  To: linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 354 bytes --]

The following tiny patch removes the two DiB3000M-C/P functions

int dibusb_dib3000mc_tuner_attach()
int dibusb_dib3000mc_frontend_attach()

that are not needed in case the module is not compiled. The modules a800 as well
as nova-t-usb2 select DVB_DIB3000MB in Kconfig thus the functions will be
enabled due to the module being compiled.

Regards,
	Marc

[-- Attachment #1.2: dibusb-remove-dibusb_dib3000-funcs-if-not-CONFIG_DVB_USB_DIBUSB_MC.patch --]
[-- Type: text/plain, Size: 624 bytes --]

*** dibusb-common.c-orig	2005-12-21 11:04:49.000000000 +0100
--- dibusb-common.c	2005-12-21 11:05:32.000000000 +0100
*************** int dibusb_read_eeprom_byte(struct dvb_u
*** 168,173 ****
--- 168,174 ----
  }
  EXPORT_SYMBOL(dibusb_read_eeprom_byte);
  
+ #ifdef CONFIG_DVB_USB_DIBUSB_MC
  int dibusb_dib3000mc_frontend_attach(struct dvb_usb_device *d)
  {
  	struct dib3000_config demod_cfg;
*************** int dibusb_dib3000mc_tuner_attach (struc
*** 193,198 ****
--- 194,200 ----
  	return 0;
  }
  EXPORT_SYMBOL(dibusb_dib3000mc_tuner_attach);
+ #endif
  
  /*
   * common remote control stuff

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] conditionally #ifdef-out unused DiB3000M-C/P defs
  2005-12-21 11:37 [PATCH] conditionally #ifdef-out unused DiB3000M-C/P functions Marc Koschewski
@ 2005-12-21 13:52 ` Marc Koschewski
  2005-12-23  2:05   ` Adrian Bunk
  2005-12-23  2:04 ` [PATCH] conditionally #ifdef-out unused DiB3000M-C/P functions Adrian Bunk
  1 sibling, 1 reply; 4+ messages in thread
From: Marc Koschewski @ 2005-12-21 13:52 UTC (permalink / raw)
  To: Marc Koschewski; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 39 bytes --]

This removes the declarations as well.

[-- Attachment #2: dibusb-remove-dibusb_dib3000-defs-if-not-CONFIG_DVB_USB_DIBUSB_MC.patch --]
[-- Type: text/plain, Size: 554 bytes --]

*** dibusb.h-orig	2005-12-21 14:49:08.000000000 +0100
--- dibusb.h	2005-12-21 14:49:30.000000000 +0100
*************** struct dibusb_state {
*** 104,111 ****
--- 104,113 ----
  
  extern struct i2c_algorithm dibusb_i2c_algo;
  
+ #ifdef CONFIG_DVB_USB_DIBUSB_MC
  extern int dibusb_dib3000mc_frontend_attach(struct dvb_usb_device *);
  extern int dibusb_dib3000mc_tuner_attach (struct dvb_usb_device *);
+ #endif
  
  extern int dibusb_streaming_ctrl(struct dvb_usb_device *, int);
  extern int dibusb_pid_filter(struct dvb_usb_device *, int, u16, int);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] conditionally #ifdef-out unused DiB3000M-C/P functions
  2005-12-21 11:37 [PATCH] conditionally #ifdef-out unused DiB3000M-C/P functions Marc Koschewski
  2005-12-21 13:52 ` [PATCH 2/2] conditionally #ifdef-out unused DiB3000M-C/P defs Marc Koschewski
@ 2005-12-23  2:04 ` Adrian Bunk
  1 sibling, 0 replies; 4+ messages in thread
From: Adrian Bunk @ 2005-12-23  2:04 UTC (permalink / raw)
  To: Marc Koschewski; +Cc: linux-kernel

On Wed, Dec 21, 2005 at 12:37:43PM +0100, Marc Koschewski wrote:
> The following tiny patch removes the two DiB3000M-C/P functions
> 
> int dibusb_dib3000mc_tuner_attach()
> int dibusb_dib3000mc_frontend_attach()
> 
> that are not needed in case the module is not compiled. The modules a800 as well
> as nova-t-usb2 select DVB_DIB3000MB in Kconfig thus the functions will be
> enabled due to the module being compiled.

In theory, you could add #ifdef's in thousands of places of the kernel 
around functions similarly small to these two ones or sometimes bigger 
functions.

In practice, this would cause breakages in many configurations because 
the #ifdef's might either be wrong (as in your patch) or become wrong 
over time.

> Regards,
> 	Marc

> *** dibusb-common.c-orig	2005-12-21 11:04:49.000000000 +0100
> --- dibusb-common.c	2005-12-21 11:05:32.000000000 +0100
> *************** int dibusb_read_eeprom_byte(struct dvb_u
> *** 168,173 ****
> --- 168,174 ----
>   }
>   EXPORT_SYMBOL(dibusb_read_eeprom_byte);
>   
> + #ifdef CONFIG_DVB_USB_DIBUSB_MC
>...

This breaks with DVB_USB_DIBUSB_MC=m.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] conditionally #ifdef-out unused DiB3000M-C/P defs
  2005-12-21 13:52 ` [PATCH 2/2] conditionally #ifdef-out unused DiB3000M-C/P defs Marc Koschewski
@ 2005-12-23  2:05   ` Adrian Bunk
  0 siblings, 0 replies; 4+ messages in thread
From: Adrian Bunk @ 2005-12-23  2:05 UTC (permalink / raw)
  To: Marc Koschewski; +Cc: linux-kernel

On Wed, Dec 21, 2005 at 02:52:44PM +0100, Marc Koschewski wrote:
> This removes the declarations as well.

> *** dibusb.h-orig	2005-12-21 14:49:08.000000000 +0100
> --- dibusb.h	2005-12-21 14:49:30.000000000 +0100
> *************** struct dibusb_state {
> *** 104,111 ****
> --- 104,113 ----
>   
>   extern struct i2c_algorithm dibusb_i2c_algo;
>   
> + #ifdef CONFIG_DVB_USB_DIBUSB_MC
>   extern int dibusb_dib3000mc_frontend_attach(struct dvb_usb_device *);
>   extern int dibusb_dib3000mc_tuner_attach (struct dvb_usb_device *);
> + #endif
>...

There's no need to #ifdef function declarations away.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-12-23  2:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-21 11:37 [PATCH] conditionally #ifdef-out unused DiB3000M-C/P functions Marc Koschewski
2005-12-21 13:52 ` [PATCH 2/2] conditionally #ifdef-out unused DiB3000M-C/P defs Marc Koschewski
2005-12-23  2:05   ` Adrian Bunk
2005-12-23  2:04 ` [PATCH] conditionally #ifdef-out unused DiB3000M-C/P functions Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox