From patchwork Sun Jun 9 06:57:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 166212 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2576446ili; Sat, 8 Jun 2019 23:58:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVLNR6XaUN5wlYwupjh3osQiGGXILjeqqalsW0hYKxYHpAD+5G+GZFsUU0FMTHBJ91y/PP X-Received: by 2002:a17:902:6bcb:: with SMTP id m11mr37604860plt.318.1560063500507; Sat, 08 Jun 2019 23:58:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560063500; cv=none; d=google.com; s=arc-20160816; b=cVdAHvonyrMDtZXee+AZ5QJMXIzIg+1beO1wxjrXK8lax34QpRdy/lR1P8Z7+ewK4q dnQ1djRcbEA2Cxo6qsGDsHkPOdcQDth1sPvbn2v50NyDbH8nH7JFgcPvvF2QXsO6U+eO /KNRjRGGO+0C+yrG+UJUeUtFCkLIBApWBzuF+y/kQBZC2TgNB3ALaDXsyxVwlgeE+/29 hoxih5xjZoLygYx1nVygENmMBFcgRihqYqrk1txNbg6P15LnTHS2ek10DCLhDQqheP3d LrMFVYx/4M+4ShN/S6LpWmppTScxok5ZhDlHnFFpwZg08aPREVrfjTqkfP+C/Ar5ImCp Gb/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=aYer5eaUX0jo6zJ4FAQB9HvsSWCvDxkv4u3/G3QNkYM=; b=VuavxH7T1aaS1jSBxpFtXqXDGbBhlMRvwn2QhOG+7IWetyFPT3HLJkuy2O+s7Q9Gwc XH44mhwVBbs+Q2D7ZdXvhxrxItDHORNDozKx9jpsO/jSpImMC8G+FKQYLC1TSTasclGj oAK/eACFtXkPOyDcBsK6lWTnjysuf8XL317RBaKvbXKogocQToVSRK4r/IkHw7zbkSMg 7RNTmWRoCI+AA480Odcy0kt1S60uUkRNlFRjX5ybZcq+WGUHK+4wGxFcLDLfYY9V3jIS KtBmeHNlyryzkEC67N9xnyLQRNhajGxfiOpKM7MXgLCcrd7DK8AMZHR37R6iX9RkrIIc qhKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=NI54pJHp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i16si6895993pgh.549.2019.06.08.23.58.20; Sat, 08 Jun 2019 23:58:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=NI54pJHp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727722AbfFIG6Q (ORCPT + 30 others); Sun, 9 Jun 2019 02:58:16 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:26926 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725850AbfFIG6Q (ORCPT ); Sun, 9 Jun 2019 02:58:16 -0400 Received: from grover.flets-west.jp (softbank126125154139.bbtec.net [126.125.154.139]) (authenticated) by conuserg-12.nifty.com with ESMTP id x596vHjR016968; Sun, 9 Jun 2019 15:57:17 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x596vHjR016968 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1560063438; bh=aYer5eaUX0jo6zJ4FAQB9HvsSWCvDxkv4u3/G3QNkYM=; h=From:To:Cc:Subject:Date:From; b=NI54pJHpgRUMzU8yFtXRf4eQOB7y/n2ngkcysUp/Mtlulk+euiFeQdtST9nF0vTMc tHfzRqcO9QPGAO1bRpV01Wt/T43CDDfprus8O52e+iOoh/wtaDPD07ETQU8X43xyd3 tDXm4sqTEYec5sXKUX6iWuA7z0FNAoKaC6rXUD62S0etkMQeM20v0bm7Lsy1lIqK9c jQUhxtQl2l8rhzFy8fvFM5nClIjeEVLkdTrnlvmJh6kTfGraBDtDcuB7BOZ2kzCqSd ha41JddYgy7xprSNCOX2ZV7LuJYL7YZp2toO1wi5vrCZlDcTNY7iCAXXP4ZfS5Q0ew Xm+TQws6PDmoQ== X-Nifty-SrcIP: [126.125.154.139] From: Masahiro Yamada To: Herbert Xu , linux-crypto@vger.kernel.org Cc: Masahiro Yamada , "David S. Miller" , linux-kernel@vger.kernel.org, Eric Biggers , Corentin Labbe Subject: [PATCH] crypto: user - fix potential warnings in cryptouser.h Date: Sun, 9 Jun 2019 15:57:10 +0900 Message-Id: <20190609065710.18735-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Function definitions in headers are usually marked as 'static inline'. Since 'inline' is missing for crypto_reportstat(), if it were not referenced from a .c file that includes this header, it would produce a warning. Also, 'struct crypto_user_alg' should be forward declared so that we do not rely on the specific order of header inclusion. Detected by compile-testing cryptouser.h as a standalone unit: /include/crypto/internal/cryptouser.h:6:44: warning: ‘struct crypto_user_alg’ declared inside parameter list will not be visible outside of this definition or declaration struct crypto_alg *crypto_alg_match(struct crypto_user_alg *p, int exact); ^~~~~~~~~~~~~~~ ./include/crypto/internal/cryptouser.h:11:12: warning: ‘crypto_reportstat’ defined but not used [-Wunused-function] static int crypto_reportstat(struct sk_buff *in_skb, struct nlmsghdr *in_nlh, struct nlattr **attrs) ^~~~~~~~~~~~~~~~~ Signed-off-by: Masahiro Yamada --- include/crypto/internal/cryptouser.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/include/crypto/internal/cryptouser.h b/include/crypto/internal/cryptouser.h index 8c602b187c58..2339cb06dbf8 100644 --- a/include/crypto/internal/cryptouser.h +++ b/include/crypto/internal/cryptouser.h @@ -3,12 +3,15 @@ extern struct sock *crypto_nlsk; +struct crypto_user_alg; struct crypto_alg *crypto_alg_match(struct crypto_user_alg *p, int exact); #ifdef CONFIG_CRYPTO_STATS int crypto_reportstat(struct sk_buff *in_skb, struct nlmsghdr *in_nlh, struct nlattr **attrs); #else -static int crypto_reportstat(struct sk_buff *in_skb, struct nlmsghdr *in_nlh, struct nlattr **attrs) +static inline int crypto_reportstat(struct sk_buff *in_skb, + struct nlmsghdr *in_nlh, + struct nlattr **attrs) { return -ENOTSUPP; }