From patchwork Tue Jul 23 11:43:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169523 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8769138ilk; Tue, 23 Jul 2019 04:44:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaqFXV+S9AhnA5Okc7ziXatIZ4xxtwRDIkGzluKIHNxGZvoR4pwScRuuM6kZvhXRMnXibP X-Received: by 2002:a65:4b8b:: with SMTP id t11mr75859804pgq.130.1563882270659; Tue, 23 Jul 2019 04:44:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563882270; cv=none; d=google.com; s=arc-20160816; b=xId44JtEjDh5DVDbL/FA9HmIrw2nxrR2z4673puCblwXiTwbviNOZsgM2HuR3L0AQo SripgAK2Biga4MMdA+BUSkbVsfNb2AzolMXYgYRuTw/Ytqp2LHX9zMTdWzN968Yztc2G RQslIn2B5krM9OU26D6NTzFGWnlmIqlG6NRUZrovfvN1l0Uzxkddo5NDM+l/GvihQjaS /OGFoK1QH04PGELLC7Oz+keFM7VH4cKwYGpCyOIC9+lMMrdcj5VA3wyZLZUUopGqIuXz T4pZ7Pkobp10bR39XXi2Y1sslAYYcm3YoSZ0n38l6AqISJwDZY37KKuefEv6g+qHsMB4 XaUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=u6S/fgiuE+3dTn82HkRiRqcnW+Gorb07kShUnm4uj7Y=; b=Hy4F/vfG13k61ghUIKAL8bwkVfB/8jt/LPzcdlb9o9OJktQXZYqbmAaLmEoyg2pecJ OztuMOApBiKrJJFcM+8o0fQ03wlyt0mDJrSlvkfuhA3W+FAlbIHjaiezlK2PVt/R13NF Dma2VJAaHgUB/bfAow1pKVkrA/Etpb0WQbrZcR4fdj0t2vkA9il56GPUZi39tZI7USk8 ap8DQvWaCa+sJ58omB9gX5f9Hhe91qU+XRIKWb4B1PYMsBQgxn2vjg+jakvW6tknvaxv wYVZFogdG85VEXCyu+pCpP2rH+WW/FOpt9FfX1bvKYfzp+VVsQIKoTrXVyaMVotq3lsv 3T5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=wqrcayfx; 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 a88si10854085pje.6.2019.07.23.04.44.30; Tue, 23 Jul 2019 04:44:30 -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=wqrcayfx; 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 S1731226AbfGWLo2 (ORCPT + 29 others); Tue, 23 Jul 2019 07:44:28 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:28963 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726575AbfGWLo2 (ORCPT ); Tue, 23 Jul 2019 07:44:28 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id x6NBhmf0024789; Tue, 23 Jul 2019 20:43:50 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x6NBhmf0024789 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563882231; bh=u6S/fgiuE+3dTn82HkRiRqcnW+Gorb07kShUnm4uj7Y=; h=From:To:Cc:Subject:Date:From; b=wqrcayfxFNlDjAC9RpZEL2PesO7h9y4nrwAe2czjUnSuiZ2zeu6Q8D1HrMinDwoUB lGDwc0fiZicMX83K79xv4/L+NM+S3ZVjiRxnqJtddqqv00941jhO0h7uggos3hdX04 wBYl2LC+JytfzxmJoSfK8lfkK10l9UYTV5lz86DAP24AgS3X7LwvibFqpwAhzmjVxm n0fwzRviw/a7RSkHTlCJj098Y9sy5WL4+93PEHwER86qeGULD+rQNYQfBjIuhibU1T qDKk4fMTDp2fQa0cteHMDEUIyqJdcytDMgWj/rnY3PsEgn25IGLUOCB0X22hukOrWv 4kv6O/EJm61bA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Herbert Xu , linux-crypto@vger.kernel.org Cc: Masahiro Yamada , Corentin Labbe , "David S. Miller" , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] crypto: add header include guards Date: Tue, 23 Jul 2019 20:43:43 +0900 Message-Id: <20190723114344.18622-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add header include guards in case they are included multiple times. Signed-off-by: Masahiro Yamada --- Changes in v2: None include/crypto/sha1_base.h | 5 +++++ include/crypto/sha256_base.h | 5 +++++ include/crypto/sha512_base.h | 5 +++++ include/crypto/sm3_base.h | 5 +++++ include/uapi/linux/cryptouser.h | 5 +++++ 5 files changed, 25 insertions(+) -- 2.17.1 diff --git a/include/crypto/sha1_base.h b/include/crypto/sha1_base.h index 63c14f2dc7bd..20fd1f7468af 100644 --- a/include/crypto/sha1_base.h +++ b/include/crypto/sha1_base.h @@ -5,6 +5,9 @@ * Copyright (C) 2015 Linaro Ltd */ +#ifndef _CRYPTO_SHA1_BASE_H +#define _CRYPTO_SHA1_BASE_H + #include #include #include @@ -101,3 +104,5 @@ static inline int sha1_base_finish(struct shash_desc *desc, u8 *out) *sctx = (struct sha1_state){}; return 0; } + +#endif /* _CRYPTO_SHA1_BASE_H */ diff --git a/include/crypto/sha256_base.h b/include/crypto/sha256_base.h index 59159bc944f5..b50a035a2bc7 100644 --- a/include/crypto/sha256_base.h +++ b/include/crypto/sha256_base.h @@ -5,6 +5,9 @@ * Copyright (C) 2015 Linaro Ltd */ +#ifndef _CRYPTO_SHA256_BASE_H +#define _CRYPTO_SHA256_BASE_H + #include #include #include @@ -123,3 +126,5 @@ static inline int sha256_base_finish(struct shash_desc *desc, u8 *out) *sctx = (struct sha256_state){}; return 0; } + +#endif /* _CRYPTO_SHA256_BASE_H */ diff --git a/include/crypto/sha512_base.h b/include/crypto/sha512_base.h index 099be8027f3f..fb19c77494dc 100644 --- a/include/crypto/sha512_base.h +++ b/include/crypto/sha512_base.h @@ -5,6 +5,9 @@ * Copyright (C) 2015 Linaro Ltd */ +#ifndef _CRYPTO_SHA512_BASE_H +#define _CRYPTO_SHA512_BASE_H + #include #include #include @@ -126,3 +129,5 @@ static inline int sha512_base_finish(struct shash_desc *desc, u8 *out) *sctx = (struct sha512_state){}; return 0; } + +#endif /* _CRYPTO_SHA512_BASE_H */ diff --git a/include/crypto/sm3_base.h b/include/crypto/sm3_base.h index 31891b0dc7e3..1cbf9aa1fe52 100644 --- a/include/crypto/sm3_base.h +++ b/include/crypto/sm3_base.h @@ -6,6 +6,9 @@ * Written by Gilad Ben-Yossef */ +#ifndef _CRYPTO_SM3_BASE_H +#define _CRYPTO_SM3_BASE_H + #include #include #include @@ -104,3 +107,5 @@ static inline int sm3_base_finish(struct shash_desc *desc, u8 *out) *sctx = (struct sm3_state){}; return 0; } + +#endif /* _CRYPTO_SM3_BASE_H */ diff --git a/include/uapi/linux/cryptouser.h b/include/uapi/linux/cryptouser.h index 4dc1603919ce..5730c67f0617 100644 --- a/include/uapi/linux/cryptouser.h +++ b/include/uapi/linux/cryptouser.h @@ -19,6 +19,9 @@ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. */ +#ifndef _UAPI_LINUX_CRYPTOUSER_H +#define _UAPI_LINUX_CRYPTOUSER_H + #include /* Netlink configuration messages. */ @@ -198,3 +201,5 @@ struct crypto_report_acomp { #define CRYPTO_REPORT_MAXSIZE (sizeof(struct crypto_user_alg) + \ sizeof(struct crypto_report_blkcipher)) + +#endif /* _UAPI_LINUX_CRYPTOUSER_H */ From patchwork Tue Jul 23 11:43:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169524 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8769281ilk; Tue, 23 Jul 2019 04:44:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeQgDJTx65m9wST3oEQVmnJUxRinn9Sl1anCxVTPiqcZxb66xUj3vi/yfR8m6tq/wF/vYS X-Received: by 2002:a17:90a:22c6:: with SMTP id s64mr83292986pjc.5.1563882278992; Tue, 23 Jul 2019 04:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563882278; cv=none; d=google.com; s=arc-20160816; b=SmfQuE0qIKfo5DEGZhGJ3VCmI3FzcNWJmG9jayu0Baf25ke47Lx0FuNHSDtk/Z3+3R +DjvD6JtjCN7YgiD8wwJQDvQnveYJEV4SjVlVBXxy3upz6FcqimfD2LT8Y/zkA+b5raV FuV+QMmjxSRYWGW7t73wXBR551TsMMq6BF+woB5e7MNhmHBxTd4+ZfmE6oM/Z3zhHOO4 souu8YB7vbjOvSoBEcmAUcXIaQ1FthXs8MRzXVbEldDdAiCpm1D7356rTBHgPPSC+pFu A+8xVisenJWW+lccAVD1+76pIJziBu2sT8OWoP60YSBF1k0JQP2wiOw/SdlFOzKr99o6 JsEQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=/7ci0CmFiZ2Zly0qnNZqD07u1JBMYaF6owEbf8vU7TA=; b=zH9u/3vNb8fcmA4ikW4rgEtU/T5sLGd5cFl2w9VbEuqgz9A6BofinEDjtZhLPGyk+F Gsd6XefUazVaOo1pDhRX0468J5tAJgdZkWelHZ6YjMRA9O2yvM9dXkpyb6o5yt/LSPsJ gEUhJCMIjHNprkzkPj19WqlaymAuTgs1uTKkUBavmJuj/g0zM22mBWiMbFOjCINEOPmu DU2s2sfnzQ+MDcP6ieq2azXojfIAr+J2TFjWr8FOaYjr4C6JKgMMfG+oSyeSAAlFLXy5 zeVuaVM8nxR6iAzwhAXxFjrPPfueOqS/6CjUzRSXK+JVSw67W8Ft1WvTiPGsj8RdYg8Z 0ZXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=b2DOuElC; 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 j1si12673618pgb.482.2019.07.23.04.44.38; Tue, 23 Jul 2019 04:44:38 -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=b2DOuElC; 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 S1731781AbfGWLoh (ORCPT + 29 others); Tue, 23 Jul 2019 07:44:37 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:29192 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726575AbfGWLog (ORCPT ); Tue, 23 Jul 2019 07:44:36 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id x6NBhmf1024789; Tue, 23 Jul 2019 20:43:51 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x6NBhmf1024789 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563882231; bh=/7ci0CmFiZ2Zly0qnNZqD07u1JBMYaF6owEbf8vU7TA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b2DOuElCsPHOagjvbeZmh2LRLoT3tawDTBQDXgJFZpmBkikK127EUVUMtjhg91NrB YyaOUgT3PgqAAUZtbK9XJ5cB0azV9IyAHBsDAmmHHPvhbjHbiuFewVg/Qh6DerorCj yBCnqj6k7fhsvnutfaeqwlC6zkJx4RBIqm2eBn7zQcFzAsVqiiF88mHva6GRmOAMlX rzMSC/Nxs4+McYDHO3aPRqlRy6a0xdJ/dpphs8UoJxVC+wxv8gLe3zJNWEym3UyNNK lNH/NJseLvRkM41g3AjOPG+Dfq/ldPxKqpKFohW0FDw5LciPbc0/RMom0LfPUWLv/A udvBhwknq/glA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Herbert Xu , linux-crypto@vger.kernel.org Cc: Masahiro Yamada , Corentin Labbe , "David S. Miller" , Eric Biggers , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] crypto: user - fix potential warnings in cryptouser.h Date: Tue, 23 Jul 2019 20:43:44 +0900 Message-Id: <20190723114344.18622-2-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190723114344.18622-1-yamada.masahiro@socionext.com> References: <20190723114344.18622-1-yamada.masahiro@socionext.com> 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' is not declared in this header. I included instead of adding the forward declaration as suggested [1]. Detected by compile-testing this header 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) ^~~~~~~~~~~~~~~~~ [1] https://lkml.org/lkml/2019/6/13/1121 Signed-off-by: Masahiro Yamada --- Changes in v2: - include 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..d98d9b5c1e32 100644 --- a/include/crypto/internal/cryptouser.h +++ b/include/crypto/internal/cryptouser.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0 */ +#include #include extern struct sock *crypto_nlsk; @@ -8,7 +9,9 @@ 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; }