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>
This commit is contained in:
Linyu Yuan 2023-03-27 18:12:15 +08:00 committed by Greg Kroah-Hartman
parent 7bf1c56a90
commit f54134b3fc
3 changed files with 0 additions and 105 deletions

View File

@ -335,8 +335,6 @@ static ssize_t ffs_ep0_write(struct file *file, const char __user *buf,
ssize_t ret; ssize_t ret;
char *data; char *data;
ENTER();
/* Fast check if setup was canceled */ /* Fast check if setup was canceled */
if (ffs_setup_state_clear_cancelled(ffs) == FFS_SETUP_CANCELLED) if (ffs_setup_state_clear_cancelled(ffs) == FFS_SETUP_CANCELLED)
return -EIDRM; return -EIDRM;
@ -512,8 +510,6 @@ static ssize_t ffs_ep0_read(struct file *file, char __user *buf,
size_t n; size_t n;
int ret; int ret;
ENTER();
/* Fast check if setup was canceled */ /* Fast check if setup was canceled */
if (ffs_setup_state_clear_cancelled(ffs) == FFS_SETUP_CANCELLED) if (ffs_setup_state_clear_cancelled(ffs) == FFS_SETUP_CANCELLED)
return -EIDRM; return -EIDRM;
@ -612,8 +608,6 @@ static int ffs_ep0_open(struct inode *inode, struct file *file)
{ {
struct ffs_data *ffs = inode->i_private; struct ffs_data *ffs = inode->i_private;
ENTER();
if (ffs->state == FFS_CLOSING) if (ffs->state == FFS_CLOSING)
return -EBUSY; return -EBUSY;
@ -627,8 +621,6 @@ static int ffs_ep0_release(struct inode *inode, struct file *file)
{ {
struct ffs_data *ffs = file->private_data; struct ffs_data *ffs = file->private_data;
ENTER();
ffs_data_closed(ffs); ffs_data_closed(ffs);
return 0; return 0;
@ -640,8 +632,6 @@ static long ffs_ep0_ioctl(struct file *file, unsigned code, unsigned long value)
struct usb_gadget *gadget = ffs->gadget; struct usb_gadget *gadget = ffs->gadget;
long ret; long ret;
ENTER();
if (code == FUNCTIONFS_INTERFACE_REVMAP) { if (code == FUNCTIONFS_INTERFACE_REVMAP) {
struct ffs_function *func = ffs->func; struct ffs_function *func = ffs->func;
ret = func ? ffs_func_revmap_intf(func, value) : -ENODEV; ret = func ? ffs_func_revmap_intf(func, value) : -ENODEV;
@ -715,7 +705,6 @@ static void ffs_epfile_io_complete(struct usb_ep *_ep, struct usb_request *req)
{ {
struct ffs_io_data *io_data = req->context; struct ffs_io_data *io_data = req->context;
ENTER();
if (req->status) if (req->status)
io_data->status = req->status; io_data->status = req->status;
else else
@ -856,8 +845,6 @@ static void ffs_epfile_async_io_complete(struct usb_ep *_ep,
struct ffs_io_data *io_data = req->context; struct ffs_io_data *io_data = req->context;
struct ffs_data *ffs = io_data->ffs; struct ffs_data *ffs = io_data->ffs;
ENTER();
io_data->status = req->status ? req->status : req->actual; io_data->status = req->status ? req->status : req->actual;
usb_ep_free_request(_ep, req); usb_ep_free_request(_ep, req);
@ -1161,8 +1148,6 @@ ffs_epfile_open(struct inode *inode, struct file *file)
{ {
struct ffs_epfile *epfile = inode->i_private; struct ffs_epfile *epfile = inode->i_private;
ENTER();
if (WARN_ON(epfile->ffs->state != FFS_ACTIVE)) if (WARN_ON(epfile->ffs->state != FFS_ACTIVE))
return -ENODEV; return -ENODEV;
@ -1179,8 +1164,6 @@ static int ffs_aio_cancel(struct kiocb *kiocb)
unsigned long flags; unsigned long flags;
int value; int value;
ENTER();
spin_lock_irqsave(&epfile->ffs->eps_lock, flags); spin_lock_irqsave(&epfile->ffs->eps_lock, flags);
if (io_data && io_data->ep && io_data->req) if (io_data && io_data->ep && io_data->req)
@ -1198,8 +1181,6 @@ static ssize_t ffs_epfile_write_iter(struct kiocb *kiocb, struct iov_iter *from)
struct ffs_io_data io_data, *p = &io_data; struct ffs_io_data io_data, *p = &io_data;
ssize_t res; ssize_t res;
ENTER();
if (!is_sync_kiocb(kiocb)) { if (!is_sync_kiocb(kiocb)) {
p = kzalloc(sizeof(io_data), GFP_KERNEL); p = kzalloc(sizeof(io_data), GFP_KERNEL);
if (!p) if (!p)
@ -1235,8 +1216,6 @@ static ssize_t ffs_epfile_read_iter(struct kiocb *kiocb, struct iov_iter *to)
struct ffs_io_data io_data, *p = &io_data; struct ffs_io_data io_data, *p = &io_data;
ssize_t res; ssize_t res;
ENTER();
if (!is_sync_kiocb(kiocb)) { if (!is_sync_kiocb(kiocb)) {
p = kzalloc(sizeof(io_data), GFP_KERNEL); p = kzalloc(sizeof(io_data), GFP_KERNEL);
if (!p) if (!p)
@ -1284,8 +1263,6 @@ ffs_epfile_release(struct inode *inode, struct file *file)
{ {
struct ffs_epfile *epfile = inode->i_private; struct ffs_epfile *epfile = inode->i_private;
ENTER();
__ffs_epfile_read_buffer_free(epfile); __ffs_epfile_read_buffer_free(epfile);
ffs_data_closed(epfile->ffs); ffs_data_closed(epfile->ffs);
@ -1299,8 +1276,6 @@ static long ffs_epfile_ioctl(struct file *file, unsigned code,
struct ffs_ep *ep; struct ffs_ep *ep;
int ret; int ret;
ENTER();
if (WARN_ON(epfile->ffs->state != FFS_ACTIVE)) if (WARN_ON(epfile->ffs->state != FFS_ACTIVE))
return -ENODEV; return -ENODEV;
@ -1399,8 +1374,6 @@ ffs_sb_make_inode(struct super_block *sb, void *data,
{ {
struct inode *inode; struct inode *inode;
ENTER();
inode = new_inode(sb); inode = new_inode(sb);
if (inode) { if (inode) {
@ -1432,8 +1405,6 @@ static struct dentry *ffs_sb_create_file(struct super_block *sb,
struct dentry *dentry; struct dentry *dentry;
struct inode *inode; struct inode *inode;
ENTER();
dentry = d_alloc_name(sb->s_root, name); dentry = d_alloc_name(sb->s_root, name);
if (!dentry) if (!dentry)
return NULL; return NULL;
@ -1468,8 +1439,6 @@ static int ffs_sb_fill(struct super_block *sb, struct fs_context *fc)
struct inode *inode; struct inode *inode;
struct ffs_data *ffs = data->ffs_data; struct ffs_data *ffs = data->ffs_data;
ENTER();
ffs->sb = sb; ffs->sb = sb;
data->ffs_data = NULL; data->ffs_data = NULL;
sb->s_fs_info = ffs; sb->s_fs_info = ffs;
@ -1521,8 +1490,6 @@ static int ffs_fs_parse_param(struct fs_context *fc, struct fs_parameter *param)
struct fs_parse_result result; struct fs_parse_result result;
int opt; int opt;
ENTER();
opt = fs_parse(fc, ffs_fs_fs_parameters, param, &result); opt = fs_parse(fc, ffs_fs_fs_parameters, param, &result);
if (opt < 0) if (opt < 0)
return opt; return opt;
@ -1572,8 +1539,6 @@ static int ffs_fs_get_tree(struct fs_context *fc)
struct ffs_data *ffs; struct ffs_data *ffs;
int ret; int ret;
ENTER();
if (!fc->source) if (!fc->source)
return invalf(fc, "No source specified"); return invalf(fc, "No source specified");
@ -1640,8 +1605,6 @@ static int ffs_fs_init_fs_context(struct fs_context *fc)
static void static void
ffs_fs_kill_sb(struct super_block *sb) ffs_fs_kill_sb(struct super_block *sb)
{ {
ENTER();
kill_litter_super(sb); kill_litter_super(sb);
if (sb->s_fs_info) if (sb->s_fs_info)
ffs_data_closed(sb->s_fs_info); ffs_data_closed(sb->s_fs_info);
@ -1663,8 +1626,6 @@ static int functionfs_init(void)
{ {
int ret; int ret;
ENTER();
ret = register_filesystem(&ffs_fs_type); ret = register_filesystem(&ffs_fs_type);
if (!ret) if (!ret)
pr_info("file system registered\n"); pr_info("file system registered\n");
@ -1676,8 +1637,6 @@ static int functionfs_init(void)
static void functionfs_cleanup(void) static void functionfs_cleanup(void)
{ {
ENTER();
pr_info("unloading\n"); pr_info("unloading\n");
unregister_filesystem(&ffs_fs_type); unregister_filesystem(&ffs_fs_type);
} }
@ -1690,15 +1649,11 @@ static void ffs_data_reset(struct ffs_data *ffs);
static void ffs_data_get(struct ffs_data *ffs) static void ffs_data_get(struct ffs_data *ffs)
{ {
ENTER();
refcount_inc(&ffs->ref); refcount_inc(&ffs->ref);
} }
static void ffs_data_opened(struct ffs_data *ffs) static void ffs_data_opened(struct ffs_data *ffs)
{ {
ENTER();
refcount_inc(&ffs->ref); refcount_inc(&ffs->ref);
if (atomic_add_return(1, &ffs->opened) == 1 && if (atomic_add_return(1, &ffs->opened) == 1 &&
ffs->state == FFS_DEACTIVATED) { ffs->state == FFS_DEACTIVATED) {
@ -1709,8 +1664,6 @@ static void ffs_data_opened(struct ffs_data *ffs)
static void ffs_data_put(struct ffs_data *ffs) static void ffs_data_put(struct ffs_data *ffs)
{ {
ENTER();
if (refcount_dec_and_test(&ffs->ref)) { if (refcount_dec_and_test(&ffs->ref)) {
pr_info("%s(): freeing\n", __func__); pr_info("%s(): freeing\n", __func__);
ffs_data_clear(ffs); ffs_data_clear(ffs);
@ -1729,8 +1682,6 @@ static void ffs_data_closed(struct ffs_data *ffs)
struct ffs_epfile *epfiles; struct ffs_epfile *epfiles;
unsigned long flags; unsigned long flags;
ENTER();
if (atomic_dec_and_test(&ffs->opened)) { if (atomic_dec_and_test(&ffs->opened)) {
if (ffs->no_disconnect) { if (ffs->no_disconnect) {
ffs->state = FFS_DEACTIVATED; ffs->state = FFS_DEACTIVATED;
@ -1765,8 +1716,6 @@ static struct ffs_data *ffs_data_new(const char *dev_name)
if (!ffs) if (!ffs)
return NULL; return NULL;
ENTER();
ffs->io_completion_wq = alloc_ordered_workqueue("%s", 0, dev_name); ffs->io_completion_wq = alloc_ordered_workqueue("%s", 0, dev_name);
if (!ffs->io_completion_wq) { if (!ffs->io_completion_wq) {
kfree(ffs); kfree(ffs);
@ -1793,8 +1742,6 @@ static void ffs_data_clear(struct ffs_data *ffs)
struct ffs_epfile *epfiles; struct ffs_epfile *epfiles;
unsigned long flags; unsigned long flags;
ENTER();
ffs_closed(ffs); ffs_closed(ffs);
BUG_ON(ffs->gadget); BUG_ON(ffs->gadget);
@ -1826,8 +1773,6 @@ static void ffs_data_clear(struct ffs_data *ffs)
static void ffs_data_reset(struct ffs_data *ffs) static void ffs_data_reset(struct ffs_data *ffs)
{ {
ENTER();
ffs_data_clear(ffs); ffs_data_clear(ffs);
ffs->raw_descs_data = NULL; ffs->raw_descs_data = NULL;
@ -1861,8 +1806,6 @@ static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev)
struct usb_gadget_strings **lang; struct usb_gadget_strings **lang;
int first_id; int first_id;
ENTER();
if (WARN_ON(ffs->state != FFS_ACTIVE if (WARN_ON(ffs->state != FFS_ACTIVE
|| test_and_set_bit(FFS_FL_BOUND, &ffs->flags))) || test_and_set_bit(FFS_FL_BOUND, &ffs->flags)))
return -EBADFD; return -EBADFD;
@ -1894,8 +1837,6 @@ static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev)
static void functionfs_unbind(struct ffs_data *ffs) static void functionfs_unbind(struct ffs_data *ffs)
{ {
ENTER();
if (!WARN_ON(!ffs->gadget)) { if (!WARN_ON(!ffs->gadget)) {
/* dequeue before freeing ep0req */ /* dequeue before freeing ep0req */
usb_ep_dequeue(ffs->gadget->ep0, ffs->ep0req); usb_ep_dequeue(ffs->gadget->ep0, ffs->ep0req);
@ -1914,8 +1855,6 @@ static int ffs_epfiles_create(struct ffs_data *ffs)
struct ffs_epfile *epfile, *epfiles; struct ffs_epfile *epfile, *epfiles;
unsigned i, count; unsigned i, count;
ENTER();
count = ffs->eps_count; count = ffs->eps_count;
epfiles = kcalloc(count, sizeof(*epfiles), GFP_KERNEL); epfiles = kcalloc(count, sizeof(*epfiles), GFP_KERNEL);
if (!epfiles) if (!epfiles)
@ -1946,8 +1885,6 @@ static void ffs_epfiles_destroy(struct ffs_epfile *epfiles, unsigned count)
{ {
struct ffs_epfile *epfile = epfiles; struct ffs_epfile *epfile = epfiles;
ENTER();
for (; count; --count, ++epfile) { for (; count; --count, ++epfile) {
BUG_ON(mutex_is_locked(&epfile->mutex)); BUG_ON(mutex_is_locked(&epfile->mutex));
if (epfile->dentry) { if (epfile->dentry) {
@ -2064,8 +2001,6 @@ static int __must_check ffs_do_single_desc(char *data, unsigned len,
u8 length; u8 length;
int ret; int ret;
ENTER();
/* At least two bytes are required: length and type */ /* At least two bytes are required: length and type */
if (len < 2) { if (len < 2) {
pr_vdebug("descriptor too short\n"); pr_vdebug("descriptor too short\n");
@ -2204,8 +2139,6 @@ static int __must_check ffs_do_descs(unsigned count, char *data, unsigned len,
unsigned long num = 0; unsigned long num = 0;
int current_class = -1; int current_class = -1;
ENTER();
for (;;) { for (;;) {
int ret; int ret;
@ -2243,8 +2176,6 @@ static int __ffs_data_do_entity(enum ffs_entity_type type,
struct ffs_desc_helper *helper = priv; struct ffs_desc_helper *helper = priv;
struct usb_endpoint_descriptor *d; struct usb_endpoint_descriptor *d;
ENTER();
switch (type) { switch (type) {
case FFS_DESCRIPTOR: case FFS_DESCRIPTOR:
break; break;
@ -2329,8 +2260,6 @@ static int __must_check ffs_do_single_os_desc(char *data, unsigned len,
int ret; int ret;
const unsigned _len = len; const unsigned _len = len;
ENTER();
/* loop over all ext compat/ext prop descriptors */ /* loop over all ext compat/ext prop descriptors */
while (feature_count--) { while (feature_count--) {
ret = entity(type, h, data, len, priv); ret = entity(type, h, data, len, priv);
@ -2352,8 +2281,6 @@ static int __must_check ffs_do_os_descs(unsigned count,
const unsigned _len = len; const unsigned _len = len;
unsigned long num = 0; unsigned long num = 0;
ENTER();
for (num = 0; num < count; ++num) { for (num = 0; num < count; ++num) {
int ret; int ret;
enum ffs_os_desc_type type; enum ffs_os_desc_type type;
@ -2416,8 +2343,6 @@ static int __ffs_data_do_os_desc(enum ffs_os_desc_type type,
struct ffs_data *ffs = priv; struct ffs_data *ffs = priv;
u8 length; u8 length;
ENTER();
switch (type) { switch (type) {
case FFS_OS_DESC_EXT_COMPAT: { case FFS_OS_DESC_EXT_COMPAT: {
struct usb_ext_compat_desc *d = data; struct usb_ext_compat_desc *d = data;
@ -2493,8 +2418,6 @@ static int __ffs_data_got_descs(struct ffs_data *ffs,
int ret = -EINVAL, i; int ret = -EINVAL, i;
struct ffs_desc_helper helper; struct ffs_desc_helper helper;
ENTER();
if (get_unaligned_le32(data + 4) != len) if (get_unaligned_le32(data + 4) != len)
goto error; goto error;
@ -2625,8 +2548,6 @@ static int __ffs_data_got_strings(struct ffs_data *ffs,
const char *data = _data; const char *data = _data;
struct usb_string *s; struct usb_string *s;
ENTER();
if (len < 16 || if (len < 16 ||
get_unaligned_le32(data) != FUNCTIONFS_STRINGS_MAGIC || get_unaligned_le32(data) != FUNCTIONFS_STRINGS_MAGIC ||
get_unaligned_le32(data + 4) != len) get_unaligned_le32(data + 4) != len)
@ -3085,8 +3006,6 @@ static inline struct f_fs_opts *ffs_do_functionfs_bind(struct usb_function *f,
struct ffs_data *ffs_data; struct ffs_data *ffs_data;
int ret; int ret;
ENTER();
/* /*
* Legacy gadget triggers binding in functionfs_ready_callback, * Legacy gadget triggers binding in functionfs_ready_callback,
* which already uses locking; taking the same lock here would * which already uses locking; taking the same lock here would
@ -3163,8 +3082,6 @@ static int _ffs_func_bind(struct usb_configuration *c,
vla_item_with_sz(d, char, raw_descs, ffs->raw_descs_length); vla_item_with_sz(d, char, raw_descs, ffs->raw_descs_length);
char *vlabuf; char *vlabuf;
ENTER();
/* Has descriptors only for speeds gadget does not support */ /* Has descriptors only for speeds gadget does not support */
if (!(full | high | super)) if (!(full | high | super))
return -ENOTSUPP; return -ENOTSUPP;
@ -3368,8 +3285,6 @@ static int ffs_func_setup(struct usb_function *f,
unsigned long flags; unsigned long flags;
int ret; int ret;
ENTER();
pr_vdebug("creq->bRequestType = %02x\n", creq->bRequestType); pr_vdebug("creq->bRequestType = %02x\n", creq->bRequestType);
pr_vdebug("creq->bRequest = %02x\n", creq->bRequest); pr_vdebug("creq->bRequest = %02x\n", creq->bRequest);
pr_vdebug("creq->wValue = %04x\n", le16_to_cpu(creq->wValue)); pr_vdebug("creq->wValue = %04x\n", le16_to_cpu(creq->wValue));
@ -3444,13 +3359,11 @@ static bool ffs_func_req_match(struct usb_function *f,
static void ffs_func_suspend(struct usb_function *f) static void ffs_func_suspend(struct usb_function *f)
{ {
ENTER();
ffs_event_add(ffs_func_from_usb(f)->ffs, FUNCTIONFS_SUSPEND); ffs_event_add(ffs_func_from_usb(f)->ffs, FUNCTIONFS_SUSPEND);
} }
static void ffs_func_resume(struct usb_function *f) static void ffs_func_resume(struct usb_function *f)
{ {
ENTER();
ffs_event_add(ffs_func_from_usb(f)->ffs, FUNCTIONFS_RESUME); ffs_event_add(ffs_func_from_usb(f)->ffs, FUNCTIONFS_RESUME);
} }
@ -3614,7 +3527,6 @@ static void ffs_func_unbind(struct usb_configuration *c,
unsigned count = ffs->eps_count; unsigned count = ffs->eps_count;
unsigned long flags; unsigned long flags;
ENTER();
if (ffs->func == func) { if (ffs->func == func) {
ffs_func_eps_disable(func); ffs_func_eps_disable(func);
ffs->func = NULL; ffs->func = NULL;
@ -3654,8 +3566,6 @@ static struct usb_function *ffs_alloc(struct usb_function_instance *fi)
{ {
struct ffs_function *func; struct ffs_function *func;
ENTER();
func = kzalloc(sizeof(*func), GFP_KERNEL); func = kzalloc(sizeof(*func), GFP_KERNEL);
if (!func) if (!func)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
@ -3756,7 +3666,6 @@ static int ffs_acquire_dev(const char *dev_name, struct ffs_data *ffs_data)
int ret = 0; int ret = 0;
struct ffs_dev *ffs_dev; struct ffs_dev *ffs_dev;
ENTER();
ffs_dev_lock(); ffs_dev_lock();
ffs_dev = _ffs_find_dev(dev_name); ffs_dev = _ffs_find_dev(dev_name);
@ -3779,7 +3688,6 @@ static int ffs_acquire_dev(const char *dev_name, struct ffs_data *ffs_data)
static void ffs_release_dev(struct ffs_dev *ffs_dev) static void ffs_release_dev(struct ffs_dev *ffs_dev)
{ {
ENTER();
ffs_dev_lock(); ffs_dev_lock();
if (ffs_dev && ffs_dev->mounted) { if (ffs_dev && ffs_dev->mounted) {
@ -3801,7 +3709,6 @@ static int ffs_ready(struct ffs_data *ffs)
struct ffs_dev *ffs_obj; struct ffs_dev *ffs_obj;
int ret = 0; int ret = 0;
ENTER();
ffs_dev_lock(); ffs_dev_lock();
ffs_obj = ffs->private_data; ffs_obj = ffs->private_data;
@ -3834,7 +3741,6 @@ static void ffs_closed(struct ffs_data *ffs)
struct f_fs_opts *opts; struct f_fs_opts *opts;
struct config_item *ci; struct config_item *ci;
ENTER();
ffs_dev_lock(); ffs_dev_lock();
ffs_obj = ffs->private_data; ffs_obj = ffs->private_data;

View File

@ -32,8 +32,6 @@
# define ffs_dump_mem(prefix, ptr, len) do { } while (0) # define ffs_dump_mem(prefix, ptr, len) do { } while (0)
#endif /* VERBOSE_DEBUG */ #endif /* VERBOSE_DEBUG */
#define ENTER() pr_vdebug("%s()\n", __func__)
struct f_fs_opts; struct f_fs_opts;
struct ffs_dev { struct ffs_dev {

View File

@ -180,8 +180,6 @@ static int __init gfs_init(void)
int i; int i;
int ret = 0; int ret = 0;
ENTER();
if (func_num < 2) { if (func_num < 2) {
gfs_single_func = true; gfs_single_func = true;
func_num = 1; func_num = 1;
@ -242,8 +240,6 @@ static void __exit gfs_exit(void)
{ {
int i; int i;
ENTER();
if (gfs_registered) if (gfs_registered)
usb_composite_unregister(&gfs_driver); usb_composite_unregister(&gfs_driver);
gfs_registered = false; gfs_registered = false;
@ -316,8 +312,6 @@ static int gfs_bind(struct usb_composite_dev *cdev)
#endif #endif
int ret, i; int ret, i;
ENTER();
if (missing_funcs) if (missing_funcs)
return -ENODEV; return -ENODEV;
#if defined CONFIG_USB_FUNCTIONFS_ETH #if defined CONFIG_USB_FUNCTIONFS_ETH
@ -445,9 +439,6 @@ static int gfs_unbind(struct usb_composite_dev *cdev)
{ {
int i; int i;
ENTER();
#ifdef CONFIG_USB_FUNCTIONFS_RNDIS #ifdef CONFIG_USB_FUNCTIONFS_RNDIS
usb_put_function(f_rndis); usb_put_function(f_rndis);
usb_put_function_instance(fi_rndis); usb_put_function_instance(fi_rndis);