According to coding-style.rst, extern should not be specified for exported functions.
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -50,8 +50,8 @@ struct property_entry; · 49 unmodified lines | ||
| 50 | 50 | * transmit an arbitrary number of messages without interruption. |
| 51 | 51 | * @count must be be less than 64k since msg.len is u16. |
| 52 | 52 | */ |
| 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); | |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * 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 | ||
| 115 | 115 | |
| 116 | 116 | /* Transfer num messages. |
| 117 | 117 | */ |
| 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); | |
| 120 | 119 | /* 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); | |
| 123 | 121 | |
| 124 | 122 | /* This is the very generalized SMBus access routine. You probably do not |
| 125 | 123 | 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 | ||
| 138 | 136 | /* Now follow the 'nice' access routines. These also document the calling |
| 139 | 137 | conventions of i2c_smbus_xfer. */ |
| 140 | 138 | |
| 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); | |
| 151 | 147 | |
| 152 | 148 | static inline s32 |
| 153 | 149 | 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 | ||
| 165 | 161 | } |
| 166 | 162 | |
| 167 | 163 | /* 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); | |
| 172 | 168 | /* 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); | |
| 181 | 176 | int i2c_get_device_id(const struct i2c_client *client, |
| 182 | 177 | struct i2c_device_identity *id); |
| 183 | 178 | #endif /* I2C */ |
| @@ -337,10 +332,10 @@ struct i2c_client { · 153 unmodified lines | ||
| 337 | 332 | }; |
| 338 | 333 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) |
| 339 | 334 | |
| 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); | |
| 344 | 339 | |
| 345 | 340 | static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj) |
| 346 | 341 | { |
| @@ -369,9 +364,9 @@ enum i2c_slave_event { · 22 unmodified lines | ||
| 369 | 364 | I2C_SLAVE_STOP, |
| 370 | 365 | }; |
| 371 | 366 | |
| 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); | |
| 375 | 370 | |
| 376 | 371 | static inline int i2c_slave_event(struct i2c_client *client, |
| 377 | 372 | enum i2c_slave_event event, u8 *val) |
| @@ -440,10 +435,10 @@ struct i2c_board_info { · 62 unmodified lines | ||
| 440 | 435 | * with integrated I2C, a config eeprom, sensors, and a codec that's |
| 441 | 436 | * used in conjunction with the primary hardware. |
| 442 | 437 | */ |
| 443 | −extern struct i2c_client * | |
| 438 | +struct i2c_client * | |
| 444 | 439 | i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info); |
| 445 | 440 | |
| 446 | −extern struct i2c_client * | |
| 441 | +struct i2c_client * | |
| 447 | 442 | i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *info); |
| 448 | 443 | |
| 449 | 444 | /* 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 | ||
| 452 | 447 | * it must return 1 on successful probe, 0 otherwise. If it is not provided, |
| 453 | 448 | * a default probing method is used. |
| 454 | 449 | */ |
| 455 | −extern struct i2c_client * | |
| 450 | +struct i2c_client * | |
| 456 | 451 | i2c_new_scanned_device(struct i2c_adapter *adap, |
| 457 | 452 | struct i2c_board_info *info, |
| 458 | 453 | unsigned short const *addr_list, |
| 459 | 454 | int (*probe)(struct i2c_adapter *adap, unsigned short addr)); |
| 460 | 455 | |
| 461 | −extern struct i2c_client * | |
| 456 | +struct i2c_client * | |
| 462 | 457 | i2c_new_probed_device(struct i2c_adapter *adap, |
| 463 | 458 | struct i2c_board_info *info, |
| 464 | 459 | unsigned short const *addr_list, |
| 465 | 460 | int (*probe)(struct i2c_adapter *adap, unsigned short addr)); |
| 466 | 461 | |
| 467 | 462 | /* 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); | |
| 469 | 464 | |
| 470 | −extern struct i2c_client * | |
| 465 | +struct i2c_client * | |
| 471 | 466 | i2c_new_dummy_device(struct i2c_adapter *adapter, u16 address); |
| 472 | 467 | |
| 473 | −extern struct i2c_client * | |
| 468 | +struct i2c_client * | |
| 474 | 469 | devm_i2c_new_dummy_device(struct device *dev, struct i2c_adapter *adap, u16 address); |
| 475 | 470 | |
| 476 | −extern struct i2c_client * | |
| 471 | +struct i2c_client * | |
| 477 | 472 | i2c_new_ancillary_device(struct i2c_client *client, |
| 478 | − const char *name, | |
| 479 | − u16 default_addr); | |
| 473 | + const char *name, | |
| 474 | + u16 default_addr); | |
| 480 | 475 | |
| 481 | −extern void i2c_unregister_device(struct i2c_client *client); | |
| 476 | +void i2c_unregister_device(struct i2c_client *client); | |
| 482 | 477 | #endif /* I2C */ |
| 483 | 478 | |
| 484 | 479 | /* 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 | ||
| 486 | 481 | * Modules for add-on boards must use other calls. |
| 487 | 482 | */ |
| 488 | 483 | #ifdef CONFIG_I2C_BOARDINFO |
| 489 | −extern int | |
| 484 | +int | |
| 490 | 485 | i2c_register_board_info(int busnum, struct i2c_board_info const *info, |
| 491 | 486 | unsigned n); |
| 492 | 487 | #else |
| @@ -840,12 +835,12 @@ static inline void i2c_mark_adapter_resumed(struct i2c_adapter *adap) · 347 unmodified lines | ||
| 840 | 835 | /* administration... |
| 841 | 836 | */ |
| 842 | 837 | #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); | |
| 846 | 841 | |
| 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); | |
| 849 | 844 | |
| 850 | 845 | /* use a define to avoid include chaining to get THIS_MODULE */ |
| 851 | 846 | #define i2c_add_driver(driver) \ |
| @@ -858,12 +853,12 @@ static inline bool i2c_client_has_driver(struct i2c_client *client) · 6 unmodified lines | ||
| 858 | 853 | |
| 859 | 854 | /* call the i2c_client->command() of all attached clients with |
| 860 | 855 | * 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); | |
| 863 | 858 | |
| 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); | |
| 867 | 862 | |
| 868 | 863 | void i2c_parse_fw_timings(struct device *dev, struct i2c_timings *t, bool use_defaults); |
| 869 | 864 | |
| @@ -935,15 +930,15 @@ int i2c_handle_smbus_host_notify(struct i2c_adapter *adap, unsigned short addr); · 65 unmodified lines | ||
| 935 | 930 | |
| 936 | 931 | #if IS_ENABLED(CONFIG_OF) |
| 937 | 932 | /* 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); | |
| 939 | 934 | |
| 940 | 935 | /* 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); | |
| 942 | 937 | |
| 943 | 938 | /* must call i2c_put_adapter() when done with returned i2c_adapter device */ |
| 944 | 939 | struct i2c_adapter *of_get_i2c_adapter_by_node(struct device_node *node); |
| 945 | 940 | |
| 946 | −extern const struct of_device_id | |
| 941 | +const struct of_device_id | |
| 947 | 942 | *i2c_of_match_device(const struct of_device_id *matches, |
| 948 | 943 | struct i2c_client *client); |
| 949 | 944 | |