Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] W1: possible cleanups

This patch contains the following possible cleanups:
- the following file did't #include the header with the prototypes for
it's global functions:
- w1_int.c
- #if 0 the following unused global function:
- w1_family.c: w1_family_get()
- make the following needlessly global functions static:
- w1_family.c: __w1_family_put()
- w1_io.c: w1_delay()
- w1_io.c: w1_touch_bit()
- w1_io.c: w1_read_8()
- remove the following unused EXPORT_SYMBOL's:
- w1_family.c: w1_family_put
- w1_family.c: w1_family_registered

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Evgeniy Polyakov and committed by
Greg Kroah-Hartman
70d484bf 2c5bfdac

+12 -21
-3
drivers/w1/w1.h
··· 187 187 void w1_search_process(struct w1_master *dev, u8 search_type); 188 188 struct w1_master *w1_search_master_id(u32 id); 189 189 190 - void w1_delay(unsigned long); 191 - u8 w1_touch_bit(struct w1_master *, int); 192 190 u8 w1_triplet(struct w1_master *dev, int bdir); 193 191 void w1_write_8(struct w1_master *, u8); 194 - u8 w1_read_8(struct w1_master *); 195 192 int w1_reset_bus(struct w1_master *); 196 193 u8 w1_calc_crc8(u8 *, int); 197 194 void w1_write_block(struct w1_master *, const u8 *, int);
+8 -10
drivers/w1/w1_family.c
··· 107 107 return (ret) ? f : NULL; 108 108 } 109 109 110 + static void __w1_family_put(struct w1_family *f) 111 + { 112 + if (atomic_dec_and_test(&f->refcnt)) 113 + f->need_exit = 1; 114 + } 115 + 110 116 void w1_family_put(struct w1_family *f) 111 117 { 112 118 spin_lock(&w1_flock); ··· 120 114 spin_unlock(&w1_flock); 121 115 } 122 116 123 - void __w1_family_put(struct w1_family *f) 124 - { 125 - if (atomic_dec_and_test(&f->refcnt)) 126 - f->need_exit = 1; 127 - } 128 - 117 + #if 0 129 118 void w1_family_get(struct w1_family *f) 130 119 { 131 120 spin_lock(&w1_flock); 132 121 __w1_family_get(f); 133 122 spin_unlock(&w1_flock); 134 - 135 123 } 124 + #endif /* 0 */ 136 125 137 126 void __w1_family_get(struct w1_family *f) 138 127 { ··· 136 135 smp_mb__after_atomic_inc(); 137 136 } 138 137 139 - EXPORT_SYMBOL(w1_family_get); 140 - EXPORT_SYMBOL(w1_family_put); 141 - EXPORT_SYMBOL(w1_family_registered); 142 138 EXPORT_SYMBOL(w1_unregister_family); 143 139 EXPORT_SYMBOL(w1_register_family);
-2
drivers/w1/w1_family.h
··· 57 57 58 58 extern spinlock_t w1_flock; 59 59 60 - void w1_family_get(struct w1_family *); 61 60 void w1_family_put(struct w1_family *); 62 61 void __w1_family_get(struct w1_family *); 63 - void __w1_family_put(struct w1_family *); 64 62 struct w1_family * w1_family_registered(u8); 65 63 void w1_unregister_family(struct w1_family *); 66 64 int w1_register_family(struct w1_family *);
+1
drivers/w1/w1_int.c
··· 27 27 #include "w1.h" 28 28 #include "w1_log.h" 29 29 #include "w1_netlink.h" 30 + #include "w1_int.h" 30 31 31 32 static u32 w1_ids = 1; 32 33
+3 -3
drivers/w1/w1_io.c
··· 50 50 116, 42, 200, 150, 21, 75, 169, 247, 182, 232, 10, 84, 215, 137, 107, 53 51 51 }; 52 52 53 - void w1_delay(unsigned long tm) 53 + static void w1_delay(unsigned long tm) 54 54 { 55 55 udelay(tm * w1_delay_parm); 56 56 } ··· 61 61 /** 62 62 * Generates a write-0 or write-1 cycle and samples the level. 63 63 */ 64 - u8 w1_touch_bit(struct w1_master *dev, int bit) 64 + static u8 w1_touch_bit(struct w1_master *dev, int bit) 65 65 { 66 66 if (dev->bus_master->touch_bit) 67 67 return dev->bus_master->touch_bit(dev->bus_master->data, bit); ··· 177 177 * @param dev the master device 178 178 * @return the byte read 179 179 */ 180 - u8 w1_read_8(struct w1_master * dev) 180 + static u8 w1_read_8(struct w1_master * dev) 181 181 { 182 182 int i; 183 183 u8 res = 0;
-3
drivers/w1/w1_io.h
··· 24 24 25 25 #include "w1.h" 26 26 27 - void w1_delay(unsigned long); 28 - u8 w1_touch_bit(struct w1_master *, int); 29 27 u8 w1_triplet(struct w1_master *dev, int bdir); 30 28 void w1_write_8(struct w1_master *, u8); 31 - u8 w1_read_8(struct w1_master *); 32 29 int w1_reset_bus(struct w1_master *); 33 30 u8 w1_calc_crc8(u8 *, int); 34 31 void w1_write_block(struct w1_master *, const u8 *, int);