lkml.org 
[lkml]   [2019]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.19 019/100] ipvs: fix warning on unused variable
    Date
    [ Upstream commit c93a49b9769e435990c82297aa0baa31e1538790 ]

    When CONFIG_IP_VS_IPV6 is not defined, build produced this warning:

    net/netfilter/ipvs/ip_vs_ctl.c:899:6: warning: unused variable ‘ret’ [-Wunused-variable]
    int ret = 0;
    ^~~

    Fix this by moving the declaration of 'ret' in the CONFIG_IP_VS_IPV6
    section in the same function.

    While at it, drop its unneeded initialisation.

    Fixes: 098e13f5b21d ("ipvs: fix dependency on nf_defrag_ipv6")
    Reported-by: Stefano Brivio <sbrivio@redhat.com>
    Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
    Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    net/netfilter/ipvs/ip_vs_ctl.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
    index 8fd8d06454d6..2d4e048762f6 100644
    --- a/net/netfilter/ipvs/ip_vs_ctl.c
    +++ b/net/netfilter/ipvs/ip_vs_ctl.c
    @@ -896,12 +896,13 @@ ip_vs_new_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest,
    {
    struct ip_vs_dest *dest;
    unsigned int atype, i;
    - int ret = 0;

    EnterFunction(2);

    #ifdef CONFIG_IP_VS_IPV6
    if (udest->af == AF_INET6) {
    + int ret;
    +
    atype = ipv6_addr_type(&udest->addr.in6);
    if ((!(atype & IPV6_ADDR_UNICAST) ||
    atype & IPV6_ADDR_LINKLOCAL) &&
    --
    2.19.1


    \
     
     \ /
      Last update: 2019-04-30 14:02    [W:3.575 / U:0.296 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site