Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2906939ybk; Mon, 18 May 2020 10:49:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxdND0dewMvtgrXN5e+IHVvYUMHCy6Nos2hrv14duRJ+9C75RjKPIOVkZx42vFSbOo43PY X-Received: by 2002:a17:906:ad4:: with SMTP id z20mr16051034ejf.82.1589824179432; Mon, 18 May 2020 10:49:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589824179; cv=none; d=google.com; s=arc-20160816; b=aCUi7/yZOmNftYFUXQanXVUWK1Tjz59XnZTCNI/v540sKKZolP6c2Izi8rTCHY9/OI MGAMRmdp+OzZqCzLNeptJaGNdE6tPHfsD8MGOekzujjhlloq9WWsvoKNO3jenjxGkgNI E9sXo2D/uOHqOsiAWzF10zcavg+AImeYsnNR54+ZzvpW0eSBn3wl1mO16SrQEKP0sGlS NVZ1I8HNZhyGDQch+9VJ9LW4kMMycfItAeOa5PS9N2R1yitd7If8oFm4aiTbjpWaDaKw BhDcYgLhP3AiWldEjNNU9AB0wRkxqFj3IBvocgQAvE1IoUO8ugXz5nmJ11oZQHWIZkaK oPaw== 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=Hq5AZynZngFwGdrTgcIn2SJuQu9pWrYPDAQ44W9I8k8=; b=P1SdX3Mx5SEVk1jSLCKbC4HGv1tO3f9oGT8u2clm+yKp9SUxQ6YtO+IdtCLFC/g1py yc3LTdzk+OqEGaPmUkwwWrlfqP9qThOd9cnDXtm4ElPVJgz5OLtUij7fjKqnlQjU8PYB K6g5dJhqI2HfeQUZi1NRuLB2sY/KF9vUYVBAhafkcFw/W7WqVAAwzcsARige+vvfiJOU ZOe/7A8FM0Z/DjX2bEnMhbqNqP7XklbCMQQtW9oBDeM4DdLe3ZtNW7tVtTOEObfz4Uxr Iin1OuzVhpQWu7UrsBkHtz1OTyK2hYpCVnp3XRn2y1cpwdk8CJomMjM4POtpHJr8tbT+ B8eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DzANFc6R; 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 b18si6820338edr.76.2020.05.18.10.49.16; Mon, 18 May 2020 10:49:39 -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=DzANFc6R; 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 S1729995AbgERRps (ORCPT + 99 others); Mon, 18 May 2020 13:45:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:44748 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729941AbgERRpm (ORCPT ); Mon, 18 May 2020 13:45:42 -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 D309420674; Mon, 18 May 2020 17:45:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589823942; bh=jgKVkBAKQZxvGj6w3pk1H7Oxesk44ZI5TjFzvsiDUy8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DzANFc6RUIoRQtvUM1TML4/5o9bqJEXIApF6fflP2QtSZ04XwDSjqVK4q1VkwoBte zURNB4BQdx9czNOe4iGicnLjbSAyfZGwycltvfRmsKB2x+r7+19nJYSqpceqR+ehCU BLhn9TUDFZNnRuwypptJ4YxBhCiP/0svFNf4l1gI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Torvalds Subject: [PATCH 4.9 63/90] gcc-10: avoid shadowing standard library free() in crypto Date: Mon, 18 May 2020 19:36:41 +0200 Message-Id: <20200518173503.938419336@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518173450.930655662@linuxfoundation.org> References: <20200518173450.930655662@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 @@ -377,7 +377,7 @@ out_put_alg: return inst; } -static void free(struct crypto_instance *inst) +static void free_inst(struct crypto_instance *inst) { crypto_drop_spawn(crypto_instance_ctx(inst)); kfree(inst); @@ -386,7 +386,7 @@ static void free(struct crypto_instance static struct crypto_template crypto_tmpl = { .name = "lrw", .alloc = alloc, - .free = free, + .free = free_inst, .module = THIS_MODULE, }; --- a/crypto/xts.c +++ b/crypto/xts.c @@ -329,7 +329,7 @@ out_put_alg: return inst; } -static void free(struct crypto_instance *inst) +static void free_inst(struct crypto_instance *inst) { crypto_drop_spawn(crypto_instance_ctx(inst)); kfree(inst); @@ -338,7 +338,7 @@ static void free(struct crypto_instance static struct crypto_template crypto_tmpl = { .name = "xts", .alloc = alloc, - .free = free, + .free = free_inst, .module = THIS_MODULE, };