Commit ab27f45f authored by Wenpeng Liang's avatar Wenpeng Liang Committed by Jason Gunthorpe

RDMA/core: Print the function name by __func__ instead of an fixed string

It's better to use __func__ than a fixed string to print a function's
name.

Link: https://lore.kernel.org/r/1617783353-48249-2-git-send-email-liweihang@huawei.comSigned-off-by: default avatarWenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: default avatarWeihang Li <liweihang@huawei.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent a0354d23
...@@ -1708,8 +1708,8 @@ static ssize_t ucma_write(struct file *filp, const char __user *buf, ...@@ -1708,8 +1708,8 @@ static ssize_t ucma_write(struct file *filp, const char __user *buf,
ssize_t ret; ssize_t ret;
if (!ib_safe_file_access(filp)) { if (!ib_safe_file_access(filp)) {
pr_err_once("ucma_write: process %d (%s) changed security contexts after opening file descriptor, this is not allowed.\n", pr_err_once("%s: process %d (%s) changed security contexts after opening file descriptor, this is not allowed.\n",
task_tgid_vnr(current), current->comm); __func__, task_tgid_vnr(current), current->comm);
return -EACCES; return -EACCES;
} }
......
...@@ -305,8 +305,8 @@ int ib_umem_copy_from(void *dst, struct ib_umem *umem, size_t offset, ...@@ -305,8 +305,8 @@ int ib_umem_copy_from(void *dst, struct ib_umem *umem, size_t offset,
int ret; int ret;
if (offset > umem->length || length > umem->length - offset) { if (offset > umem->length || length > umem->length - offset) {
pr_err("ib_umem_copy_from not in range. offset: %zd umem length: %zd end: %zd\n", pr_err("%s not in range. offset: %zd umem length: %zd end: %zd\n",
offset, umem->length, end); __func__, offset, umem->length, end);
return -EINVAL; return -EINVAL;
} }
......
...@@ -688,8 +688,7 @@ static int ib_umad_reg_agent(struct ib_umad_file *file, void __user *arg, ...@@ -688,8 +688,7 @@ static int ib_umad_reg_agent(struct ib_umad_file *file, void __user *arg,
mutex_lock(&file->mutex); mutex_lock(&file->mutex);
if (!file->port->ib_dev) { if (!file->port->ib_dev) {
dev_notice(&file->port->dev, dev_notice(&file->port->dev, "%s: invalid device\n", __func__);
"ib_umad_reg_agent: invalid device\n");
ret = -EPIPE; ret = -EPIPE;
goto out; goto out;
} }
...@@ -701,7 +700,7 @@ static int ib_umad_reg_agent(struct ib_umad_file *file, void __user *arg, ...@@ -701,7 +700,7 @@ static int ib_umad_reg_agent(struct ib_umad_file *file, void __user *arg,
if (ureq.qpn != 0 && ureq.qpn != 1) { if (ureq.qpn != 0 && ureq.qpn != 1) {
dev_notice(&file->port->dev, dev_notice(&file->port->dev,
"ib_umad_reg_agent: invalid QPN %d specified\n", "%s: invalid QPN %d specified\n", __func__,
ureq.qpn); ureq.qpn);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
...@@ -711,9 +710,9 @@ static int ib_umad_reg_agent(struct ib_umad_file *file, void __user *arg, ...@@ -711,9 +710,9 @@ static int ib_umad_reg_agent(struct ib_umad_file *file, void __user *arg,
if (!__get_agent(file, agent_id)) if (!__get_agent(file, agent_id))
goto found; goto found;
dev_notice(&file->port->dev, dev_notice(&file->port->dev, "%s: Max Agents (%u) reached\n", __func__,
"ib_umad_reg_agent: Max Agents (%u) reached\n",
IB_UMAD_MAX_AGENTS); IB_UMAD_MAX_AGENTS);
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
...@@ -790,8 +789,7 @@ static int ib_umad_reg_agent2(struct ib_umad_file *file, void __user *arg) ...@@ -790,8 +789,7 @@ static int ib_umad_reg_agent2(struct ib_umad_file *file, void __user *arg)
mutex_lock(&file->mutex); mutex_lock(&file->mutex);
if (!file->port->ib_dev) { if (!file->port->ib_dev) {
dev_notice(&file->port->dev, dev_notice(&file->port->dev, "%s: invalid device\n", __func__);
"ib_umad_reg_agent2: invalid device\n");
ret = -EPIPE; ret = -EPIPE;
goto out; goto out;
} }
...@@ -802,17 +800,16 @@ static int ib_umad_reg_agent2(struct ib_umad_file *file, void __user *arg) ...@@ -802,17 +800,16 @@ static int ib_umad_reg_agent2(struct ib_umad_file *file, void __user *arg)
} }
if (ureq.qpn != 0 && ureq.qpn != 1) { if (ureq.qpn != 0 && ureq.qpn != 1) {
dev_notice(&file->port->dev, dev_notice(&file->port->dev, "%s: invalid QPN %d specified\n",
"ib_umad_reg_agent2: invalid QPN %d specified\n", __func__, ureq.qpn);
ureq.qpn);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
if (ureq.flags & ~IB_USER_MAD_REG_FLAGS_CAP) { if (ureq.flags & ~IB_USER_MAD_REG_FLAGS_CAP) {
dev_notice(&file->port->dev, dev_notice(&file->port->dev,
"ib_umad_reg_agent2 failed: invalid registration flags specified 0x%x; supported 0x%x\n", "%s failed: invalid registration flags specified 0x%x; supported 0x%x\n",
ureq.flags, IB_USER_MAD_REG_FLAGS_CAP); __func__, ureq.flags, IB_USER_MAD_REG_FLAGS_CAP);
ret = -EINVAL; ret = -EINVAL;
if (put_user((u32)IB_USER_MAD_REG_FLAGS_CAP, if (put_user((u32)IB_USER_MAD_REG_FLAGS_CAP,
...@@ -827,8 +824,7 @@ static int ib_umad_reg_agent2(struct ib_umad_file *file, void __user *arg) ...@@ -827,8 +824,7 @@ static int ib_umad_reg_agent2(struct ib_umad_file *file, void __user *arg)
if (!__get_agent(file, agent_id)) if (!__get_agent(file, agent_id))
goto found; goto found;
dev_notice(&file->port->dev, dev_notice(&file->port->dev, "%s: Max Agents (%u) reached\n", __func__,
"ib_umad_reg_agent2: Max Agents (%u) reached\n",
IB_UMAD_MAX_AGENTS); IB_UMAD_MAX_AGENTS);
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
...@@ -840,7 +836,7 @@ static int ib_umad_reg_agent2(struct ib_umad_file *file, void __user *arg) ...@@ -840,7 +836,7 @@ static int ib_umad_reg_agent2(struct ib_umad_file *file, void __user *arg)
req.mgmt_class_version = ureq.mgmt_class_version; req.mgmt_class_version = ureq.mgmt_class_version;
if (ureq.oui & 0xff000000) { if (ureq.oui & 0xff000000) {
dev_notice(&file->port->dev, dev_notice(&file->port->dev,
"ib_umad_reg_agent2 failed: oui invalid 0x%08x\n", "%s failed: oui invalid 0x%08x\n", __func__,
ureq.oui); ureq.oui);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment