From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 72D5BC4332F for ; Wed, 8 Nov 2023 14:11:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8844610E775; Wed, 8 Nov 2023 14:11:50 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0810A10E0B7; Wed, 8 Nov 2023 07:30:03 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 628F4B81590; Wed, 8 Nov 2023 07:30:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F2BDC433C8; Wed, 8 Nov 2023 07:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1699428601; bh=yo7b1LGNFyvDpF1t3rH3P/9deVIKXquQeoyvxzFhZ0M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CkhXJ7Ewr/fNRkHHqlD8wzG3L5thil15gOltKdbJxoYBn9ZW/PdFIWeOTEb95ES9h S062er0V6eQzPe82wMFHixIkfWeYoclSgNATcdBmNt9WIxjjIXNS4Q0yRmT6GAIE5+ dFXsFvg2TYOp5HHIq7IR01jIPslm/BClcHAsS+0M= Date: Wed, 8 Nov 2023 08:29:58 +0100 From: Greg KH To: =?iso-8859-1?Q?Jos=E9?= Pekkarinen Subject: Re: [PATCH] drm/amd/pm: replace 1-element arrays with flexible-array members Message-ID: <2023110835-magnolia-prune-02d0@gregkh> References: <20231108065436.13969-1-jose.pekkarinen@foxhound.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231108065436.13969-1-jose.pekkarinen@foxhound.fi> X-Mailman-Approved-At: Wed, 08 Nov 2023 14:11:48 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xinhui.Pan@amd.com, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, daniel@ffwll.ch, skhan@linuxfoundation.org, alexander.deucher@amd.com, evan.quan@amd.com, airlied@gmail.com, christian.koenig@amd.com, linux-kernel-mentees@lists.linux.dev Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Wed, Nov 08, 2023 at 08:54:35AM +0200, José Pekkarinen wrote: > The following case seems to be safe to be replaced with a flexible array > to clean up the added coccinelle warning. This patch will just do it. > > drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h:76:38-63: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) > > Signed-off-by: José Pekkarinen > --- > drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h > index c7b61222d258..1ce4087005f0 100644 > --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h > +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h > @@ -73,7 +73,7 @@ struct smu8_register_index_data_pair { > > struct smu8_ih_meta_data { > uint32_t command; > - struct smu8_register_index_data_pair register_index_value_pair[1]; > + struct smu8_register_index_data_pair register_index_value_pair[]; Did you just change this structure size without any need to change any code as well? How was this tested? thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AA25D2EF for ; Wed, 8 Nov 2023 07:30:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="CkhXJ7Ew" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F2BDC433C8; Wed, 8 Nov 2023 07:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1699428601; bh=yo7b1LGNFyvDpF1t3rH3P/9deVIKXquQeoyvxzFhZ0M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CkhXJ7Ewr/fNRkHHqlD8wzG3L5thil15gOltKdbJxoYBn9ZW/PdFIWeOTEb95ES9h S062er0V6eQzPe82wMFHixIkfWeYoclSgNATcdBmNt9WIxjjIXNS4Q0yRmT6GAIE5+ dFXsFvg2TYOp5HHIq7IR01jIPslm/BClcHAsS+0M= Date: Wed, 8 Nov 2023 08:29:58 +0100 From: Greg KH To: =?iso-8859-1?Q?Jos=E9?= Pekkarinen Cc: evan.quan@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, skhan@linuxfoundation.org, airlied@gmail.com, daniel@ffwll.ch, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linux.dev Subject: Re: [PATCH] drm/amd/pm: replace 1-element arrays with flexible-array members Message-ID: <2023110835-magnolia-prune-02d0@gregkh> References: <20231108065436.13969-1-jose.pekkarinen@foxhound.fi> Precedence: bulk X-Mailing-List: linux-kernel-mentees@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231108065436.13969-1-jose.pekkarinen@foxhound.fi> On Wed, Nov 08, 2023 at 08:54:35AM +0200, José Pekkarinen wrote: > The following case seems to be safe to be replaced with a flexible array > to clean up the added coccinelle warning. This patch will just do it. > > drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h:76:38-63: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) > > Signed-off-by: José Pekkarinen > --- > drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h > index c7b61222d258..1ce4087005f0 100644 > --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h > +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h > @@ -73,7 +73,7 @@ struct smu8_register_index_data_pair { > > struct smu8_ih_meta_data { > uint32_t command; > - struct smu8_register_index_data_pair register_index_value_pair[1]; > + struct smu8_register_index_data_pair register_index_value_pair[]; Did you just change this structure size without any need to change any code as well? How was this tested? thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 868EBC4167D for ; Wed, 8 Nov 2023 07:30:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 050F710E0B7; Wed, 8 Nov 2023 07:30:06 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0810A10E0B7; Wed, 8 Nov 2023 07:30:03 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 628F4B81590; Wed, 8 Nov 2023 07:30:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F2BDC433C8; Wed, 8 Nov 2023 07:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1699428601; bh=yo7b1LGNFyvDpF1t3rH3P/9deVIKXquQeoyvxzFhZ0M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CkhXJ7Ewr/fNRkHHqlD8wzG3L5thil15gOltKdbJxoYBn9ZW/PdFIWeOTEb95ES9h S062er0V6eQzPe82wMFHixIkfWeYoclSgNATcdBmNt9WIxjjIXNS4Q0yRmT6GAIE5+ dFXsFvg2TYOp5HHIq7IR01jIPslm/BClcHAsS+0M= Date: Wed, 8 Nov 2023 08:29:58 +0100 From: Greg KH To: =?iso-8859-1?Q?Jos=E9?= Pekkarinen Subject: Re: [PATCH] drm/amd/pm: replace 1-element arrays with flexible-array members Message-ID: <2023110835-magnolia-prune-02d0@gregkh> References: <20231108065436.13969-1-jose.pekkarinen@foxhound.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231108065436.13969-1-jose.pekkarinen@foxhound.fi> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xinhui.Pan@amd.com, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, skhan@linuxfoundation.org, alexander.deucher@amd.com, evan.quan@amd.com, christian.koenig@amd.com, linux-kernel-mentees@lists.linux.dev Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, Nov 08, 2023 at 08:54:35AM +0200, José Pekkarinen wrote: > The following case seems to be safe to be replaced with a flexible array > to clean up the added coccinelle warning. This patch will just do it. > > drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h:76:38-63: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) > > Signed-off-by: José Pekkarinen > --- > drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h > index c7b61222d258..1ce4087005f0 100644 > --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h > +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h > @@ -73,7 +73,7 @@ struct smu8_register_index_data_pair { > > struct smu8_ih_meta_data { > uint32_t command; > - struct smu8_register_index_data_pair register_index_value_pair[1]; > + struct smu8_register_index_data_pair register_index_value_pair[]; Did you just change this structure size without any need to change any code as well? How was this tested? thanks, greg k-h