Re: [PATCH] drivers: pnp: proc.c: Handle errors while attaching devices

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

 



On Sun, 25 Apr 2021 01:13:01 +0530, Anupama K Patil said:
> Changed sprintf() to the kernel-space function scnprintf() as it returns
> the actual number of bytes written.

> +	if (!bus->procdir) {
> +		scnprintf(name, 16, "%02x", bus->number);

> +	scnprintf(name, 16, "%02x", dev->number);

Why do this when you don't *use* the number of bytes written, but instead ignore
the value returned?

For bonus points:  Given the %02x format, under what conditions can it
return a value other than 2?

Attachment: pgpkBZqzk0HrL.pgp
Description: PGP signature


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux