lkml.org 
[lkml]   [2021]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] drivers: pnp: proc.c: Handle errors while attaching devices
Date
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?

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-04-24 22:38    [W:0.075 / U:4.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site