mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	can: build proc support only if CONFIG_PROC_FS is activated
When building can subsystem with CONFIG_PROC_FS=n I detected some unused variables warning by using proc functions. In CAN the proc handling is nicely placed in one object file. This patch adds simple add a dependency on CONFIG_PROC_FS for CAN's proc.o file and corresponding static inline no-op functions. Signed-off-by: Alexander Aring <aar@pengutronix.de> Acked-by: Oliver Hartkopp <socketcan@hartkopp.net> [mkl: provide static inline noops instead of using #ifdefs] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
		
							parent
							
								
									3636876a56
								
							
						
					
					
						commit
						a20fadf853
					
				
					 3 changed files with 14 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -3,7 +3,8 @@
 | 
			
		|||
#
 | 
			
		||||
 | 
			
		||||
obj-$(CONFIG_CAN)	+= can.o
 | 
			
		||||
can-y			:= af_can.o proc.o
 | 
			
		||||
can-y			:= af_can.o
 | 
			
		||||
can-$(CONFIG_PROC_FS)	+= proc.o
 | 
			
		||||
 | 
			
		||||
obj-$(CONFIG_CAN_RAW)	+= can-raw.o
 | 
			
		||||
can-raw-y		:= raw.o
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -113,8 +113,19 @@ struct s_pstats {
 | 
			
		|||
extern struct dev_rcv_lists can_rx_alldev_list;
 | 
			
		||||
 | 
			
		||||
/* function prototypes for the CAN networklayer procfs (proc.c) */
 | 
			
		||||
#ifdef CONFIG_PROC_FS
 | 
			
		||||
void can_init_proc(void);
 | 
			
		||||
void can_remove_proc(void);
 | 
			
		||||
#else
 | 
			
		||||
static inline void can_init_proc(void)
 | 
			
		||||
{
 | 
			
		||||
	pr_info("can: Can't create /proc/net/can. CONFIG_PROC_FS missing!\n");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline void can_remove_proc(void)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
void can_stat_update(unsigned long data);
 | 
			
		||||
 | 
			
		||||
/* structures and variables from af_can.c needed in proc.c for reading */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -517,8 +517,7 @@ void can_init_proc(void)
 | 
			
		|||
	can_dir = proc_mkdir("can", init_net.proc_net);
 | 
			
		||||
 | 
			
		||||
	if (!can_dir) {
 | 
			
		||||
		printk(KERN_INFO "can: failed to create /proc/net/can . "
 | 
			
		||||
		       "CONFIG_PROC_FS missing?\n");
 | 
			
		||||
		pr_info("can: failed to create /proc/net/can.\n");
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue