lkml.org 
[lkml]   [2020]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 18/27] afs: Detect cell aliases 1 - Cells with root volumes
On Fri, May 29, 2020 at 11:02:15PM +0100, David Howells wrote:
> +static struct afs_volume *afs_sample_volume(struct afs_cell *cell, struct key *key,
> + const char *name, unsigned int namelen)
> +{
> + struct afs_volume *volume;
> + struct afs_fs_context fc = {
> + .type = 0, /* Explicitly leave it to the VLDB */
> + .volnamesz = namelen,
> + .volname = name,
> + .net = cell->net,
> + .cell = cell,
> + .key = key, /* This might need to be something */
> + };
> +
> + volume = afs_create_volume(&fc);
> + _leave(" = %px", volume);
> + return volume;
> +}

This really doesn't seem like a justified[1] place for %px. (Even if
_leavel() is debug-only, all the rest of _leave() uses are %p.)

> + default:
> + BUG();

And nothing should add BUG() to new code[2].

-Kees

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#p-format-specifier
[2] https://www.kernel.org/doc/html/latest/process/deprecated.html#bug-and-bug-on

--
Kees Cook

\
 
 \ /
  Last update: 2020-06-06 04:00    [W:0.383 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site