Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2979346ybk; Mon, 18 May 2020 12:40:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIOiI/JpaNstxmYRtG3K3/tWzzXWO3DnH3a9ZE6/czInFYLTXwNcIkH1CJOCW7bUEr8vMO X-Received: by 2002:a17:906:c155:: with SMTP id dp21mr16905646ejc.92.1589830822991; Mon, 18 May 2020 12:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589830822; cv=none; d=google.com; s=arc-20160816; b=yn7o9ls+yq/+bBwIXoIfU70Mcmuj17PM0ZOKpH25Q3acDLQklkKDygQSparSxK2LP7 JxZV6Zz1VtVI2LsC2R/tvfnTMViQvi2JzwTpuZiDAVQNStHzmsxbKi9O0cMCp62/jGI1 EoGrLUzt1yQSIOqMAU0eu70pJBkOC92K2uTVXIORkeGrVGYPpHy0Rlk97Msoe1KrLkdG G97uFFXaUaC8z57/3SFdMESP5U+y/SX6SF6Gng4YEP7dyob3bYlgaFnpNO+Wjg00rSLM 6F1wfkn3rej6j6ughIdKP+/rgnzSJKFZ6iqKnBsStf4pC41ljinnRXeB5qJ2CYxkmrYc yQYQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fdupwyW4+UcDAJ6BrejbFfRc0iQYs5WW6bepEVV2ik4=; b=P2/TQ3DcVLvQdG8xbk4OU+S71i+ttaPdcDT9cHfp5u/oGWbuHncrB0dF8EmU3IvMpr OuiBIasdRxGq2bTa2iSNkvFEqxnksoCkbxpzD6a3JCE01Hkc1nUCysQ0UZaXYa8BPJ/k wQVHWhSWkk60mtcJGWi4GJjsbFPWkmSId4wSI6K7jabZTUKrl5v/8n6ZVkhcryBGJg+x yx7aUkxGjIce1OVhMgcagSab8mXYtiKUfRm4Vs3aehDOFxoMekcMhMAdqWMqia3dwpQM 86tuUvV6ehWui8Nytrqp6Z0tEXJcSA4GkBq+p6byMnJR76PWRpWkJJPIbF9v6i1Pks8O 4Qgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GeTV6cu+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i5si6356764edq.575.2020.05.18.12.40.00; Mon, 18 May 2020 12:40:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=default header.b=GeTV6cu+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732927AbgERSFT (ORCPT + 99 others); Mon, 18 May 2020 14:05:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:52558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732893AbgERSFI (ORCPT ); Mon, 18 May 2020 14:05:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3F8D620671; Mon, 18 May 2020 18:05:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589825107; bh=j6Q93TPyp66Zjj7q2ocE5UWkMJC5FKfVTyZa9hUgzEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GeTV6cu+BE73rdRl7w6Bc4qnVvhsZslVqXriuXdYQ70Zd1viyRTfnuCG8xv+JXdsH 2iR5CQwPnlX2pldfF6FbHnbmSlQKV1nCuPuEEa3h3WU2BFx8v0FYoOKnaPnkmqno1C ctzCpvV5zzWrwO0Sz4iCN17pJatVFXLv8JEBKquo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Torvalds Subject: [PATCH 5.6 133/194] gcc-10: avoid shadowing standard library free() in crypto Date: Mon, 18 May 2020 19:37:03 +0200 Message-Id: <20200518173542.515765508@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518173531.455604187@linuxfoundation.org> References: <20200518173531.455604187@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Torvalds commit 1a263ae60b04de959d9ce9caea4889385eefcc7b upstream. gcc-10 has started warning about conflicting types for a few new built-in functions, particularly 'free()'. This results in warnings like: crypto/xts.c:325:13: warning: conflicting types for built-in function ‘free’; expected ‘void(void *)’ [-Wbuiltin-declaration-mismatch] because the crypto layer had its local freeing functions called 'free()'. Gcc-10 is in the wrong here, since that function is marked 'static', and thus there is no chance of confusion with any standard library function namespace. But the simplest thing to do is to just use a different name here, and avoid this gcc mis-feature. [ Side note: gcc knowing about 'free()' is in itself not the mis-feature: the semantics of 'free()' are special enough that a compiler can validly do special things when seeing it. So the mis-feature here is that gcc thinks that 'free()' is some restricted name, and you can't shadow it as a local static function. Making the special 'free()' semantics be a function attribute rather than tied to the name would be the much better model ] Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- crypto/lrw.c | 4 ++-- crypto/xts.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) --- a/crypto/lrw.c +++ b/crypto/lrw.c @@ -287,7 +287,7 @@ static void exit_tfm(struct crypto_skcip crypto_free_skcipher(ctx->child); } -static void free(struct skcipher_instance *inst) +static void free_inst(struct skcipher_instance *inst) { crypto_drop_skcipher(skcipher_instance_ctx(inst)); kfree(inst); @@ -400,7 +400,7 @@ static int create(struct crypto_template inst->alg.encrypt = encrypt; inst->alg.decrypt = decrypt; - inst->free = free; + inst->free = free_inst; err = skcipher_register_instance(tmpl, inst); if (err) --- a/crypto/xts.c +++ b/crypto/xts.c @@ -322,7 +322,7 @@ static void exit_tfm(struct crypto_skcip crypto_free_cipher(ctx->tweak); } -static void free(struct skcipher_instance *inst) +static void free_inst(struct skcipher_instance *inst) { crypto_drop_skcipher(skcipher_instance_ctx(inst)); kfree(inst); @@ -434,7 +434,7 @@ static int create(struct crypto_template inst->alg.encrypt = encrypt; inst->alg.decrypt = decrypt; - inst->free = free; + inst->free = free_inst; err = skcipher_register_instance(tmpl, inst); if (err)