lkml.org 
[lkml]   [2020]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net/tls: fix const assignment warning
From
From: Arnd Bergmann <arnd@arndb.de>
Date: Wed, 8 Apr 2020 20:54:43 +0200

> Building with some experimental patches, I came across a warning
> in the tls code:
>
> include/linux/compiler.h:215:30: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
> 215 | *(volatile typeof(x) *)&(x) = (val); \
> | ^
> net/tls/tls_main.c:650:4: note: in expansion of macro 'smp_store_release'
> 650 | smp_store_release(&saved_tcpv4_prot, prot);
>
> This appears to be a legitimate warning about assigning a const pointer
> into the non-const 'saved_tcpv4_prot' global. Annotate both the ipv4 and
> ipv6 pointers 'const' to make the code internally consistent.
>
> Fixes: 5bb4c45d466c ("net/tls: Read sk_prot once when building tls proto ops")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied, thanks.

\
 
 \ /
  Last update: 2020-04-08 23:34    [W:0.037 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site