Replace all explicit function names in string literals with __func__ and
silent several checkpatch complaints similar to the following one:
WARNING: Prefer using '"%s...", __func__' to using 'vhci_start', this function's name, in a string
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/usb/usbip/vhci_hcd.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
index 841902482fb15d1d86525f23492e4966f35630a0..95034440c84f931bdf47552b499e0fdc6f726e59 100644
--- a/drivers/usb/usbip/vhci_hcd.c
+++ b/drivers/usb/usbip/vhci_hcd.c
@@ -160,7 +160,7 @@ void rh_port_connect(struct vhci_device *vdev, enum usb_device_speed speed)
u32 status;
unsigned long flags;
- usbip_dbg_vhci_rh("rh_port_connect %d\n", rhport);
+ usbip_dbg_vhci_rh("%s %d\n", __func__, rhport);
spin_lock_irqsave(&vhci->lock, flags);
@@ -194,7 +194,7 @@ static void rh_port_disconnect(struct vhci_device *vdev)
u32 status;
unsigned long flags;
- usbip_dbg_vhci_rh("rh_port_disconnect %d\n", rhport);
+ usbip_dbg_vhci_rh("%s %d\n", __func__, rhport);
spin_lock_irqsave(&vhci->lock, flags);
@@ -1172,7 +1172,7 @@ static int vhci_start(struct usb_hcd *hcd)
int id, rhport;
int err;
- usbip_dbg_vhci_hc("enter vhci_start\n");
+ usbip_dbg_vhci_hc("enter %s\n", __func__);
if (usb_hcd_is_primary_hcd(hcd))
spin_lock_init(&vhci_hcd->vhci->lock);
@@ -1299,7 +1299,7 @@ static int vhci_alloc_streams(struct usb_hcd *hcd, struct usb_device *udev,
struct usb_host_endpoint **eps, unsigned int num_eps,
unsigned int num_streams, gfp_t mem_flags)
{
- dev_dbg(&hcd->self.root_hub->dev, "vhci_alloc_streams not implemented\n");
+ dev_dbg(&hcd->self.root_hub->dev, "%s not implemented\n", __func__);
return 0;
}
@@ -1308,7 +1308,7 @@ static int vhci_free_streams(struct usb_hcd *hcd, struct usb_device *udev,
struct usb_host_endpoint **eps, unsigned int num_eps,
gfp_t mem_flags)
{
- dev_dbg(&hcd->self.root_hub->dev, "vhci_free_streams not implemented\n");
+ dev_dbg(&hcd->self.root_hub->dev, "%s not implemented\n", __func__);
return 0;
}
--
2.50.0
On Thu, Jul 17, 2025 at 06:54:57PM +0300, Cristian Ciocaltea wrote:
> Replace all explicit function names in string literals with __func__ and
> silent several checkpatch complaints similar to the following one:
>
> WARNING: Prefer using '"%s...", __func__' to using 'vhci_start', this function's name, in a string
>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
> drivers/usb/usbip/vhci_hcd.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
> index 841902482fb15d1d86525f23492e4966f35630a0..95034440c84f931bdf47552b499e0fdc6f726e59 100644
> --- a/drivers/usb/usbip/vhci_hcd.c
> +++ b/drivers/usb/usbip/vhci_hcd.c
> @@ -160,7 +160,7 @@ void rh_port_connect(struct vhci_device *vdev, enum usb_device_speed speed)
> u32 status;
> unsigned long flags;
>
> - usbip_dbg_vhci_rh("rh_port_connect %d\n", rhport);
> + usbip_dbg_vhci_rh("%s %d\n", __func__, rhport);
So now you have __func__ twice in the log (hint, pr_debug() provides you
the function name.)
For "trace" debugging lines like this, just remove them, ftrace is
better to use instead.
>
> spin_lock_irqsave(&vhci->lock, flags);
>
> @@ -194,7 +194,7 @@ static void rh_port_disconnect(struct vhci_device *vdev)
> u32 status;
> unsigned long flags;
>
> - usbip_dbg_vhci_rh("rh_port_disconnect %d\n", rhport);
> + usbip_dbg_vhci_rh("%s %d\n", __func__, rhport);
Can be removed.
>
> spin_lock_irqsave(&vhci->lock, flags);
>
> @@ -1172,7 +1172,7 @@ static int vhci_start(struct usb_hcd *hcd)
> int id, rhport;
> int err;
>
> - usbip_dbg_vhci_hc("enter vhci_start\n");
> + usbip_dbg_vhci_hc("enter %s\n", __func__);
Also removed.
>
> if (usb_hcd_is_primary_hcd(hcd))
> spin_lock_init(&vhci_hcd->vhci->lock);
> @@ -1299,7 +1299,7 @@ static int vhci_alloc_streams(struct usb_hcd *hcd, struct usb_device *udev,
> struct usb_host_endpoint **eps, unsigned int num_eps,
> unsigned int num_streams, gfp_t mem_flags)
> {
> - dev_dbg(&hcd->self.root_hub->dev, "vhci_alloc_streams not implemented\n");
> + dev_dbg(&hcd->self.root_hub->dev, "%s not implemented\n", __func__);
Just drop __func__ as it's now duplicated.
> return 0;
> }
>
> @@ -1308,7 +1308,7 @@ static int vhci_free_streams(struct usb_hcd *hcd, struct usb_device *udev,
> struct usb_host_endpoint **eps, unsigned int num_eps,
> gfp_t mem_flags)
> {
> - dev_dbg(&hcd->self.root_hub->dev, "vhci_free_streams not implemented\n");
> + dev_dbg(&hcd->self.root_hub->dev, "%s not implemented\n", __func__);
Same here.
thanks,
greg k-h
On 7/17/25 7:18 PM, Greg Kroah-Hartman wrote:
> On Thu, Jul 17, 2025 at 06:54:57PM +0300, Cristian Ciocaltea wrote:
>> Replace all explicit function names in string literals with __func__ and
>> silent several checkpatch complaints similar to the following one:
>>
>> WARNING: Prefer using '"%s...", __func__' to using 'vhci_start', this function's name, in a string
>>
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>> ---
>> drivers/usb/usbip/vhci_hcd.c | 10 +++++-----
>> 1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
>> index 841902482fb15d1d86525f23492e4966f35630a0..95034440c84f931bdf47552b499e0fdc6f726e59 100644
>> --- a/drivers/usb/usbip/vhci_hcd.c
>> +++ b/drivers/usb/usbip/vhci_hcd.c
>> @@ -160,7 +160,7 @@ void rh_port_connect(struct vhci_device *vdev, enum usb_device_speed speed)
>> u32 status;
>> unsigned long flags;
>>
>> - usbip_dbg_vhci_rh("rh_port_connect %d\n", rhport);
>> + usbip_dbg_vhci_rh("%s %d\n", __func__, rhport);
>
> So now you have __func__ twice in the log (hint, pr_debug() provides you
> the function name.)
>
> For "trace" debugging lines like this, just remove them, ftrace is
> better to use instead.
I should probably fix the whole logging stuff as part of the pr_*() -> dev_*()
conversion.
Thanks,
Cristian
© 2016 - 2026 Red Hat, Inc.