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

wifi: mac80211: convert debugfs files to short fops

Given the large size of the regular struct file_operations, save
a lot of space with the newly added short fops for debugfs.

Link: https://patch.msgid.link/20241022151838.2f6de3ea3ecc.I45657e6a8415d796ec95c95becc9efb377ee3be6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

+18 -35
+9 -18
net/mac80211/debugfs.c
··· 42 42 } 43 43 44 44 #define DEBUGFS_READONLY_FILE_OPS(name) \ 45 - static const struct file_operations name## _ops = { \ 45 + static const struct debugfs_short_fops name## _ops = { \ 46 46 .read = name## _read, \ 47 - .open = simple_open, \ 48 47 .llseek = generic_file_llseek, \ 49 48 }; 50 49 ··· 141 142 return -EINVAL; 142 143 } 143 144 144 - static const struct file_operations aqm_ops = { 145 + static const struct debugfs_short_fops aqm_ops = { 145 146 .write = aqm_write, 146 147 .read = aqm_read, 147 - .open = simple_open, 148 148 .llseek = default_llseek, 149 149 }; 150 150 ··· 192 194 return count; 193 195 } 194 196 195 - static const struct file_operations airtime_flags_ops = { 197 + static const struct debugfs_short_fops airtime_flags_ops = { 196 198 .write = airtime_flags_write, 197 199 .read = airtime_flags_read, 198 - .open = simple_open, 199 200 .llseek = default_llseek, 200 201 }; 201 202 ··· 222 225 buf, len); 223 226 } 224 227 225 - static const struct file_operations aql_pending_ops = { 228 + static const struct debugfs_short_fops aql_pending_ops = { 226 229 .read = aql_pending_read, 227 - .open = simple_open, 228 230 .llseek = default_llseek, 229 231 }; 230 232 ··· 301 305 return count; 302 306 } 303 307 304 - static const struct file_operations aql_txq_limit_ops = { 308 + static const struct debugfs_short_fops aql_txq_limit_ops = { 305 309 .write = aql_txq_limit_write, 306 310 .read = aql_txq_limit_read, 307 - .open = simple_open, 308 311 .llseek = default_llseek, 309 312 }; 310 313 ··· 350 355 return count; 351 356 } 352 357 353 - static const struct file_operations aql_enable_ops = { 358 + static const struct debugfs_short_fops aql_enable_ops = { 354 359 .write = aql_enable_write, 355 360 .read = aql_enable_read, 356 - .open = simple_open, 357 361 .llseek = default_llseek, 358 362 }; 359 363 ··· 400 406 return count; 401 407 } 402 408 403 - static const struct file_operations force_tx_status_ops = { 409 + static const struct debugfs_short_fops force_tx_status_ops = { 404 410 .write = force_tx_status_write, 405 411 .read = force_tx_status_read, 406 - .open = simple_open, 407 412 .llseek = default_llseek, 408 413 }; 409 414 ··· 427 434 return count; 428 435 } 429 436 430 - static const struct file_operations reset_ops = { 437 + static const struct debugfs_short_fops reset_ops = { 431 438 .write = reset_write, 432 - .open = simple_open, 433 439 .llseek = noop_llseek, 434 440 }; 435 441 #endif ··· 616 624 print_devstats_##name); \ 617 625 } \ 618 626 \ 619 - static const struct file_operations stats_ ##name## _ops = { \ 627 + static const struct debugfs_short_fops stats_ ##name## _ops = { \ 620 628 .read = stats_ ##name## _read, \ 621 - .open = simple_open, \ 622 629 .llseek = generic_file_llseek, \ 623 630 }; 624 631
+3 -6
net/mac80211/debugfs_key.c
··· 26 26 #define KEY_READ_X(name) KEY_READ(name, name, "0x%x\n") 27 27 28 28 #define KEY_OPS(name) \ 29 - static const struct file_operations key_ ##name## _ops = { \ 29 + static const struct debugfs_short_fops key_ ##name## _ops = { \ 30 30 .read = key_##name##_read, \ 31 - .open = simple_open, \ 32 31 .llseek = generic_file_llseek, \ 33 32 } 34 33 35 34 #define KEY_OPS_W(name) \ 36 - static const struct file_operations key_ ##name## _ops = { \ 35 + static const struct debugfs_short_fops key_ ##name## _ops = { \ 37 36 .read = key_##name##_read, \ 38 37 .write = key_##name##_write, \ 39 - .open = simple_open, \ 40 38 .llseek = generic_file_llseek, \ 41 39 } 42 40 ··· 47 49 #define KEY_CONF_READ_D(name) KEY_CONF_READ(name, "%d\n") 48 50 49 51 #define KEY_CONF_OPS(name) \ 50 - static const struct file_operations key_ ##name## _ops = { \ 52 + static const struct debugfs_short_fops key_ ##name## _ops = { \ 51 53 .read = key_conf_##name##_read, \ 52 - .open = simple_open, \ 53 54 .llseek = generic_file_llseek, \ 54 55 } 55 56
+1 -2
net/mac80211/debugfs_netdev.c
··· 221 221 } 222 222 223 223 #define _IEEE80211_IF_FILE_OPS(name, _read, _write) \ 224 - static const struct file_operations name##_ops = { \ 224 + static const struct debugfs_short_fops name##_ops = { \ 225 225 .read = (_read), \ 226 226 .write = (_write), \ 227 - .open = simple_open, \ 228 227 .llseek = generic_file_llseek, \ 229 228 } 230 229
+3 -6
net/mac80211/debugfs_sta.c
··· 30 30 #define STA_READ_D(name, field) STA_READ(name, field, "%d\n") 31 31 32 32 #define STA_OPS(name) \ 33 - static const struct file_operations sta_ ##name## _ops = { \ 33 + static const struct debugfs_short_fops sta_ ##name## _ops = { \ 34 34 .read = sta_##name##_read, \ 35 - .open = simple_open, \ 36 35 .llseek = generic_file_llseek, \ 37 36 } 38 37 39 38 #define STA_OPS_RW(name) \ 40 - static const struct file_operations sta_ ##name## _ops = { \ 39 + static const struct debugfs_short_fops sta_ ##name## _ops = { \ 41 40 .read = sta_##name##_read, \ 42 41 .write = sta_##name##_write, \ 43 - .open = simple_open, \ 44 42 .llseek = generic_file_llseek, \ 45 43 } 46 44 ··· 448 450 449 451 /* link sta attributes */ 450 452 #define LINK_STA_OPS(name) \ 451 - static const struct file_operations link_sta_ ##name## _ops = { \ 453 + static const struct debugfs_short_fops link_sta_ ##name## _ops = { \ 452 454 .read = link_sta_##name##_read, \ 453 - .open = simple_open, \ 454 455 .llseek = generic_file_llseek, \ 455 456 } 456 457
+1 -2
net/mac80211/rate.c
··· 249 249 ref->ops->name, len); 250 250 } 251 251 252 - const struct file_operations rcname_ops = { 252 + const struct debugfs_short_fops rcname_ops = { 253 253 .read = rcname_read, 254 - .open = simple_open, 255 254 .llseek = default_llseek, 256 255 }; 257 256 #endif
+1 -1
net/mac80211/rate.h
··· 62 62 #endif 63 63 } 64 64 65 - extern const struct file_operations rcname_ops; 65 + extern const struct debugfs_short_fops rcname_ops; 66 66 67 67 static inline void rate_control_add_debugfs(struct ieee80211_local *local) 68 68 {