From patchwork Mon Mar 22 16:46:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 406173 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3724452jai; Mon, 22 Mar 2021 09:47:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSPnnjVQhDvzXe+dwn5aOKF3h5qhICIYbKb0OIkusvSo/o/vGU3K+R0h9wrkRXoCrMmvfO X-Received: by 2002:aa7:c6d2:: with SMTP id b18mr475413eds.183.1616431675415; Mon, 22 Mar 2021 09:47:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616431675; cv=none; d=google.com; s=arc-20160816; b=BSAzfl/3bi29h1ctv+FBrIjEgwLgw/6+u9VaSG2SzuZjzUYMqSLuJcZQ1ShLgcSBgR vhJcF2ROy9FwB6gDedJrFMri02quPfLTKgQrNrneG6qMFyaOqI06BQuDaMMluWwCJJrA MkeLP/njK0aEoN2ZaXhDdniMpMLkDYdMacFv2bZjVLi4DrReKlhTPgl9qEpVRl40eauw oCy9bAIij9i5QYEnDhePUVAWT4Vhnobr3y3Bf2KKX5zreLIJRgq0LqFYPAh+FZJReN9f gHXBwZxwtVdUAUiElRgxPkvRNbOJF3p0v1Eamxyii7g2Qcr+QncOaVUX7CHwtueqs0jw xGZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ZPE6siF1ZzsaChtnbCMomfDmWOJWPPzW4iwwq20muBM=; b=n9d3tx6ASuk9Q6MZYjqAeOxYWW2aELLuyvLfGSvt9GWoNDxclUWsx9pdMpxT7k74vF 443VsEL6NhHYqf6JrRZS60DuuBfe0FTRg6Z0dlvUdR2CZx1DdY7YZCMZHvvwoosMOhBA JKNau72S06iTB2pmHd7qTEkFQYm3Xf8oOSWDLVrmQCCxczFUwfHYDboV9c+ijYU8Y8uq 6KmH18sZv0Qq5dI4LMICqqhsCQINcDZDT9ctxIWP3TcCVOzdpzo1CZudprvL4r0l9Xy1 5mIyhtVPbhJgLSGlnLrSbCzuMmgoJSQ0XYGy3Zfk56ZVR1NWBb/Ewf+uhidFnT7DfNrd U2hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="cnr/pAqv"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z21si11030041edr.51.2021.03.22.09.47.55; Mon, 22 Mar 2021 09:47:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-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=@kernel.org header.s=k20201202 header.b="cnr/pAqv"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230454AbhCVQrV (ORCPT + 1 other); Mon, 22 Mar 2021 12:47:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:36078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbhCVQql (ORCPT ); Mon, 22 Mar 2021 12:46:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8D5436157F; Mon, 22 Mar 2021 16:46:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616431601; bh=aaRmjBEwVOgZ5jrusxYFiRwZAqfg3gWemKkKVk2egp8=; h=From:To:Cc:Subject:Date:From; b=cnr/pAqvMDO2kAK5qrCLy3aHTrBnZ4UOLCqwoYRq8acPF470NUUYZ/rG+Rzag7X8x ouzwomg3hzaDDRKBh+WGYXfSGBrGT/S+pwQ/JzFX4kOHkz8vizdOLDBPLa+dUHOVUy QUhqZcu6VqgzfK45Z3GYoTQPmLf5zkmbaO3Cv+/QeiIF7m4Q2ZfDCSG11+5e5F0nbG +IMtiD6NIJAI3eILwQK7bwD5vFp7PZqObyjiCl8etbflAm+m0LaAYtY1DDx5BUpFG9 tdwqnirNOKAXDntPqDhVaqNRIxc+Io6ztHfpexHjNpsxjD4UljhE2Nh3sD+VMWaTFl RDv2h0VHBfyHQ== From: Arnd Bergmann To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Jakub Kicinski Cc: Arnd Bergmann , linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] bluetooth: fix set_ecdh_privkey() prototype Date: Mon, 22 Mar 2021 17:46:30 +0100 Message-Id: <20210322164637.941598-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Arnd Bergmann gcc-11 points out that the declaration does not match the definition: net/bluetooth/ecdh_helper.c:122:55: error: argument 2 of type ‘const u8[32]’ {aka ‘const unsigned char[32]’} with mismatched bound [-Werror=array-parameter=] 122 | int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 private_key[32]) | ~~~~~~~~~^~~~~~~~~~~~~~~ In file included from net/bluetooth/ecdh_helper.c:23: net/bluetooth/ecdh_helper.h:28:56: note: previously declared as ‘const u8 *’ {aka ‘const unsigned char *’} 28 | int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 *private_key); | ~~~~~~~~~~^~~~~~~~~~~ Change the declaration to contain the size of the array, rather than just a pointer. Signed-off-by: Arnd Bergmann --- net/bluetooth/ecdh_helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.29.2 diff --git a/net/bluetooth/ecdh_helper.h b/net/bluetooth/ecdh_helper.h index a6f8d03d4aaf..830723971cf8 100644 --- a/net/bluetooth/ecdh_helper.h +++ b/net/bluetooth/ecdh_helper.h @@ -25,6 +25,6 @@ int compute_ecdh_secret(struct crypto_kpp *tfm, const u8 pair_public_key[64], u8 secret[32]); -int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 *private_key); +int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 private_key[32]); int generate_ecdh_public_key(struct crypto_kpp *tfm, u8 public_key[64]); int generate_ecdh_keys(struct crypto_kpp *tfm, u8 public_key[64]);