[libcamera-devel] [PATCH 01/14] libcamera: device_enumerator: Print media device name in error message

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Aug 19 17:07:06 CEST 2019


Hi Jacopo,

On Mon, Aug 19, 2019 at 10:57:01AM +0200, Jacopo Mondi wrote:
> On Sun, Aug 18, 2019 at 04:13:16AM +0300, Laurent Pinchart wrote:
> > The device enumerator logs an error message when a media device is
> > removed while still in use. Add the device name to the message to help
> > debugging.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> > ---
> >  src/libcamera/device_enumerator.cpp | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp
> > index 6fcbae76b64e..60c918f0e26f 100644
> > --- a/src/libcamera/device_enumerator.cpp
> > +++ b/src/libcamera/device_enumerator.cpp
> > @@ -166,7 +166,8 @@ DeviceEnumerator::~DeviceEnumerator()
> >  	for (std::shared_ptr<MediaDevice> media : devices_) {
> >  		if (media->busy())
> >  			LOG(DeviceEnumerator, Error)
> > -				<< "Removing media device while still in use";
> > +				<< "Removing media device " << media->deviceNode()
> > +				<< " while still in use";
> 
> just wondering if we want quotes around the media device name.

I tend to use quotes only when the string can be empty or can include
spaces. In this case I think they're not needed.

> Apart for this minor
> Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
> 
> >  	}
> >  }
> >

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list