lkml.org 
[lkml]   [2015]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] af_unix: introduce unix_sk_const helper
From
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 06 Oct 2015 22:52:46 +0200

> Commit 124613012db1 ("af_unix: Convert the unix_sk macro to an inline
> function for type safety") was recently added to catch incorrect
> uses of the unix_sk helper using compiler warnings.
>
> It has now caught one such case in lsm_audit.c. The code is technically
> correct, but as it converts a const pointer to a non-const pointer,
> the annotation got lost, which gcc now warns about.
>
> This patch avoids the warning by introducing an additional helper
> that has const input and output, which makes the lsm_audit code build
> cleanly again.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> I'm not entirely happy with this workaround myself, but could not come
> up with a better one.

You can make the argument unconditionally const, as Paul Moore has done
in a separate patch submission.


\
 
 \ /
  Last update: 2015-10-08 13:01    [W:0.037 / U:7.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site