History

i2c: remove unneeded 'extern' from function declatations

According to coding-style.rst, extern should not be specified for exported functions.

Luca Ceresoli committed 6 years ago

Commit c807da51 parent d1eef1c1 file · +55 −60Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/i2c.h+55−60
@@ -50,8 +50,8 @@ struct property_entry; · 49 unmodified lines
5050 * transmit an arbitrary number of messages without interruption.
5151 * @count must be be less than 64k since msg.len is u16.
5252 */
53−extern int i2c_transfer_buffer_flags(const struct i2c_client *client,
54− char *buf, int count, u16 flags);
53+int i2c_transfer_buffer_flags(const struct i2c_client *client,
54+ char *buf, int count, u16 flags);
5555
5656 /**
5757 * i2c_master_recv - issue a single I2C message in master receive mode
@@ -115,11 +115,9 @@ static inline int i2c_master_send_dmasafe(const struct i2c_client *client, · 57 unmodified lines
115115
116116 /* Transfer num messages.
117117 */
118−extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
119− int num);
118+int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num);
120119 /* Unlocked flavor */
121−extern int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
122− int num);
120+int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num);
123121
124122 /* This is the very generalized SMBus access routine. You probably do not
125123 want to use this, though; one of the functions below may be much easier,
@@ -138,16 +136,14 @@ s32 __i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, · 12 unmodified lines
138136 /* Now follow the 'nice' access routines. These also document the calling
139137 conventions of i2c_smbus_xfer. */
140138
141−extern s32 i2c_smbus_read_byte(const struct i2c_client *client);
142−extern s32 i2c_smbus_write_byte(const struct i2c_client *client, u8 value);
143−extern s32 i2c_smbus_read_byte_data(const struct i2c_client *client,
144− u8 command);
145−extern s32 i2c_smbus_write_byte_data(const struct i2c_client *client,
146− u8 command, u8 value);
147−extern s32 i2c_smbus_read_word_data(const struct i2c_client *client,
148− u8 command);
149−extern s32 i2c_smbus_write_word_data(const struct i2c_client *client,
150− u8 command, u16 value);
139+s32 i2c_smbus_read_byte(const struct i2c_client *client);
140+s32 i2c_smbus_write_byte(const struct i2c_client *client, u8 value);
141+s32 i2c_smbus_read_byte_data(const struct i2c_client *client, u8 command);
142+s32 i2c_smbus_write_byte_data(const struct i2c_client *client,
143+ u8 command, u8 value);
144+s32 i2c_smbus_read_word_data(const struct i2c_client *client, u8 command);
145+s32 i2c_smbus_write_word_data(const struct i2c_client *client,
146+ u8 command, u16 value);
151147
152148 static inline s32
153149 i2c_smbus_read_word_swapped(const struct i2c_client *client, u8 command)
@@ -165,19 +161,18 @@ i2c_smbus_write_word_swapped(const struct i2c_client *client, · 11 unmodified lines
165161 }
166162
167163 /* Returns the number of read bytes */
168−extern s32 i2c_smbus_read_block_data(const struct i2c_client *client,
169− u8 command, u8 *values);
170−extern s32 i2c_smbus_write_block_data(const struct i2c_client *client,
171− u8 command, u8 length, const u8 *values);
164+s32 i2c_smbus_read_block_data(const struct i2c_client *client,
165+ u8 command, u8 *values);
166+s32 i2c_smbus_write_block_data(const struct i2c_client *client,
167+ u8 command, u8 length, const u8 *values);
172168 /* Returns the number of read bytes */
173−extern s32 i2c_smbus_read_i2c_block_data(const struct i2c_client *client,
174− u8 command, u8 length, u8 *values);
175−extern s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client,
176− u8 command, u8 length,
177− const u8 *values);
178−extern s32
179−i2c_smbus_read_i2c_block_data_or_emulated(const struct i2c_client *client,
180− u8 command, u8 length, u8 *values);
169+s32 i2c_smbus_read_i2c_block_data(const struct i2c_client *client,
170+ u8 command, u8 length, u8 *values);
171+s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client,
172+ u8 command, u8 length, const u8 *values);
173+s32 i2c_smbus_read_i2c_block_data_or_emulated(const struct i2c_client *client,
174+ u8 command, u8 length,
175+ u8 *values);
181176 int i2c_get_device_id(const struct i2c_client *client,
182177 struct i2c_device_identity *id);
183178 #endif /* I2C */
@@ -337,10 +332,10 @@ struct i2c_client { · 153 unmodified lines
337332 };
338333 #define to_i2c_client(d) container_of(d, struct i2c_client, dev)
339334
340−extern struct i2c_client *i2c_verify_client(struct device *dev);
341−extern struct i2c_adapter *i2c_verify_adapter(struct device *dev);
342−extern const struct i2c_device_id *i2c_match_id(const struct i2c_device_id *id,
343− const struct i2c_client *client);
335+struct i2c_client *i2c_verify_client(struct device *dev);
336+struct i2c_adapter *i2c_verify_adapter(struct device *dev);
337+const struct i2c_device_id *i2c_match_id(const struct i2c_device_id *id,
338+ const struct i2c_client *client);
344339
345340 static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
346341 {
@@ -369,9 +364,9 @@ enum i2c_slave_event { · 22 unmodified lines
369364 I2C_SLAVE_STOP,
370365 };
371366
372−extern int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb);
373−extern int i2c_slave_unregister(struct i2c_client *client);
374−extern bool i2c_detect_slave_mode(struct device *dev);
367+int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb);
368+int i2c_slave_unregister(struct i2c_client *client);
369+bool i2c_detect_slave_mode(struct device *dev);
375370
376371 static inline int i2c_slave_event(struct i2c_client *client,
377372 enum i2c_slave_event event, u8 *val)
@@ -440,10 +435,10 @@ struct i2c_board_info { · 62 unmodified lines
440435 * with integrated I2C, a config eeprom, sensors, and a codec that's
441436 * used in conjunction with the primary hardware.
442437 */
443−extern struct i2c_client *
438+struct i2c_client *
444439 i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info);
445440
446−extern struct i2c_client *
441+struct i2c_client *
447442 i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *info);
448443
449444 /* If you don't know the exact address of an I2C device, use this variant
@@ -452,33 +447,33 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf · 2 unmodified lines
452447 * it must return 1 on successful probe, 0 otherwise. If it is not provided,
453448 * a default probing method is used.
454449 */
455−extern struct i2c_client *
450+struct i2c_client *
456451 i2c_new_scanned_device(struct i2c_adapter *adap,
457452 struct i2c_board_info *info,
458453 unsigned short const *addr_list,
459454 int (*probe)(struct i2c_adapter *adap, unsigned short addr));
460455
461−extern struct i2c_client *
456+struct i2c_client *
462457 i2c_new_probed_device(struct i2c_adapter *adap,
463458 struct i2c_board_info *info,
464459 unsigned short const *addr_list,
465460 int (*probe)(struct i2c_adapter *adap, unsigned short addr));
466461
467462 /* Common custom probe functions */
468−extern int i2c_probe_func_quick_read(struct i2c_adapter *adap, unsigned short addr);
463+int i2c_probe_func_quick_read(struct i2c_adapter *adap, unsigned short addr);
469464
470−extern struct i2c_client *
465+struct i2c_client *
471466 i2c_new_dummy_device(struct i2c_adapter *adapter, u16 address);
472467
473−extern struct i2c_client *
468+struct i2c_client *
474469 devm_i2c_new_dummy_device(struct device *dev, struct i2c_adapter *adap, u16 address);
475470
476−extern struct i2c_client *
471+struct i2c_client *
477472 i2c_new_ancillary_device(struct i2c_client *client,
478− const char *name,
479− u16 default_addr);
473+ const char *name,
474+ u16 default_addr);
480475
481−extern void i2c_unregister_device(struct i2c_client *client);
476+void i2c_unregister_device(struct i2c_client *client);
482477 #endif /* I2C */
483478
484479 /* Mainboard arch_initcall() code should register all its I2C devices.
@@ -486,7 +481,7 @@ extern void i2c_unregister_device(struct i2c_client *client); · 1 unmodified line
486481 * Modules for add-on boards must use other calls.
487482 */
488483 #ifdef CONFIG_I2C_BOARDINFO
489−extern int
484+int
490485 i2c_register_board_info(int busnum, struct i2c_board_info const *info,
491486 unsigned n);
492487 #else
@@ -840,12 +835,12 @@ static inline void i2c_mark_adapter_resumed(struct i2c_adapter *adap) · 347 unmodified lines
840835 /* administration...
841836 */
842837 #if IS_ENABLED(CONFIG_I2C)
843−extern int i2c_add_adapter(struct i2c_adapter *adap);
844−extern void i2c_del_adapter(struct i2c_adapter *adap);
845−extern int i2c_add_numbered_adapter(struct i2c_adapter *adap);
838+int i2c_add_adapter(struct i2c_adapter *adap);
839+void i2c_del_adapter(struct i2c_adapter *adap);
840+int i2c_add_numbered_adapter(struct i2c_adapter *adap);
846841
847−extern int i2c_register_driver(struct module *owner, struct i2c_driver *driver);
848−extern void i2c_del_driver(struct i2c_driver *driver);
842+int i2c_register_driver(struct module *owner, struct i2c_driver *driver);
843+void i2c_del_driver(struct i2c_driver *driver);
849844
850845 /* use a define to avoid include chaining to get THIS_MODULE */
851846 #define i2c_add_driver(driver) \
@@ -858,12 +853,12 @@ static inline bool i2c_client_has_driver(struct i2c_client *client) · 6 unmodified lines
858853
859854 /* call the i2c_client->command() of all attached clients with
860855 * the given arguments */
861−extern void i2c_clients_command(struct i2c_adapter *adap,
862− unsigned int cmd, void *arg);
856+void i2c_clients_command(struct i2c_adapter *adap,
857+ unsigned int cmd, void *arg);
863858
864−extern struct i2c_adapter *i2c_get_adapter(int nr);
865−extern void i2c_put_adapter(struct i2c_adapter *adap);
866−extern unsigned int i2c_adapter_depth(struct i2c_adapter *adapter);
859+struct i2c_adapter *i2c_get_adapter(int nr);
860+void i2c_put_adapter(struct i2c_adapter *adap);
861+unsigned int i2c_adapter_depth(struct i2c_adapter *adapter);
867862
868863 void i2c_parse_fw_timings(struct device *dev, struct i2c_timings *t, bool use_defaults);
869864
@@ -935,15 +930,15 @@ int i2c_handle_smbus_host_notify(struct i2c_adapter *adap, unsigned short addr); · 65 unmodified lines
935930
936931 #if IS_ENABLED(CONFIG_OF)
937932 /* must call put_device() when done with returned i2c_client device */
938−extern struct i2c_client *of_find_i2c_device_by_node(struct device_node *node);
933+struct i2c_client *of_find_i2c_device_by_node(struct device_node *node);
939934
940935 /* must call put_device() when done with returned i2c_adapter device */
941−extern struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node);
936+struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node);
942937
943938 /* must call i2c_put_adapter() when done with returned i2c_adapter device */
944939 struct i2c_adapter *of_get_i2c_adapter_by_node(struct device_node *node);
945940
946−extern const struct of_device_id
941+const struct of_device_id
947942 *i2c_of_match_device(const struct of_device_id *matches,
948943 struct i2c_client *client);
949944