Re: [PATCH] avctp: Set more descriptive name for uinput device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Pali,

On Tue, Nov 26, 2019 at 11:31 PM Pali Rohár <pali.rohar@xxxxxxxxx> wrote:
>
> ---
>  profiles/audio/avctp.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c
> index 70a3e40b2..ae53587ad 100644
> --- a/profiles/audio/avctp.c
> +++ b/profiles/audio/avctp.c
> @@ -1181,8 +1181,7 @@ static int uinput_create(char *name)
>         }
>
>         memset(&dev, 0, sizeof(dev));
> -       if (name)
> -               strncpy(dev.name, name, UINPUT_MAX_NAME_SIZE - 1);
> +       snprintf(dev.name, sizeof(dev.name), "Bluetooth Audio/Video Remote Control%s%s", name ? " " : "", name ? name : "");
>
>         dev.id.bustype = BUS_BLUETOOTH;
>         dev.id.vendor  = 0x0000;
> --
> 2.11.0

It is already setting a bustype to BUS_BLUETOOTH why do you need to
make it more specific, btw it needs to be limited to
UINPUT_MAX_NAME_SIZE. Id say if we want to make it declare the
connection type that probably something that needs to be encoded in
the bus itself, like BUS_BLUETOOTH_AVCTP, BUS_BLUETOOTH_HOG, etc.

-- 
Luiz Augusto von Dentz




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux