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

usb: gadget: ffs: remove ENTER() macro

ENTER() used to show function name which called during runtime, ftrace can
be used to get same information, let's remove it.

Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
Link: https://lore.kernel.org/r/1679911940-4727-1-git-send-email-quic_linyyuan@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Linyu Yuan and committed by
Greg Kroah-Hartman
f54134b3 7bf1c56a

-105
-94
drivers/usb/gadget/function/f_fs.c
··· 335 335 ssize_t ret; 336 336 char *data; 337 337 338 - ENTER(); 339 - 340 338 /* Fast check if setup was canceled */ 341 339 if (ffs_setup_state_clear_cancelled(ffs) == FFS_SETUP_CANCELLED) 342 340 return -EIDRM; ··· 510 512 size_t n; 511 513 int ret; 512 514 513 - ENTER(); 514 - 515 515 /* Fast check if setup was canceled */ 516 516 if (ffs_setup_state_clear_cancelled(ffs) == FFS_SETUP_CANCELLED) 517 517 return -EIDRM; ··· 608 612 { 609 613 struct ffs_data *ffs = inode->i_private; 610 614 611 - ENTER(); 612 - 613 615 if (ffs->state == FFS_CLOSING) 614 616 return -EBUSY; 615 617 ··· 621 627 { 622 628 struct ffs_data *ffs = file->private_data; 623 629 624 - ENTER(); 625 - 626 630 ffs_data_closed(ffs); 627 631 628 632 return 0; ··· 631 639 struct ffs_data *ffs = file->private_data; 632 640 struct usb_gadget *gadget = ffs->gadget; 633 641 long ret; 634 - 635 - ENTER(); 636 642 637 643 if (code == FUNCTIONFS_INTERFACE_REVMAP) { 638 644 struct ffs_function *func = ffs->func; ··· 705 715 { 706 716 struct ffs_io_data *io_data = req->context; 707 717 708 - ENTER(); 709 718 if (req->status) 710 719 io_data->status = req->status; 711 720 else ··· 844 855 { 845 856 struct ffs_io_data *io_data = req->context; 846 857 struct ffs_data *ffs = io_data->ffs; 847 - 848 - ENTER(); 849 858 850 859 io_data->status = req->status ? req->status : req->actual; 851 860 usb_ep_free_request(_ep, req); ··· 1148 1161 { 1149 1162 struct ffs_epfile *epfile = inode->i_private; 1150 1163 1151 - ENTER(); 1152 - 1153 1164 if (WARN_ON(epfile->ffs->state != FFS_ACTIVE)) 1154 1165 return -ENODEV; 1155 1166 ··· 1163 1178 struct ffs_epfile *epfile = kiocb->ki_filp->private_data; 1164 1179 unsigned long flags; 1165 1180 int value; 1166 - 1167 - ENTER(); 1168 1181 1169 1182 spin_lock_irqsave(&epfile->ffs->eps_lock, flags); 1170 1183 ··· 1180 1197 { 1181 1198 struct ffs_io_data io_data, *p = &io_data; 1182 1199 ssize_t res; 1183 - 1184 - ENTER(); 1185 1200 1186 1201 if (!is_sync_kiocb(kiocb)) { 1187 1202 p = kzalloc(sizeof(io_data), GFP_KERNEL); ··· 1215 1234 { 1216 1235 struct ffs_io_data io_data, *p = &io_data; 1217 1236 ssize_t res; 1218 - 1219 - ENTER(); 1220 1237 1221 1238 if (!is_sync_kiocb(kiocb)) { 1222 1239 p = kzalloc(sizeof(io_data), GFP_KERNEL); ··· 1263 1284 { 1264 1285 struct ffs_epfile *epfile = inode->i_private; 1265 1286 1266 - ENTER(); 1267 - 1268 1287 __ffs_epfile_read_buffer_free(epfile); 1269 1288 ffs_data_closed(epfile->ffs); 1270 1289 ··· 1275 1298 struct ffs_epfile *epfile = file->private_data; 1276 1299 struct ffs_ep *ep; 1277 1300 int ret; 1278 - 1279 - ENTER(); 1280 1301 1281 1302 if (WARN_ON(epfile->ffs->state != FFS_ACTIVE)) 1282 1303 return -ENODEV; ··· 1374 1399 { 1375 1400 struct inode *inode; 1376 1401 1377 - ENTER(); 1378 - 1379 1402 inode = new_inode(sb); 1380 1403 1381 1404 if (inode) { ··· 1404 1431 struct ffs_data *ffs = sb->s_fs_info; 1405 1432 struct dentry *dentry; 1406 1433 struct inode *inode; 1407 - 1408 - ENTER(); 1409 1434 1410 1435 dentry = d_alloc_name(sb->s_root, name); 1411 1436 if (!dentry) ··· 1438 1467 struct ffs_sb_fill_data *data = fc->fs_private; 1439 1468 struct inode *inode; 1440 1469 struct ffs_data *ffs = data->ffs_data; 1441 - 1442 - ENTER(); 1443 1470 1444 1471 ffs->sb = sb; 1445 1472 data->ffs_data = NULL; ··· 1490 1521 struct fs_parse_result result; 1491 1522 int opt; 1492 1523 1493 - ENTER(); 1494 - 1495 1524 opt = fs_parse(fc, ffs_fs_fs_parameters, param, &result); 1496 1525 if (opt < 0) 1497 1526 return opt; ··· 1538 1571 struct ffs_sb_fill_data *ctx = fc->fs_private; 1539 1572 struct ffs_data *ffs; 1540 1573 int ret; 1541 - 1542 - ENTER(); 1543 1574 1544 1575 if (!fc->source) 1545 1576 return invalf(fc, "No source specified"); ··· 1605 1640 static void 1606 1641 ffs_fs_kill_sb(struct super_block *sb) 1607 1642 { 1608 - ENTER(); 1609 - 1610 1643 kill_litter_super(sb); 1611 1644 if (sb->s_fs_info) 1612 1645 ffs_data_closed(sb->s_fs_info); ··· 1626 1663 { 1627 1664 int ret; 1628 1665 1629 - ENTER(); 1630 - 1631 1666 ret = register_filesystem(&ffs_fs_type); 1632 1667 if (!ret) 1633 1668 pr_info("file system registered\n"); ··· 1637 1676 1638 1677 static void functionfs_cleanup(void) 1639 1678 { 1640 - ENTER(); 1641 - 1642 1679 pr_info("unloading\n"); 1643 1680 unregister_filesystem(&ffs_fs_type); 1644 1681 } ··· 1649 1690 1650 1691 static void ffs_data_get(struct ffs_data *ffs) 1651 1692 { 1652 - ENTER(); 1653 - 1654 1693 refcount_inc(&ffs->ref); 1655 1694 } 1656 1695 1657 1696 static void ffs_data_opened(struct ffs_data *ffs) 1658 1697 { 1659 - ENTER(); 1660 - 1661 1698 refcount_inc(&ffs->ref); 1662 1699 if (atomic_add_return(1, &ffs->opened) == 1 && 1663 1700 ffs->state == FFS_DEACTIVATED) { ··· 1664 1709 1665 1710 static void ffs_data_put(struct ffs_data *ffs) 1666 1711 { 1667 - ENTER(); 1668 - 1669 1712 if (refcount_dec_and_test(&ffs->ref)) { 1670 1713 pr_info("%s(): freeing\n", __func__); 1671 1714 ffs_data_clear(ffs); ··· 1681 1728 { 1682 1729 struct ffs_epfile *epfiles; 1683 1730 unsigned long flags; 1684 - 1685 - ENTER(); 1686 1731 1687 1732 if (atomic_dec_and_test(&ffs->opened)) { 1688 1733 if (ffs->no_disconnect) { ··· 1716 1765 if (!ffs) 1717 1766 return NULL; 1718 1767 1719 - ENTER(); 1720 - 1721 1768 ffs->io_completion_wq = alloc_ordered_workqueue("%s", 0, dev_name); 1722 1769 if (!ffs->io_completion_wq) { 1723 1770 kfree(ffs); ··· 1741 1792 { 1742 1793 struct ffs_epfile *epfiles; 1743 1794 unsigned long flags; 1744 - 1745 - ENTER(); 1746 1795 1747 1796 ffs_closed(ffs); 1748 1797 ··· 1773 1826 1774 1827 static void ffs_data_reset(struct ffs_data *ffs) 1775 1828 { 1776 - ENTER(); 1777 - 1778 1829 ffs_data_clear(ffs); 1779 1830 1780 1831 ffs->raw_descs_data = NULL; ··· 1806 1861 struct usb_gadget_strings **lang; 1807 1862 int first_id; 1808 1863 1809 - ENTER(); 1810 - 1811 1864 if (WARN_ON(ffs->state != FFS_ACTIVE 1812 1865 || test_and_set_bit(FFS_FL_BOUND, &ffs->flags))) 1813 1866 return -EBADFD; ··· 1837 1894 1838 1895 static void functionfs_unbind(struct ffs_data *ffs) 1839 1896 { 1840 - ENTER(); 1841 - 1842 1897 if (!WARN_ON(!ffs->gadget)) { 1843 1898 /* dequeue before freeing ep0req */ 1844 1899 usb_ep_dequeue(ffs->gadget->ep0, ffs->ep0req); ··· 1854 1913 { 1855 1914 struct ffs_epfile *epfile, *epfiles; 1856 1915 unsigned i, count; 1857 - 1858 - ENTER(); 1859 1916 1860 1917 count = ffs->eps_count; 1861 1918 epfiles = kcalloc(count, sizeof(*epfiles), GFP_KERNEL); ··· 1884 1945 static void ffs_epfiles_destroy(struct ffs_epfile *epfiles, unsigned count) 1885 1946 { 1886 1947 struct ffs_epfile *epfile = epfiles; 1887 - 1888 - ENTER(); 1889 1948 1890 1949 for (; count; --count, ++epfile) { 1891 1950 BUG_ON(mutex_is_locked(&epfile->mutex)); ··· 2000 2063 struct usb_descriptor_header *_ds = (void *)data; 2001 2064 u8 length; 2002 2065 int ret; 2003 - 2004 - ENTER(); 2005 2066 2006 2067 /* At least two bytes are required: length and type */ 2007 2068 if (len < 2) { ··· 2139 2204 unsigned long num = 0; 2140 2205 int current_class = -1; 2141 2206 2142 - ENTER(); 2143 - 2144 2207 for (;;) { 2145 2208 int ret; 2146 2209 ··· 2175 2242 { 2176 2243 struct ffs_desc_helper *helper = priv; 2177 2244 struct usb_endpoint_descriptor *d; 2178 - 2179 - ENTER(); 2180 2245 2181 2246 switch (type) { 2182 2247 case FFS_DESCRIPTOR: ··· 2260 2329 int ret; 2261 2330 const unsigned _len = len; 2262 2331 2263 - ENTER(); 2264 - 2265 2332 /* loop over all ext compat/ext prop descriptors */ 2266 2333 while (feature_count--) { 2267 2334 ret = entity(type, h, data, len, priv); ··· 2280 2351 { 2281 2352 const unsigned _len = len; 2282 2353 unsigned long num = 0; 2283 - 2284 - ENTER(); 2285 2354 2286 2355 for (num = 0; num < count; ++num) { 2287 2356 int ret; ··· 2342 2415 { 2343 2416 struct ffs_data *ffs = priv; 2344 2417 u8 length; 2345 - 2346 - ENTER(); 2347 2418 2348 2419 switch (type) { 2349 2420 case FFS_OS_DESC_EXT_COMPAT: { ··· 2417 2492 unsigned os_descs_count = 0, counts[3], flags; 2418 2493 int ret = -EINVAL, i; 2419 2494 struct ffs_desc_helper helper; 2420 - 2421 - ENTER(); 2422 2495 2423 2496 if (get_unaligned_le32(data + 4) != len) 2424 2497 goto error; ··· 2547 2624 struct usb_gadget_strings **stringtabs, *t; 2548 2625 const char *data = _data; 2549 2626 struct usb_string *s; 2550 - 2551 - ENTER(); 2552 2627 2553 2628 if (len < 16 || 2554 2629 get_unaligned_le32(data) != FUNCTIONFS_STRINGS_MAGIC || ··· 3006 3085 struct ffs_data *ffs_data; 3007 3086 int ret; 3008 3087 3009 - ENTER(); 3010 - 3011 3088 /* 3012 3089 * Legacy gadget triggers binding in functionfs_ready_callback, 3013 3090 * which already uses locking; taking the same lock here would ··· 3081 3162 ffs->ms_os_descs_ext_prop_data_len); 3082 3163 vla_item_with_sz(d, char, raw_descs, ffs->raw_descs_length); 3083 3164 char *vlabuf; 3084 - 3085 - ENTER(); 3086 3165 3087 3166 /* Has descriptors only for speeds gadget does not support */ 3088 3167 if (!(full | high | super)) ··· 3285 3368 unsigned long flags; 3286 3369 int ret; 3287 3370 3288 - ENTER(); 3289 - 3290 3371 pr_vdebug("creq->bRequestType = %02x\n", creq->bRequestType); 3291 3372 pr_vdebug("creq->bRequest = %02x\n", creq->bRequest); 3292 3373 pr_vdebug("creq->wValue = %04x\n", le16_to_cpu(creq->wValue)); ··· 3359 3444 3360 3445 static void ffs_func_suspend(struct usb_function *f) 3361 3446 { 3362 - ENTER(); 3363 3447 ffs_event_add(ffs_func_from_usb(f)->ffs, FUNCTIONFS_SUSPEND); 3364 3448 } 3365 3449 3366 3450 static void ffs_func_resume(struct usb_function *f) 3367 3451 { 3368 - ENTER(); 3369 3452 ffs_event_add(ffs_func_from_usb(f)->ffs, FUNCTIONFS_RESUME); 3370 3453 } 3371 3454 ··· 3527 3614 unsigned count = ffs->eps_count; 3528 3615 unsigned long flags; 3529 3616 3530 - ENTER(); 3531 3617 if (ffs->func == func) { 3532 3618 ffs_func_eps_disable(func); 3533 3619 ffs->func = NULL; ··· 3565 3653 static struct usb_function *ffs_alloc(struct usb_function_instance *fi) 3566 3654 { 3567 3655 struct ffs_function *func; 3568 - 3569 - ENTER(); 3570 3656 3571 3657 func = kzalloc(sizeof(*func), GFP_KERNEL); 3572 3658 if (!func) ··· 3666 3756 int ret = 0; 3667 3757 struct ffs_dev *ffs_dev; 3668 3758 3669 - ENTER(); 3670 3759 ffs_dev_lock(); 3671 3760 3672 3761 ffs_dev = _ffs_find_dev(dev_name); ··· 3688 3779 3689 3780 static void ffs_release_dev(struct ffs_dev *ffs_dev) 3690 3781 { 3691 - ENTER(); 3692 3782 ffs_dev_lock(); 3693 3783 3694 3784 if (ffs_dev && ffs_dev->mounted) { ··· 3709 3801 struct ffs_dev *ffs_obj; 3710 3802 int ret = 0; 3711 3803 3712 - ENTER(); 3713 3804 ffs_dev_lock(); 3714 3805 3715 3806 ffs_obj = ffs->private_data; ··· 3741 3834 struct f_fs_opts *opts; 3742 3835 struct config_item *ci; 3743 3836 3744 - ENTER(); 3745 3837 ffs_dev_lock(); 3746 3838 3747 3839 ffs_obj = ffs->private_data;
-2
drivers/usb/gadget/function/u_fs.h
··· 32 32 # define ffs_dump_mem(prefix, ptr, len) do { } while (0) 33 33 #endif /* VERBOSE_DEBUG */ 34 34 35 - #define ENTER() pr_vdebug("%s()\n", __func__) 36 - 37 35 struct f_fs_opts; 38 36 39 37 struct ffs_dev {
-9
drivers/usb/gadget/legacy/g_ffs.c
··· 180 180 int i; 181 181 int ret = 0; 182 182 183 - ENTER(); 184 - 185 183 if (func_num < 2) { 186 184 gfs_single_func = true; 187 185 func_num = 1; ··· 239 241 static void __exit gfs_exit(void) 240 242 { 241 243 int i; 242 - 243 - ENTER(); 244 244 245 245 if (gfs_registered) 246 246 usb_composite_unregister(&gfs_driver); ··· 311 315 struct net_device *net; 312 316 #endif 313 317 int ret, i; 314 - 315 - ENTER(); 316 318 317 319 if (missing_funcs) 318 320 return -ENODEV; ··· 438 444 static int gfs_unbind(struct usb_composite_dev *cdev) 439 445 { 440 446 int i; 441 - 442 - ENTER(); 443 - 444 447 445 448 #ifdef CONFIG_USB_FUNCTIONFS_RNDIS 446 449 usb_put_function(f_rndis);