From patchwork Sat Oct 5 20:56:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 280801 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 280D92C0099 for ; Sun, 6 Oct 2013 08:03:37 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752764Ab3JEVDd (ORCPT ); Sat, 5 Oct 2013 17:03:33 -0400 Received: from mail-ye0-f182.google.com ([209.85.213.182]:33236 "EHLO mail-ye0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752536Ab3JEVDc (ORCPT ); Sat, 5 Oct 2013 17:03:32 -0400 Received: by mail-ye0-f182.google.com with SMTP id q7so591536yen.27 for ; Sat, 05 Oct 2013 14:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VSFioMHjmk93F8tqLkiUbDavgYesn88oQykYLVchsLM=; b=tDYeBfVhlqY34q/BlU82bxLJeQXsH8Fp+9U7SJAI12TMl6uTDX7y7bOn6+IdfPFzp6 mDq3R4UWVvLGSstXcZoaUtEkgyCLNYovEdhCZyDZTG2VVDrZt8jmmxpAxCTN49yM3zZ3 ORfheANlkfmJcS+U2u4bJSOCuH4+kC6pP1zazN6obt/qGzhitq71GIGg9As4VDtPdDUF A+fqXiCb/EWXC7pRVmUfcXucHulizSd0fqZwp+4aKQ5vXQGcBaZmPgioNXCkU1fUhw03 ndFysOxEVhD1+vDO0YpGXH0SgCTFaJJi6eiJSNbybdYrCmNrgx0CdhR/gn6RqBAWOZdC w+Jw== X-Received: by 10.236.81.237 with SMTP id m73mr17301346yhe.29.1381006632952; Sat, 05 Oct 2013 13:57:12 -0700 (PDT) Received: from localhost.localdomain ([186.207.93.139]) by mx.google.com with ESMTPSA id 9sm30218016yhd.19.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 05 Oct 2013 13:57:12 -0700 (PDT) From: Fabio Estevam To: davem@davemloft.net Cc: edumazet@google.com, hannes@stressinduktion.org, netdev@vger.kernel.org, olof@lixom.net, Fabio Estevam Subject: [PATCH v2] net: secure_seq: Fix warning when CONFIG_IPV6 and CONFIG_INET are not selected Date: Sat, 5 Oct 2013 17:56:59 -0300 Message-Id: <1381006619-17126-2-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1381006619-17126-1-git-send-email-festevam@gmail.com> References: <1381006619-17126-1-git-send-email-festevam@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Fabio Estevam net_secret() is only used when CONFIG_IPV6 or CONFIG_INET are selected. Building a defconfig with both of these symbols unselected (Using the ARM at91sam9rl_defconfig, for example) leads to the following build warning: $ make at91sam9rl_defconfig # # configuration written to .config # $ make net/core/secure_seq.o scripts/kconfig/conf --silentoldconfig Kconfig CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h make[1]: `include/generated/mach-types.h' is up to date. CALL scripts/checksyscalls.sh CC net/core/secure_seq.o net/core/secure_seq.c:17:13: warning: 'net_secret_init' defined but not used [-Wunused-function] Fix this warning by protecting the definition of net_secret() with these symbols. Reported-by: Olof Johansson Signed-off-by: Fabio Estevam --- Changes since v1: - Add #if IS_ENABLED(CONFIG_IPV6) || IS_ENABLED(CONFIG_INET) net/core/secure_seq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/core/secure_seq.c b/net/core/secure_seq.c index 3f1ec15..8d9d05e 100644 --- a/net/core/secure_seq.c +++ b/net/core/secure_seq.c @@ -10,6 +10,7 @@ #include +#if IS_ENABLED(CONFIG_IPV6) || IS_ENABLED(CONFIG_INET) #define NET_SECRET_SIZE (MD5_MESSAGE_BYTES / 4) static u32 net_secret[NET_SECRET_SIZE] ____cacheline_aligned; @@ -29,6 +30,7 @@ static void net_secret_init(void) cmpxchg(&net_secret[--i], 0, tmp); } } +#endif #ifdef CONFIG_INET static u32 seq_scale(u32 seq)