search for: debugfs_name

Displaying 20 results from an estimated 31 matches for "debugfs_name".

Did you mean: debug_name
2015 May 08
4
[patch v2] virtio_console: silence a static checker warning
...x 50754d20..8283989 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1492,8 +1492,8 @@ static int add_port(struct ports_device *portdev, u32 id) * Finally, create the debugfs file that we can use to * inspect a port's state at any time */ - sprintf(debugfs_name, "vport%up%u", - port->portdev->vdev->index, id); + snprintf(debugfs_name, sizeof(debugfs_name), "vport%up%u", + port->portdev->vdev->index, id); port->debugfs_file = debugfs_create_file(debugfs_name, 0444, pdrvdata.debugfs_dir, po...
2015 May 08
4
[patch v2] virtio_console: silence a static checker warning
...x 50754d20..8283989 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1492,8 +1492,8 @@ static int add_port(struct ports_device *portdev, u32 id) * Finally, create the debugfs file that we can use to * inspect a port's state at any time */ - sprintf(debugfs_name, "vport%up%u", - port->portdev->vdev->index, id); + snprintf(debugfs_name, sizeof(debugfs_name), "vport%up%u", + port->portdev->vdev->index, id); port->debugfs_file = debugfs_create_file(debugfs_name, 0444, pdrvdata.debugfs_dir, po...
2015 May 08
2
[patch] virtio_console: use snprintf() for safety
...char/virtio_console.c b/drivers/char/virtio_console.c index 50754d20..8283989 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1389,7 +1389,7 @@ static void send_sigio_to_port(struct port *port) static int add_port(struct ports_device *portdev, u32 id) { - char debugfs_name[16]; + char debugfs_name[28]; struct port *port; struct port_buffer *buf; dev_t devt; @@ -1492,8 +1492,8 @@ static int add_port(struct ports_device *portdev, u32 id) * Finally, create the debugfs file that we can use to * inspect a port's state at any time */ - sprintf(debugf...
2015 May 08
2
[patch] virtio_console: use snprintf() for safety
...char/virtio_console.c b/drivers/char/virtio_console.c index 50754d20..8283989 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1389,7 +1389,7 @@ static void send_sigio_to_port(struct port *port) static int add_port(struct ports_device *portdev, u32 id) { - char debugfs_name[16]; + char debugfs_name[28]; struct port *port; struct port_buffer *buf; dev_t devt; @@ -1492,8 +1492,8 @@ static int add_port(struct ports_device *portdev, u32 id) * Finally, create the debugfs file that we can use to * inspect a port's state at any time */ - sprintf(debugf...
2015 May 08
1
[patch v2] virtio_console: silence a static checker warning
...a/drivers/char/virtio_console.c > +++ b/drivers/char/virtio_console.c > @@ -1492,8 +1492,8 @@ static int add_port(struct ports_device *portdev, u32 id) > * Finally, create the debugfs file that we can use to > * inspect a port's state at any time > */ > - sprintf(debugfs_name, "vport%up%u", > - port->portdev->vdev->index, id); > + snprintf(debugfs_name, sizeof(debugfs_name), "vport%up%u", > + port->portdev->vdev->index, id); would it help to use %03u (or so) to make it more obvious ? Note: i prefer a leading 0 in m...
2015 May 08
0
[patch v2] virtio_console: silence a static checker warning
....c > > +++ b/drivers/char/virtio_console.c > > @@ -1492,8 +1492,8 @@ static int add_port(struct ports_device *portdev, u32 id) > > * Finally, create the debugfs file that we can use to > > * inspect a port's state at any time > > */ > > - sprintf(debugfs_name, "vport%up%u", > > - port->portdev->vdev->index, id); > > + snprintf(debugfs_name, sizeof(debugfs_name), "vport%up%u", > > + port->portdev->vdev->index, id); > > > would it help to use %03u (or so) to make it more obvious ? &g...
2015 May 08
0
[patch v2] virtio_console: silence a static checker warning
....c > > +++ b/drivers/char/virtio_console.c > > @@ -1492,8 +1492,8 @@ static int add_port(struct ports_device *portdev, u32 id) > > * Finally, create the debugfs file that we can use to > > * inspect a port's state at any time > > */ > > - sprintf(debugfs_name, "vport%up%u", > > - port->portdev->vdev->index, id); > > + snprintf(debugfs_name, sizeof(debugfs_name), "vport%up%u", > > + port->portdev->vdev->index, id); > > > would it help to use %03u (or so) to make it more obvious ? &g...
2015 May 08
1
[patch v2] virtio_console: silence a static checker warning
...+ b/drivers/char/virtio_console.c >>> @@ -1492,8 +1492,8 @@ static int add_port(struct ports_device *portdev, u32 id) >>> * Finally, create the debugfs file that we can use to >>> * inspect a port's state at any time >>> */ >>> - sprintf(debugfs_name, "vport%up%u", >>> - port->portdev->vdev->index, id); >>> + snprintf(debugfs_name, sizeof(debugfs_name), "vport%up%u", >>> + port->portdev->vdev->index, id); >> >> >> would it help to use %03u (or so) to make i...
2015 May 08
1
[patch v2] virtio_console: silence a static checker warning
...+ b/drivers/char/virtio_console.c >>> @@ -1492,8 +1492,8 @@ static int add_port(struct ports_device *portdev, u32 id) >>> * Finally, create the debugfs file that we can use to >>> * inspect a port's state at any time >>> */ >>> - sprintf(debugfs_name, "vport%up%u", >>> - port->portdev->vdev->index, id); >>> + snprintf(debugfs_name, sizeof(debugfs_name), "vport%up%u", >>> + port->portdev->vdev->index, id); >> >> >> would it help to use %03u (or so) to make i...
2013 Jan 17
4
[PATCH] virtio_console: Use virtio device index to generate port name
...port->portdev->vdev->index, id); if (IS_ERR(port->dev)) { err = PTR_ERR(port->dev); dev_err(&port->portdev->vdev->dev, @@ -1470,7 +1464,7 @@ static int add_port(struct ports_device *portdev, u32 id) * inspect a port's state at any time */ sprintf(debugfs_name, "vport%up%u", - port->portdev->drv_index, id); + port->portdev->vdev->index, id); port->debugfs_file = debugfs_create_file(debugfs_name, 0444, pdrvdata.debugfs_dir, port, @@ -1961,16 +1955,12 @@ static int virtcons_probe(struct virtio_device *vd...
2013 Jan 17
4
[PATCH] virtio_console: Use virtio device index to generate port name
...port->portdev->vdev->index, id); if (IS_ERR(port->dev)) { err = PTR_ERR(port->dev); dev_err(&port->portdev->vdev->dev, @@ -1470,7 +1464,7 @@ static int add_port(struct ports_device *portdev, u32 id) * inspect a port's state at any time */ sprintf(debugfs_name, "vport%up%u", - port->portdev->drv_index, id); + port->portdev->vdev->index, id); port->debugfs_file = debugfs_create_file(debugfs_name, 0444, pdrvdata.debugfs_dir, port, @@ -1961,16 +1955,12 @@ static int virtcons_probe(struct virtio_device *vd...
2019 Nov 13
2
[PATCH v2] virtio_console: allocate inbufs in add_port() only if it is needed
...NOMEM; spin_lock_irq(lock); ret = add_inbuf(vq, buf); if (ret < 0) { spin_unlock_irq(lock); free_buf(buf, true); - break; + return ret; } nr_added_bufs++; spin_unlock_irq(lock); @@ -1362,7 +1362,6 @@ static int add_port(struct ports_device *portdev, u32 id) char debugfs_name[16]; struct port *port; dev_t devt; - unsigned int nr_added_bufs; int err; port = kmalloc(sizeof(*port), GFP_KERNEL); @@ -1421,11 +1420,9 @@ static int add_port(struct ports_device *portdev, u32 id) spin_lock_init(&port->outvq_lock); init_waitqueue_head(&port->waitqueue)...
2019 Nov 13
2
[PATCH v2] virtio_console: allocate inbufs in add_port() only if it is needed
...NOMEM; spin_lock_irq(lock); ret = add_inbuf(vq, buf); if (ret < 0) { spin_unlock_irq(lock); free_buf(buf, true); - break; + return ret; } nr_added_bufs++; spin_unlock_irq(lock); @@ -1362,7 +1362,6 @@ static int add_port(struct ports_device *portdev, u32 id) char debugfs_name[16]; struct port *port; dev_t devt; - unsigned int nr_added_bufs; int err; port = kmalloc(sizeof(*port), GFP_KERNEL); @@ -1421,11 +1420,9 @@ static int add_port(struct ports_device *portdev, u32 id) spin_lock_init(&port->outvq_lock); init_waitqueue_head(&port->waitqueue)...
2019 Nov 14
3
[PATCH v3] virtio_console: allocate inbufs in add_port() only if it is needed
...NOMEM; spin_lock_irq(lock); ret = add_inbuf(vq, buf); if (ret < 0) { spin_unlock_irq(lock); free_buf(buf, true); - break; + return ret; } nr_added_bufs++; spin_unlock_irq(lock); @@ -1362,7 +1362,6 @@ static int add_port(struct ports_device *portdev, u32 id) char debugfs_name[16]; struct port *port; dev_t devt; - unsigned int nr_added_bufs; int err; port = kmalloc(sizeof(*port), GFP_KERNEL); @@ -1421,11 +1420,13 @@ static int add_port(struct ports_device *portdev, u32 id) spin_lock_init(&port->outvq_lock); init_waitqueue_head(&port->waitqueue...
2019 Nov 14
3
[PATCH v3] virtio_console: allocate inbufs in add_port() only if it is needed
...NOMEM; spin_lock_irq(lock); ret = add_inbuf(vq, buf); if (ret < 0) { spin_unlock_irq(lock); free_buf(buf, true); - break; + return ret; } nr_added_bufs++; spin_unlock_irq(lock); @@ -1362,7 +1362,6 @@ static int add_port(struct ports_device *portdev, u32 id) char debugfs_name[16]; struct port *port; dev_t devt; - unsigned int nr_added_bufs; int err; port = kmalloc(sizeof(*port), GFP_KERNEL); @@ -1421,11 +1420,13 @@ static int add_port(struct ports_device *portdev, u32 id) spin_lock_init(&port->outvq_lock); init_waitqueue_head(&port->waitqueue...
2012 Feb 01
1
[PATCH 2/2] virtio-serial: setup_port_vq when adding port
...ort, at id 1. Then I add a port at id 5, then at 2, then at 10. Will that be fine? > + > +free: > + kfree(io_names); > + kfree(io_callbacks); > + kfree(vqs); > + > + return err; > +} > + > static int add_port(struct ports_device *portdev, u32 id) > { > char debugfs_name[16]; > @@ -1163,6 +1212,14 @@ static int add_port(struct ports_device *portdev, u32 id) > > port->outvq_full = false; > > + if (!portdev->in_vqs[port->id] && !portdev->out_vqs[port->id]) { > + spin_lock(&portdev->ports_lock); > + err = setu...
2012 Feb 01
1
[PATCH 2/2] virtio-serial: setup_port_vq when adding port
...ort, at id 1. Then I add a port at id 5, then at 2, then at 10. Will that be fine? > + > +free: > + kfree(io_names); > + kfree(io_callbacks); > + kfree(vqs); > + > + return err; > +} > + > static int add_port(struct ports_device *portdev, u32 id) > { > char debugfs_name[16]; > @@ -1163,6 +1212,14 @@ static int add_port(struct ports_device *portdev, u32 id) > > port->outvq_full = false; > > + if (!portdev->in_vqs[port->id] && !portdev->out_vqs[port->id]) { > + spin_lock(&portdev->ports_lock); > + err = setu...
2018 Apr 20
0
[PATCH 3/6] virtio_console: free buffers after reset
...insertions(+), 25 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 3e56f32..26a66ff 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1402,7 +1402,6 @@ static int add_port(struct ports_device *portdev, u32 id) { char debugfs_name[16]; struct port *port; - struct port_buffer *buf; dev_t devt; unsigned int nr_added_bufs; int err; @@ -1513,8 +1512,6 @@ static int add_port(struct ports_device *portdev, u32 id) return 0; free_inbufs: - while ((buf = virtqueue_detach_unused_buf(port->in_vq))) - free_buf(buf, true...
2019 Nov 13
0
[PATCH v2] virtio_console: allocate inbufs in add_port() only if it is needed
...f(vq, buf); > if (ret < 0) { > spin_unlock_irq(lock); > free_buf(buf, true); > - break; > + return ret; > } > nr_added_bufs++; > spin_unlock_irq(lock); > @@ -1362,7 +1362,6 @@ static int add_port(struct ports_device *portdev, u32 id) > char debugfs_name[16]; > struct port *port; > dev_t devt; > - unsigned int nr_added_bufs; > int err; > > port = kmalloc(sizeof(*port), GFP_KERNEL); > @@ -1421,11 +1420,9 @@ static int add_port(struct ports_device *portdev, u32 id) > spin_lock_init(&port->outvq_lock); >...
2019 Dec 03
0
[PATCH v3] virtio_console: allocate inbufs in add_port() only if it is needed
...buf); > if (ret < 0) { > spin_unlock_irq(lock); > free_buf(buf, true); > - break; > + return ret; > } > nr_added_bufs++; > spin_unlock_irq(lock); > @@ -1362,7 +1362,6 @@ static int add_port(struct ports_device > *portdev, u32 id) > char debugfs_name[16]; > struct port *port; > dev_t devt; > - unsigned int nr_added_bufs; > int err; > > port = kmalloc(sizeof(*port), GFP_KERNEL); > @@ -1421,11 +1420,13 @@ static int add_port(struct ports_device > *portdev, u32 id) > spin_lock_init(&port->outvq_lock);...