From patchwork Mon Sep 26 21:45:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 12989440 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBABFC6FA82 for ; Mon, 26 Sep 2022 21:45:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229737AbiIZVp4 (ORCPT ); Mon, 26 Sep 2022 17:45:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbiIZVpx (ORCPT ); Mon, 26 Sep 2022 17:45:53 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25647A1D3D; Mon, 26 Sep 2022 14:45:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 8BDB9CE13BB; Mon, 26 Sep 2022 21:45:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C883C433D6; Mon, 26 Sep 2022 21:45:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664228749; bh=CjBZnKnRvKVBkZH0ayQHLmeuzpZ0FS7tRJi2S9thecw=; h=Date:From:To:Cc:Subject:From; b=D/7/+gsOiT5VOoffv1GhrbJ7HbkA17xUM2kxSJnXb1lEuFbqh+dM17LX+PNbkYLQK 7+uPXMdl+E18Zq4WDFW0U0S+mAvzZcKhbgN1xwE3dDuTQC2WSnBG85mUQhC1dezQBI BwRAxYGkSjcTqZ+6fPaNl0rxtxV0NBoqcZDCLIJYHhh5h9oFszjiTzgkct/2UryKqQ Y0MbGJBLaROEDqiH6PfYt0IX8ZzH48NkXwCOpabGMHKI/fNqpr3I0OFibH2v3nIpIm +HUFbnavzMNlnmqnN1dejk7Um3mWvgD0/Jul9qQjicl1AadckZtiSUP/6+jVgqhaJl KYqKTnbt4OWTQ== Date: Mon, 26 Sep 2022 16:45:45 -0500 From: "Gustavo A. R. Silva" To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org Subject: [PATCH][next] crypto: talitos - Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members in unions. Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/216 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook --- drivers/crypto/talitos.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/talitos.h b/drivers/crypto/talitos.h index 32825119e880..1a93ee355929 100644 --- a/drivers/crypto/talitos.h +++ b/drivers/crypto/talitos.h @@ -65,8 +65,8 @@ struct talitos_edesc { dma_addr_t dma_link_tbl; struct talitos_desc desc; union { - struct talitos_ptr link_tbl[0]; - u8 buf[0]; + DECLARE_FLEX_ARRAY(struct talitos_ptr, link_tbl); + DECLARE_FLEX_ARRAY(u8, buf); }; };