]> git.baikalelectronics.ru Git - kernel.git/commit
net/tls: fix const assignment warning
authorArnd Bergmann <arnd@arndb.de>
Wed, 8 Apr 2020 18:54:43 +0000 (20:54 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Apr 2020 21:34:02 +0000 (14:34 -0700)
commit61fa3d72b34e08e05bfb562e5c3bdcab06772a5b
tree8962d7abb2b2fee1b4aa8198de95f78648816b55
parentec19b5445d15ad523f6fc6e24bddaa9d3747134a
net/tls: fix const assignment warning

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: 5b556d5e7b4f ("net/tls: Read sk_prot once when building tls proto ops")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_main.c