From patchwork Mon Jun 29 12:30:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 192013 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3230224ilg; Mon, 29 Jun 2020 14:12:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJxAO+WiMsTAB3W3Tp1iBzvzZEmIVO/um+3prp0F69xl1a2Cxvvd3u8u+Q301I/ps3BLPb X-Received: by 2002:aa7:cf94:: with SMTP id z20mr20135707edx.82.1593465154100; Mon, 29 Jun 2020 14:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593465154; cv=none; d=google.com; s=arc-20160816; b=CX0dGgNDxHoUaQpNe4yIVXgC1IPMgU6or0lSfJriMNvf/x3PSp72m4RSSl4490wf5Q A2B354RSfmGGkuTORCxEcMsugupI5g1ajOtA67AhumluMOFmsueaCli0iE/NZ1IUVKjW iXqT4PAl3war+ZVqimM4PixrAvZWTUa68haxR663OAPvX205K3KpThQLPo6hK+VZbIIs LbgED2HqpVdW0lx80Y3cYqRwMPJbFRoKHYni06C5iON8j6AfQ5giQ5l08pXcTxIzDB+o LfFa03eO28pYRB4ovEoSSy4iKMXUv5BpWZlbhW++Cas5HjIcs7+oWstm3s6H2fehqmED Kj1w== 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; bh=PJzVhpJJAv65Qazp2aPfqaE5/RwoX3RLz4Z8bcbSMRY=; b=On8zn/05GESC4Jm5RCmHG0K5wA1wz7vSPA/YfZj2rZlDPkUOs7A2LQla9DtjgL+S7R WFPNlFyXZsQ0LNKZ/N9Cs860hjDA9Tq5Lqzds/MAgRiUdQ7IQS6VSiFrzjfSx4PMko3y zbgCeo/STgafYP+wEozQWdzPLVnxdzPp1J1/RDYbAvxJoeOwDSlrtCMwV3bvO9wpNtwO r0Og70u614ISdTbM2SRTwkjQCouyYUTaTYp/kTKj2Qa5v6W0zgWFzFGgPibJHZB7+Pdd XuVqLNDTW8j33K4a4yvX7LWBMP3l6BpcE9xkBFzi0auDW4UJNwEZlJxweyTq5Jduc/bS VZSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pRKyjljs; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o9si481998ejr.243.2020.06.29.14.12.33; Mon, 29 Jun 2020 14:12:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pRKyjljs; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388493AbgF2VMd (ORCPT + 1 other); Mon, 29 Jun 2020 17:12:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730150AbgF2S5o (ORCPT ); Mon, 29 Jun 2020 14:57:44 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3205DC00F813 for ; Mon, 29 Jun 2020 05:30:17 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id j4so13902362wrp.10 for ; Mon, 29 Jun 2020 05:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PJzVhpJJAv65Qazp2aPfqaE5/RwoX3RLz4Z8bcbSMRY=; b=pRKyjljsaQEzYd/ZTriBGti7UFYvW3HNq59C0GxU7Os8zRMWbFWUMRj3M06J5MzDlV vIaE8Ml1b3R2geKPTQuPHi0k8gxdJWzU/+9zRgsvtmmmql0m5TZgeU4zDB0+yx/AWOAJ 0AjDk8p6eJ9DH+NvXRrUP7M2kRklGw7lArXXNQhUPumIZYQQudDavWKt0u4DFSBrRT3m pUhLKJwwToAo+RwJXhWKcWkk1OI119FZRjaPRJlZ9TC/zhhiTlHGsy8t33DnoHDR0qfk 4dXuRgRa1sUvhPZkzCVhHCY+k4jL3cExflco1rek0UXuoZA2huIC6wGPNqZKL04EAIKn wBgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PJzVhpJJAv65Qazp2aPfqaE5/RwoX3RLz4Z8bcbSMRY=; b=B59ApV0x28V4owm+RTuVo+NuVzubDtugxClC8KyHKOwtt00MquGswGGjybgk8yiwCK vt4fRtxfQOd5g5QTaZlRJKzsCEwjHHj/ZHO6npyYiWAdlb398fbbxRvcKuU5SvqI7mSM WPBlQLdZSMtwOFw2pooUvreLQCqKWUPAKNsX6RfP0D3v8AOpHwF5SMA9nlrgeiT7zNrw YcjrR6DPki6A4wRWQ9PVBaG5uwUCEoon2XJfDOko5JDX0uCrCPN/pVLy3mFEq1ww6wlO Dt1tYFFkR2kLVPfrhirjM/UhWM/7KOrS9c1Mkz7/seXGycqk2l3+0G6AiK44ktVu8NcU 2XGw== X-Gm-Message-State: AOAM532SXVu7hYbEKybbIOCZz6UEw4zGwKPztWgeVVGiC9eRGSztxx/b VL4YlOpX2YsqyJ8wAGKo/T4N9g== X-Received: by 2002:adf:8b18:: with SMTP id n24mr17862490wra.372.1593433815872; Mon, 29 Jun 2020 05:30:15 -0700 (PDT) Received: from localhost.localdomain ([2.27.35.144]) by smtp.gmail.com with ESMTPSA id g144sm32676472wme.2.2020.06.29.05.30.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 05:30:15 -0700 (PDT) From: Lee Jones To: lee.jones@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linus Walleij , Herbert Xu , "David S . Miller" , linux-crypto@vger.kernel.org Subject: [PATCH 1/1] crypto: ux500: hash: Add namespacing to hash_init() Date: Mon, 29 Jun 2020 13:30:03 +0100 Message-Id: <20200629123003.1014387-1-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org A recent change to the Regulator consumer API (which this driver utilises) add prototypes for the some suspend functions. These functions require including header file include/linux/suspend.h. The following tree of includes affecting this driver will be present: In file included from include/linux/elevator.h:6, from include/linux/blkdev.h:288, from include/linux/blk-cgroup.h:23, from include/linux/writeback.h:14, from include/linux/memcontrol.h:22, from include/linux/swap.h:9, from include/linux/suspend.h:5, from include/linux/regulator/consumer.h:35, from drivers/crypto/ux500/hash/hash_core.c:28: include/linux/elevator.h pulls in include/linux/hashtable.h which contains its own version of hash_init(). This confuses the build system and results in the following error (amongst others): drivers/crypto/ux500/hash/hash_core.c:1362:19: error: passing argument 1 of '__hash_init' from incompatible pointer type [-Werror=incompatible-pointer-types] 1362 | return hash_init(req); Fix this by namespacing the local hash_init() such that the source of confusion is removed. Cc: Linus Walleij Cc: Herbert Xu Cc: David S. Miller Cc: linux-crypto@vger.kernel.org Signed-off-by: Lee Jones --- Ideally this should go into v5.8's -rcs else it runs the risk of breaking when Linus pulls everything in for v5.9-rc1. drivers/crypto/ux500/hash/hash_core.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 2.25.1 Reviewed-by: Linus Walleij diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index c24f2db8d5e83..a5ee8c2fb4e0b 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -545,7 +545,7 @@ static bool hash_dma_valid_data(struct scatterlist *sg, int datasize) * * Initialize structures. */ -static int hash_init(struct ahash_request *req) +static int ux500_hash_init(struct ahash_request *req) { struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); struct hash_ctx *ctx = crypto_ahash_ctx(tfm); @@ -1359,7 +1359,7 @@ static int ahash_sha1_init(struct ahash_request *req) ctx->config.oper_mode = HASH_OPER_MODE_HASH; ctx->digestsize = SHA1_DIGEST_SIZE; - return hash_init(req); + return ux500_hash_init(req); } static int ahash_sha256_init(struct ahash_request *req) @@ -1372,7 +1372,7 @@ static int ahash_sha256_init(struct ahash_request *req) ctx->config.oper_mode = HASH_OPER_MODE_HASH; ctx->digestsize = SHA256_DIGEST_SIZE; - return hash_init(req); + return ux500_hash_init(req); } static int ahash_sha1_digest(struct ahash_request *req) @@ -1425,7 +1425,7 @@ static int hmac_sha1_init(struct ahash_request *req) ctx->config.oper_mode = HASH_OPER_MODE_HMAC; ctx->digestsize = SHA1_DIGEST_SIZE; - return hash_init(req); + return ux500_hash_init(req); } static int hmac_sha256_init(struct ahash_request *req) @@ -1438,7 +1438,7 @@ static int hmac_sha256_init(struct ahash_request *req) ctx->config.oper_mode = HASH_OPER_MODE_HMAC; ctx->digestsize = SHA256_DIGEST_SIZE; - return hash_init(req); + return ux500_hash_init(req); } static int hmac_sha1_digest(struct ahash_request *req) @@ -1515,7 +1515,7 @@ static struct hash_algo_template hash_algs[] = { .conf.algorithm = HASH_ALGO_SHA1, .conf.oper_mode = HASH_OPER_MODE_HASH, .hash = { - .init = hash_init, + .init = ux500_hash_init, .update = ahash_update, .final = ahash_final, .digest = ahash_sha1_digest, @@ -1538,7 +1538,7 @@ static struct hash_algo_template hash_algs[] = { .conf.algorithm = HASH_ALGO_SHA256, .conf.oper_mode = HASH_OPER_MODE_HASH, .hash = { - .init = hash_init, + .init = ux500_hash_init, .update = ahash_update, .final = ahash_final, .digest = ahash_sha256_digest, @@ -1561,7 +1561,7 @@ static struct hash_algo_template hash_algs[] = { .conf.algorithm = HASH_ALGO_SHA1, .conf.oper_mode = HASH_OPER_MODE_HMAC, .hash = { - .init = hash_init, + .init = ux500_hash_init, .update = ahash_update, .final = ahash_final, .digest = hmac_sha1_digest, @@ -1585,7 +1585,7 @@ static struct hash_algo_template hash_algs[] = { .conf.algorithm = HASH_ALGO_SHA256, .conf.oper_mode = HASH_OPER_MODE_HMAC, .hash = { - .init = hash_init, + .init = ux500_hash_init, .update = ahash_update, .final = ahash_final, .digest = hmac_sha256_digest,