From patchwork Tue May 7 16:27:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657461 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 AFF8EC10F1A for ; Tue, 7 May 2024 16:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=f3yeDfVVLSl/m0bWs74h/7JAfYLm8/zmpRKiqYsoxDY=; b=Y1Yv6/C8JZTfJ3 yJhfALmgjR1iIjAnB6QWIdPJY56dUaqBBGTXYuGi0tLsPWie5giuPkKIk0ODuLjgqtSWnvvlk+4dn 2igANQf53EyYRENyeNMBAw+akGBs7PzH93P87cacFxRsqATsKsxmnPN5nU1EqxAkFVDF0k3hObGpM qJhn1iZcJiZ67EokfDWjjmRT8d6h+CHcb/H2CFajuJxNEUe1FpWDXhdPcoSqYz54E5LZ3Jidk5Ptn EK+/gowgsNDfn/L1t6JHxElS/MUn+sLIgho6LMaBBGy75wNC2MBSAEnHIdaVNDZd6Y7nS1uDA8QYx /RL/upfkoYYTVTEqXA0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4NfC-0000000BxoZ-35ZN; Tue, 07 May 2024 16:27:34 +0000 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4New-0000000BxSb-0GBf for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:21 +0000 Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-43cff222427so13955371cf.3 for ; Tue, 07 May 2024 09:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099231; x=1715704031; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=XvJOy5lJ/u6e9yHF9m7H/WFxuEXKyxfgmG432+rwWPs=; b=ACft4qpOS6EKAHTW126lU12dRX43TGnDe0UD8vwm4K48yI8U/66g8e7M4JTE9mJWU2 Hjg5uO91qFWZgkfG37JAJJN6mnqEGzLAkK5b/RX5LCuk21Aea11guOSUbDBshaQSm15k 359FdXh6PGFheeQsbTHJr5yuoxjYTE0M9HV4w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099231; x=1715704031; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XvJOy5lJ/u6e9yHF9m7H/WFxuEXKyxfgmG432+rwWPs=; b=hpy/GoEjEH8c3F3+0fUWxn9iB92VvsAojysv0YYFQfbD2CZY7nUAYQysYUFWtR2K15 s1M8OHyo5Xoztxe7XPnqQZMeyt0aI3DgU6KYiVX4ifhzlXZL4pq08HeaAZbxX/zlrIEQ 3e2cXGTUvRx7514nmXQ5rL2gd/aRNyxTKF3zqO5nLKLLEO5aZYemtf5ZNNSgKZi2+89J DnaYKjefY75j6Ps73Q9bymaXioQ1/G0oIsHIZc7Csg9OIvDnE/YHt9L6uEoXuybfwfKZ uvYsG50YLV+fiZ0lWcUtjOBt8qUQRpI6vqhCVQOLHItEu9VDByBGCrQp5PpPCnZry+Oe zjGw== X-Forwarded-Encrypted: i=1; AJvYcCUpl88p5p2XQjKE2GtsHDwjzeCbCJSFb6z9CltjQzGWYknkxjyGPXS9m5wouCdDiVNmzo1oanXefs668B43Siu59A1dPQ6uvmV5mXdCJV4mnBlbymU= X-Gm-Message-State: AOJu0YxKc7ZS2cgR/4Ajy2a97YUTbjNmu8dF1YkZYTn4r/nyEP1YO8ev DJSO87TfJDNKTbPoltCISsFZq8q7FPI7EZSTr94JdoaTw4yrC1wLuSehpj400Q== X-Google-Smtp-Source: AGHT+IH7wfmDbfR6Z2qEtq3pMk9IgeemDK1hAb5WzD+t2OuchV1RCwEJOdhdz0vPw5QCvormiuhN7g== X-Received: by 2002:ac8:5882:0:b0:437:c024:73f3 with SMTP id d75a77b69052e-43dbef87227mr2207121cf.44.1715099230572; Tue, 07 May 2024 09:27:10 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:09 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:06 +0000 Subject: [PATCH v2 01/18] media: allegro: nal-hevc: Refactor nal_hevc_sub_layer_hrd_parameters MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-1-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092718_272803_9697C48B X-CRM114-Status: GOOD ( 14.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace all the single elements arrays with the element itself. Pahole shows the same padding and alignment for x86 and arm in both situations. This fixes this cocci warning: drivers/media/platform/allegro-dvt/nal-hevc.h:102:14-22: 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: Ricardo Ribalda --- drivers/media/platform/allegro-dvt/allegro-core.c | 6 +++--- drivers/media/platform/allegro-dvt/nal-hevc.c | 11 +++-------- drivers/media/platform/allegro-dvt/nal-hevc.h | 6 +++--- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/media/platform/allegro-dvt/allegro-core.c b/drivers/media/platform/allegro-dvt/allegro-core.c index da61f9beb6b4..369bd88cc0ae 100644 --- a/drivers/media/platform/allegro-dvt/allegro-core.c +++ b/drivers/media/platform/allegro-dvt/allegro-core.c @@ -1852,14 +1852,14 @@ static ssize_t allegro_hevc_write_sps(struct allegro_channel *channel, hrd->dpb_output_delay_length_minus1 = 30; hrd->bit_rate_scale = ffs(channel->bitrate_peak) - 6; - hrd->vcl_hrd[0].bit_rate_value_minus1[0] = + hrd->vcl_hrd[0].bit_rate_value_minus1 = (channel->bitrate_peak >> (6 + hrd->bit_rate_scale)) - 1; cpb_size = v4l2_ctrl_g_ctrl(channel->mpeg_video_cpb_size) * 1000; hrd->cpb_size_scale = ffs(cpb_size) - 4; - hrd->vcl_hrd[0].cpb_size_value_minus1[0] = (cpb_size >> (4 + hrd->cpb_size_scale)) - 1; + hrd->vcl_hrd[0].cpb_size_value_minus1 = (cpb_size >> (4 + hrd->cpb_size_scale)) - 1; - hrd->vcl_hrd[0].cbr_flag[0] = !v4l2_ctrl_g_ctrl(channel->mpeg_video_frame_rc_enable); + hrd->vcl_hrd[0].cbr_flag = !v4l2_ctrl_g_ctrl(channel->mpeg_video_frame_rc_enable); size = nal_hevc_write_sps(&dev->plat_dev->dev, dest, n, sps); diff --git a/drivers/media/platform/allegro-dvt/nal-hevc.c b/drivers/media/platform/allegro-dvt/nal-hevc.c index 9cdf2756e0a3..575089522df5 100644 --- a/drivers/media/platform/allegro-dvt/nal-hevc.c +++ b/drivers/media/platform/allegro-dvt/nal-hevc.c @@ -210,14 +210,9 @@ static void nal_hevc_rbsp_vps(struct rbsp *rbsp, struct nal_hevc_vps *vps) static void nal_hevc_rbsp_sub_layer_hrd_parameters(struct rbsp *rbsp, struct nal_hevc_sub_layer_hrd_parameters *hrd) { - unsigned int i; - unsigned int cpb_cnt = 1; - - for (i = 0; i < cpb_cnt; i++) { - rbsp_uev(rbsp, &hrd->bit_rate_value_minus1[i]); - rbsp_uev(rbsp, &hrd->cpb_size_value_minus1[i]); - rbsp_bit(rbsp, &hrd->cbr_flag[i]); - } + rbsp_uev(rbsp, &hrd->bit_rate_value_minus1); + rbsp_uev(rbsp, &hrd->cpb_size_value_minus1); + rbsp_bit(rbsp, &hrd->cbr_flag); } static void nal_hevc_rbsp_hrd_parameters(struct rbsp *rbsp, diff --git a/drivers/media/platform/allegro-dvt/nal-hevc.h b/drivers/media/platform/allegro-dvt/nal-hevc.h index eb46f12aae80..afa7a9d7d654 100644 --- a/drivers/media/platform/allegro-dvt/nal-hevc.h +++ b/drivers/media/platform/allegro-dvt/nal-hevc.h @@ -97,9 +97,9 @@ struct nal_hevc_vps { }; struct nal_hevc_sub_layer_hrd_parameters { - unsigned int bit_rate_value_minus1[1]; - unsigned int cpb_size_value_minus1[1]; - unsigned int cbr_flag[1]; + unsigned int bit_rate_value_minus1; + unsigned int cpb_size_value_minus1; + unsigned int cbr_flag; }; struct nal_hevc_hrd_parameters { From patchwork Tue May 7 16:27:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657462 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 CC682C25B5F for ; Tue, 7 May 2024 16:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yOxSJPYMVILXVHKr9QFGiN3vyCzsOlNMM+g8RZc0kjs=; b=aW72+77ZjGeMbW yDtYaWGquKiEZNGiSJIm4GW7Mp7OHhAyj1mxikIuE7cHMIcSiZcfnhdQGC60c4mX8/TOi5aRr3m2/ +zryLO/HJpmY4YPNsEKrhwP8nPOt8+1p29u7P4zuEo+DLQQuy+VY4eZl2kKUuwO0WPitwDRAo6ZRi fBXuHnfqmKYVXV8fjjdzHbBK/Np0uYtsEiybTQI0f0SNWZXn/Y2/UguLbj0CkWGOaj1qieTPk4VwL M1ld9N8ZVac9navxUnno7FDp2oVxe0m+4W6OGFNvlHpTvtvOq1maqmwoWEToDjRVLHNVPRpC916nn 07rmGz+LKFy1KGkTIkjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4NfB-0000000Bxng-3VYs; Tue, 07 May 2024 16:27:33 +0000 Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4New-0000000BxSv-0Fns for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:21 +0000 Received: by mail-qt1-x82a.google.com with SMTP id d75a77b69052e-43d4a2d0a0bso16203501cf.3 for ; Tue, 07 May 2024 09:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099231; x=1715704031; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=dp/a3NMmYGz+hm8qsmJibF9yTx35ajv4b4FGHxOOJ3Q=; b=nv3qy9V4blMaefzr8FvS0U9cYa37erTWvw4f/LOhhe/DR6ziJ3sHaA76pwaDdUfnNi ddV8buBjMdwKGKGDGA8hzsXaQrCV5YhqOx16CTNyAFg7eqNwZs1uabvTA4wKCRs13hdo Q3NzdrDsuchn66jhdA6KGvPtJN6l80b7zm0ls= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099231; x=1715704031; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dp/a3NMmYGz+hm8qsmJibF9yTx35ajv4b4FGHxOOJ3Q=; b=DZPTs2tIEZFVOoczHvSoa6ejmpLjsBZS+GIVbCsJsj++/iQ+ZWt55iCPabi54iT6SH tcT8ke6D0SdpWvXeLyUhBPMr/+FU+gHcJ5BES8rE+2AHHmc4yp2Op9MlqXlSj7Sk+pej pEZRjCyTJFnadzFvJt0DW+/X9qJAVdGk3CgWo/Em9/XWFw+khMTtR1sMaN0jM7W8j03q USAZuQEUbMu6QSmcyrtwkYWP8SQldoiDwdoXne4SleEfh/zn2HUrOHGVy8Xzwby1jI+U c9oC4ySF3CUt9yv7fe5j8KT/G2dc0rlCxuSsF7/ArsH+8yv7oGDCesPcpefNzIYNbjZZ sBBA== X-Forwarded-Encrypted: i=1; AJvYcCUomsIgq7/iL4x1Sd6fYTuxq+aZoEGEDYw9kd3RNmzSQSvvshjBQZDhBS0DNSOiYC6VA4pCgVaPeW9Vi/zktUmhWyzjLwy+xNeJ+oGqlg0zqbrdccg= X-Gm-Message-State: AOJu0YzBxRJDWsT8JWHQL+PYyRgloavseIf9WpGtIT/fSsjynH64sXqq gE+J4Y6SnWu1Jw30ld7xq1U7rcXJHDAL01p3IquBCXGDR01SqQH3kj9u4fVJjA== X-Google-Smtp-Source: AGHT+IEOeHKGmS3SHashwweKO/vUQBNCSRFTe5jpqSXB3JxcQpvTp7L0R+6KghhNE4f3RITfPrM5nw== X-Received: by 2002:ac8:5753:0:b0:43a:f64f:c2a with SMTP id d75a77b69052e-43dbf853b66mr1566601cf.46.1715099231571; Tue, 07 May 2024 09:27:11 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:10 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:07 +0000 Subject: [PATCH v2 02/18] media: xilinx: Refactor struct xvip_dma MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-2-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092718_253077_D51CE621 X-CRM114-Status: GOOD ( 13.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace a single element array with a single field. The following cocci warning is fixed: drivers/media/platform/xilinx/xilinx-dma.h:100:19-22: 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: Ricardo Ribalda Reviewed-by: Laurent Pinchart --- drivers/media/platform/xilinx/xilinx-dma.c | 4 ++-- drivers/media/platform/xilinx/xilinx-dma.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c index a96de5d388a1..a1687b868a44 100644 --- a/drivers/media/platform/xilinx/xilinx-dma.c +++ b/drivers/media/platform/xilinx/xilinx-dma.c @@ -348,8 +348,8 @@ static void xvip_dma_buffer_queue(struct vb2_buffer *vb) } dma->xt.frame_size = 1; - dma->sgl[0].size = dma->format.width * dma->fmtinfo->bpp; - dma->sgl[0].icg = dma->format.bytesperline - dma->sgl[0].size; + dma->sgl.size = dma->format.width * dma->fmtinfo->bpp; + dma->sgl.icg = dma->format.bytesperline - dma->sgl.size; dma->xt.numf = dma->format.height; desc = dmaengine_prep_interleaved_dma(dma->dma, &dma->xt, flags); diff --git a/drivers/media/platform/xilinx/xilinx-dma.h b/drivers/media/platform/xilinx/xilinx-dma.h index 9c6d4c18d1a9..18f77e1a7b39 100644 --- a/drivers/media/platform/xilinx/xilinx-dma.h +++ b/drivers/media/platform/xilinx/xilinx-dma.h @@ -97,7 +97,7 @@ struct xvip_dma { struct dma_chan *dma; unsigned int align; struct dma_interleaved_template xt; - struct data_chunk sgl[1]; + struct data_chunk sgl; }; #define to_xvip_dma(vdev) container_of(vdev, struct xvip_dma, video) From patchwork Tue May 7 16:27:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657459 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 C79E0C10F1A for ; Tue, 7 May 2024 16:27:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YQW9nKVYWLAlTneeBCiw6Zcl6tMRyRyAYPeoayHtKhQ=; b=pbksoH8v6BZkhY lnI+dsWJ7mM5SqkZiI7yjju5eejWfxE02lNXnDGHXnV9+NzjKPiOf/Lvui6npe7k5MOj5FNTPGovd TPiWmXfn/+Z3MeJHlTHqSsInCO3Mo3MgwhUolNpwdiO6QzQzC6Z5jDn4upV2HwkT83nxur4+I5Ie7 D4T1uDvL7TJv9xEDSrggR22+Uw38CkYYMWp5mx72mTcWjPi9Csg51I+4YLT13s/r2KmpmxIATJt73 T64d94Vd8zglEi1qa+2Gq8tEHCNeQA4bPRF3fggYNgASMKb8BfmYUmHencAKXGaFVGv8M8jkhrucC iEl50TMblTnuLxpahyyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Ney-0000000Bxbh-2cyJ; Tue, 07 May 2024 16:27:20 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Net-0000000BxTD-214S for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:17 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-22e6b61d652so1693328fac.0 for ; Tue, 07 May 2024 09:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099232; x=1715704032; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2A/cdtQJ5ubVGGh9zBSnEjfvf8aW68DShS0IQqplaqg=; b=l2Ky9uzeMSsaJ328bLdnkno3qC2amSZ7Piuz87rJgrD4V5uo8Irme/z3tK694rkWx5 wdJg/BU8Ok+kpXAg5Ykiav0cvw3JaXmZAbAwec4WN126jAV/fmaV5S8Wz2zJLnB809fo +K8WciWmLpiTJeVoojt3fyLRv0TptvW+WXcT8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099232; x=1715704032; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2A/cdtQJ5ubVGGh9zBSnEjfvf8aW68DShS0IQqplaqg=; b=kPTchr+CxWUR/7IGS0jaf/pkBHpHbJfq0ban5bJkMLa/SGll/yh2NJB+97nCDbdSrt Ul8q+FjDCocKJC3PoLGZWdpMX9BcbCOEnmyuHqCMn2emQqyHh1DVVO/3QF4ZLBc3AByE j3oPtj/L6L5spHVDm8SXsam35L5ubWgLOCJjw4IJW6m23e7jkwnJCH07chWclbGeeQNg /qQjufYXMGYd4OqCZgk9suwlGd7LAbitYAChjie9T9eDzXuU9ayXWvTanToS9VZE79vr Si5v388of006+tnGHG8z6hgQfEKhk0dVEUNJ+Vh4LO5shG6wvLhq6KGArYgK9h6wyCMJ AL+w== X-Forwarded-Encrypted: i=1; AJvYcCV9GWFkv/K85Gj84SR7d33DYV1Z9hH7nZJ4OkNAdGSMLbRPsAUEv7mHRRZXWOaK9cq9IZuNzELXBOdELL5gjdh7kIk9rS871gdVHMUKRd42ObImyp8= X-Gm-Message-State: AOJu0YxPAoaT/FPLlVZD48fPBsZBaJz2Dxe5EaFflaCpRwb6Q2SsEKgM f7yLYBNoRPrRlUwfnGGtw6Uh/6+nEs0Bo6EJebMj8JPmBPU47EKCtVhxcIWIUg== X-Google-Smtp-Source: AGHT+IFNJz8W2TliqlWnVCfeJU7sKKv7snchkh8btiT9U1bG50pXZSjddsLAAbR+Un47VkXMoaVYdg== X-Received: by 2002:a05:6870:e998:b0:23e:b42a:499 with SMTP id 586e51a60fabf-24097bdf8camr109598fac.2.1715099232296; Tue, 07 May 2024 09:27:12 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:11 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:08 +0000 Subject: [PATCH v2 03/18] media: dvb-frontend/mxl5xx: Refactor struct MBIN_FILE_T MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-3-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092715_596190_F1375F7E X-CRM114-Status: GOOD ( 14.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace a single element array, with a single element field. The following cocci warning is fixed: drivers/media/dvb-frontends/mxl5xx_defs.h:171:4-8: 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: Ricardo Ribalda --- drivers/media/dvb-frontends/mxl5xx.c | 2 +- drivers/media/dvb-frontends/mxl5xx_defs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/mxl5xx.c b/drivers/media/dvb-frontends/mxl5xx.c index 91e9c378397c..a15c0438b07a 100644 --- a/drivers/media/dvb-frontends/mxl5xx.c +++ b/drivers/media/dvb-frontends/mxl5xx.c @@ -893,7 +893,7 @@ static int do_firmware_download(struct mxl *state, u8 *mbin_buffer_ptr, status = write_register(state, FW_DL_SIGN_ADDR, 0); if (status) return status; - segment_ptr = (struct MBIN_SEGMENT_T *) (&mbin_ptr->data[0]); + segment_ptr = (struct MBIN_SEGMENT_T *)(&mbin_ptr->data); for (index = 0; index < mbin_ptr->header.num_segments; index++) { if (segment_ptr->header.id != MBIN_SEGMENT_HEADER_ID) { dev_err(state->i2cdev, "%s: Invalid segment header ID (%c)\n", diff --git a/drivers/media/dvb-frontends/mxl5xx_defs.h b/drivers/media/dvb-frontends/mxl5xx_defs.h index 097271f73740..3c5d75ed8fea 100644 --- a/drivers/media/dvb-frontends/mxl5xx_defs.h +++ b/drivers/media/dvb-frontends/mxl5xx_defs.h @@ -168,7 +168,7 @@ struct MBIN_FILE_HEADER_T { struct MBIN_FILE_T { struct MBIN_FILE_HEADER_T header; - u8 data[1]; + u8 data; }; struct MBIN_SEGMENT_HEADER_T { From patchwork Tue May 7 16:27:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657460 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 B52BDC10F1A for ; Tue, 7 May 2024 16:27:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BnvzN667+K1j+jfD1oZ2By0WG4Vnw968IrFif1l6WQE=; b=pTK9Mh9k9e+ZTx sA6Xjgw+5P8GRe2OSjFeUwjtghMsRaH9qpvOHaYxEeMvsP0Jy8JwnxNoSPslN1Bwtftei3nUXFaXo 8Col8zK8z5QWPqA3aj0MwKGL5gP+oraRAO2Mt3LU2dCooDKK0vv6Y8iwRAyTkJyPvZwAMQvT8WfDM TGcKkUk6spmcXNt5+fHTnyW4pm1F7QhYre3F6Pnb+3zZgWdbWjfn6NPnZOLLtK40EIMZM8gj+S1/X ugwdkS3BIveLcV9QzwJFer5HKtRXMpI+jFAUcW3S286ccBSVCTysIA/k99OFiYJjvN2ciLxtbURjy 5vCA/wQcupC5BvAg61hw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4NfA-0000000Bxml-3kxE; Tue, 07 May 2024 16:27:32 +0000 Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4New-0000000BxTR-0HpR for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:20 +0000 Received: by mail-qt1-x82f.google.com with SMTP id d75a77b69052e-43d1d5c68b4so8853931cf.0 for ; Tue, 07 May 2024 09:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099233; x=1715704033; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1/P1ujR64RjpeY3CCEbW1xPPMvUuqlT7weCmbLOLgyg=; b=jog46REsX88N/TT8I58i9MVH03jir5HmF+lJ9Q23Fy+Og/P6ICdAS0sSMzQxWHiDVa yjll7RvEa0KckROW0I/z3P8go8N0k6BMIiENvfI7lMBqrkaYBHugFWKhiczBXoeK0M8q 8eUCIz+mikVo4urmfnC0DE1Zb095cOu5BveAc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099233; x=1715704033; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1/P1ujR64RjpeY3CCEbW1xPPMvUuqlT7weCmbLOLgyg=; b=XzN7n6qNABtCLe4wFGQ2qcG8MNPD9GbaQbekrIzbjZNr7wCJb9nqsqF9TQBM3EN7tx 4snLL/w/buEWzBaUGk1BJGinQZw4qXV63TrFH+zsHgofQhIiZFlteBGesmBXCcvujM1o xYGaX+6bN1+UVyTTNsGIXzCb8ZFWU17Z6HQBe8PO33Ctth4+wtGvzGfWDqnZMpk2ZuQ+ OOjqV440ou4bwXeTaLjCd4iLgPt0ZekBfVR1nEQ0nDKwGxG3HmZGHEwfCcR39HyMO9B5 z1mqRglu83qpoWwwk1AM2rF2yLkCj49nlswzKC40v0YBNXG2bzMqnnicXjaYtrBbC/AI RJ9Q== X-Forwarded-Encrypted: i=1; AJvYcCXdTESTaMxF1bIWjzkasU9+Fg4s6v4zMUPqB7zIS2j6swXyVM6TNKigKP05t+XuHQ/u/KcpDCtHMR69y32zODYw+qTPDzU116sxyMdRqbruAgdtC0g= X-Gm-Message-State: AOJu0YxdlHoW8TAiwUyb3vwY1sOOC7yz+S6o0nzWG03VXv6/PoDaMVbY LSvFYAEBjU2KPw4Cnd77lzKEXV6+qt6hRmvYXhivYFfbHQd4/0o0YvcYrshIhQ== X-Google-Smtp-Source: AGHT+IF13hjL17rg1ksLknz8RID4/qPhKnOZgs0TD68SX8wPAxraoJfg23Be6Og+r0EAzRQ8G/LBRw== X-Received: by 2002:a05:622a:2994:b0:43c:748f:6e96 with SMTP id d75a77b69052e-43dbf622550mr1868001cf.39.1715099233022; Tue, 07 May 2024 09:27:13 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:12 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:09 +0000 Subject: [PATCH v2 04/18] media: dvb-frontend/mxl5xx: Use flex array for MBIN_SEGMENT_T MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-4-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092718_240478_8371EF90 X-CRM114-Status: GOOD ( 13.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace the older style one-element array with a flexible array member. There does not seem to be any allocation for this struct in the code, so no more code changes are required. The following cocci warning is fixed: drivers/media/dvb-frontends/mxl5xx_defs.h:182:4-8: 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: Ricardo Ribalda --- drivers/media/dvb-frontends/mxl5xx_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/mxl5xx_defs.h b/drivers/media/dvb-frontends/mxl5xx_defs.h index 3c5d75ed8fea..512ec979f96f 100644 --- a/drivers/media/dvb-frontends/mxl5xx_defs.h +++ b/drivers/media/dvb-frontends/mxl5xx_defs.h @@ -179,7 +179,7 @@ struct MBIN_SEGMENT_HEADER_T { struct MBIN_SEGMENT_T { struct MBIN_SEGMENT_HEADER_T header; - u8 data[1]; + u8 data[]; }; enum MXL_CMD_TYPE_E { MXL_CMD_WRITE = 0, MXL_CMD_READ }; From patchwork Tue May 7 16:27:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657464 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 39589C10F1A for ; Tue, 7 May 2024 16:27:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wGeXZQ9Ul9l+8vbaRqcCa/GelSvbP5tj15V9xMhCHQQ=; b=m2ri72K+spcgul BBnAjWs6WPRj7/IL16Phs4cnFdcjQtOkvRMPAW1jaw5Ly3XNkjMDv3IPUdFj1hrK5ETY+s4mSYBwD Hy4viChGTvCyCzSae0+Ej8t9eNKQhXd0aU2AYDe0JK8uHybl3lyCrlHAK8yL4+I0JB/1dypZfxg4n YGHOT1KxL8bSqOVMuxTxA4T4snfAQ6Ai2JW3+T28qIv5caAGXZ6gEx0f5vhKJqdiplBnFoLflqgvG XRX6n1uGJGuoC5Fheyi8SEn5xHdRv+3kVvnfbfn6+ss4d2aGGCsqVS4xjjJUp2/g4gP2xQG+zFCVE ykNE3TeshMjsw1U7oHew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4NfE-0000000Bxpz-0da4; Tue, 07 May 2024 16:27:36 +0000 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4New-0000000BxTv-0EgN for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:22 +0000 Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-43a317135a5so23473111cf.0 for ; Tue, 07 May 2024 09:27:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099233; x=1715704033; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=yEp5ZozBkj0x9D1ws5SUxXE7DcMsbsSxhL1FOw8KqVY=; b=KkyuFeKI6Pn39mfOT+DkFGXiadjEc1eyFLRHdSyk1YN5ojxY7Wal3zZ4UgOft2e/fa 67OeBUD4fiy2jZ+M8z0MK1ZvpaLywaxTdotn57aSSJsAzo7jIa2HzVLSqjX98Ce1cYOo rA2KUwYkd2MJmgRxTR/hhCiP3tqObK3Cuzyh0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099233; x=1715704033; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yEp5ZozBkj0x9D1ws5SUxXE7DcMsbsSxhL1FOw8KqVY=; b=tjfxl2L14wLnd/nbo5mMayB7hGgwnwXEq7u9QQ4RPj1J0/Yzn9dsD14ICpbhce0q/K 2a+njWWp+N63KvvI0Co0XtgYTR/McLC5TQDKO+/kMY3KzLZkuv5T18mmJNTar9/sVzdC cJKqZfwfzo2xvZWrmXEWIXzuVCLNafGMNk3XYd8OwLZMUSSksCltVwSQn2eWKLS/lc9K D4gWGVDeYgr5WVCW9+zRC/8YnQLmp2gX1Ee1QpzIp3P3ytd7FHe5QKlCW/eHC8yg1FfY WatX+/TcMHVVa+5lvmoxU3DHrJm9JBiCeBcVuvBrkkFj1EqpASkeLTiEWpwhzdIQej8c i1UA== X-Forwarded-Encrypted: i=1; AJvYcCWAX0kzK7nVk1zTnCXHhIcBvehiqHtV0C0Y/+0hxsqbw9sITI1aflkqYddQmQq0PsnRxPOOpMGOtgwu9utDaer+laWP8nOG+k3KrLuVpu4cL5oDHe0= X-Gm-Message-State: AOJu0YwfcwViQzJ4BZwd/+XTfFe1UaIVu5OocY2Y3HeJ981uA4XOhOV/ Zns4/z0ztImr+Me7WuoiDakE4F4GtLGMF4UFADCzV542IJ7jglFo3/Uh4iKl6Q== X-Google-Smtp-Source: AGHT+IFG5P8cF3bvogi35ZVCCh3mpoFd/JBPtTJGyHj5A6ptYc39Pcqw/IlsAeEpo3GtlKvW+qflBQ== X-Received: by 2002:ac8:5a15:0:b0:43b:16d1:a6ee with SMTP id d75a77b69052e-43d8f44bd11mr53130171cf.17.1715099233681; Tue, 07 May 2024 09:27:13 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:13 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:10 +0000 Subject: [PATCH v2 05/18] media: pci: cx18: Use flex arrays for struct cx18_scb MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-5-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092718_269708_0CD070EA X-CRM114-Status: GOOD ( 14.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace the old-style single element array with a flexible array. This structure does not seem to be allocated in the code, so there is no need to change anything else. The following cocci warning is fixed: drivers/media/pci/cx18/cx18-scb.h:261:22-29: 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: Ricardo Ribalda --- drivers/media/pci/cx18/cx18-scb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/cx18/cx18-scb.h b/drivers/media/pci/cx18/cx18-scb.h index f7105421dd25..841edc0712ab 100644 --- a/drivers/media/pci/cx18/cx18-scb.h +++ b/drivers/media/pci/cx18/cx18-scb.h @@ -258,7 +258,7 @@ struct cx18_scb { struct cx18_mailbox ppu2epu_mb; struct cx18_mdl_ack cpu_mdl_ack[CX18_MAX_STREAMS][CX18_MAX_MDL_ACKS]; - struct cx18_mdl_ent cpu_mdl[1]; + struct cx18_mdl_ent cpu_mdl[]; }; void cx18_init_scb(struct cx18 *cx); From patchwork Tue May 7 16:27:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657465 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 AB889C25B74 for ; Tue, 7 May 2024 16:27:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aHAJ9tLJp5JeiUEgQxtRFedX9j05JHHdjU/dDOvPltY=; b=JILPkeVz64WrK6 7IEOXimfZsmoOJI8BdZ6NdpT1LEZPzz7SkoE+DeNIQFQXtiMeAj2wTbqn/KbUSajOBswZSY94LHV7 SL54FnCf1Sy2ArwSE/p2AHZR/U05jvmO2g7NwMCg9dWddb3ovfkS0XHlaHRCByF1nqtkl444YQ8ZD 1To/7ZfvSQN823ISLR4Pn+uFPL8Kc2Pohv9ZnAzmsyFsefkt1ostHUKlk+XLMpfZTQ1E+m+CCzT89 AUjdJ6aAjvSx+2mHtirWCvCjmDZu5RQc2emH/SZ+idUwytxvZKxGxzz1JtVz5zJ1rGJ0e3tmVC3r/ exfGmOaXImNsn7jK0d8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4NfI-0000000Bxtv-2LJj; Tue, 07 May 2024 16:27:40 +0000 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nex-0000000BxVZ-0r9R for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:24 +0000 Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-3c96be1ef20so1349571b6e.1 for ; Tue, 07 May 2024 09:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099235; x=1715704035; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ckyXB1RMjwvOvAxa8fnxheCGm68/C6yK7+APpHNPb5E=; b=NLRm1WlqDmw9XW2gD0Jvqk9NBeZS7iI6nsNPDQkwhQjBWaxd47a/CBkAxmO+1Y7vhd mnxzALVVKrjLwS+DTi/mWu/JO99O+YRdQIcCZQDWuBaUtrFu/OaJMGH4EYNBsWKGcbuk 5wfAD8Cb8gL8HphYnqK2931AjqatZ5WyutTqM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099235; x=1715704035; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ckyXB1RMjwvOvAxa8fnxheCGm68/C6yK7+APpHNPb5E=; b=sjBPft2oBCK5Ntwf7YMOsguXoEpIrGnBQu2tEIi50oH9oRZQF3NujsHjHxCuT3Nvn8 YWqlQ3jYlmmavm8uidX+fzh7aP+Xn9iOFRkSE0XZ1UFsZ8xCwiCm32wKEvjOnoxfweYO weq+QzstbHwU0gWU4rUkNfTs4lOLBVYtx8Y4LJu1rPUBLO5TY8eqzxj5zjWZQjhsiHlX BREi+FWaxoFjTPU34Tq16EBFOgPwQDzSfcS9gWaGKlXJl7zm9NGIoYOgBk2pbwr4Itg/ TtERrq57aL24JPn9LRoL2B7Oxe7fz6Xl39WSE5zKnPsM6+UbABL+xf/BNkpNEhks2h+D 8sHQ== X-Forwarded-Encrypted: i=1; AJvYcCWIHX2lrSYW3S9TsHB0eFXAunlHdeiaQT0UHFi7buWV8Gd1jlSzMgi2j6RAezwYEBdxYd/11ZQnNFwCOghAM8lyHMAlz/efd9ikqtVo8aw7B5BcJZ4= X-Gm-Message-State: AOJu0YzFSkRL1TmueFrHh1PlqVNYmR0f2WxXhVZw5QQgONBCmotoPG2P XA+7NKMgo78GlXApBOYhYnUUlW7dvHTCB3mf51VBC/s2BALsoBw+G/qnEs6v9A== X-Google-Smtp-Source: AGHT+IHK8MR0ETZCa+Cso9ZcR2kzwzSwWzWxtW7LPWutI3GEHlRvYRnkrjbzVhChzSF546k9ojGUqQ== X-Received: by 2002:a05:6808:2ca:b0:3c7:3d8f:7ef1 with SMTP id 5614622812f47-3c9852be83bmr64772b6e.17.1715099234965; Tue, 07 May 2024 09:27:14 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:14 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:11 +0000 Subject: [PATCH v2 06/18] media: siano: Refactor struct sms_msg_data MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-6-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092719_458400_2BDC3CAE X-CRM114-Status: GOOD ( 17.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace a single element array with a single element field. The endianness conversion code seems to support multiple elements. To avoid changing behavior a pointer to the single element has been used. This is safer than moving to a flex array, because in that case the structure size changes. This fixes the following cocci warning: drivers/media/common/siano/smscoreapi.h:619:5-13: 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: Ricardo Ribalda --- drivers/media/common/siano/smscoreapi.c | 10 +++++----- drivers/media/common/siano/smscoreapi.h | 2 +- drivers/media/common/siano/smsdvb-main.c | 4 ++-- drivers/media/common/siano/smsendian.c | 8 +++++--- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/media/common/siano/smscoreapi.c b/drivers/media/common/siano/smscoreapi.c index 7ebcb10126c9..b6f1eb5dbbdf 100644 --- a/drivers/media/common/siano/smscoreapi.c +++ b/drivers/media/common/siano/smscoreapi.c @@ -839,7 +839,7 @@ static int smscore_configure_board(struct smscore_device_t *coredev) mtu_msg.x_msg_header.msg_flags = 0; mtu_msg.x_msg_header.msg_type = MSG_SMS_SET_MAX_TX_MSG_LEN_REQ; mtu_msg.x_msg_header.msg_length = sizeof(mtu_msg); - mtu_msg.msg_data[0] = board->mtu; + mtu_msg.msg_data = board->mtu; coredev->sendrequest_handler(coredev->context, &mtu_msg, sizeof(mtu_msg)); @@ -852,7 +852,7 @@ static int smscore_configure_board(struct smscore_device_t *coredev) SMS_INIT_MSG(&crys_msg.x_msg_header, MSG_SMS_NEW_CRYSTAL_REQ, sizeof(crys_msg)); - crys_msg.msg_data[0] = board->crystal; + crys_msg.msg_data = board->crystal; coredev->sendrequest_handler(coredev->context, &crys_msg, sizeof(crys_msg)); @@ -1306,7 +1306,7 @@ static int smscore_init_device(struct smscore_device_t *coredev, int mode) msg = (struct sms_msg_data *)SMS_ALIGN_ADDRESS(buffer); SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_INIT_DEVICE_REQ, sizeof(struct sms_msg_data)); - msg->msg_data[0] = mode; + msg->msg_data = mode; rc = smscore_sendrequest_and_wait(coredev, msg, msg->x_msg_header. msg_length, @@ -1394,7 +1394,7 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode) SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_INIT_DEVICE_REQ, sizeof(struct sms_msg_data)); - msg->msg_data[0] = mode; + msg->msg_data = mode; rc = smscore_sendrequest_and_wait( coredev, msg, msg->x_msg_header.msg_length, @@ -1554,7 +1554,7 @@ void smscore_onresponse(struct smscore_device_t *coredev, struct sms_msg_data *validity = (struct sms_msg_data *) phdr; pr_debug("MSG_SMS_DATA_VALIDITY_RES, checksum = 0x%x\n", - validity->msg_data[0]); + validity->msg_data); complete(&coredev->data_validity_done); break; } diff --git a/drivers/media/common/siano/smscoreapi.h b/drivers/media/common/siano/smscoreapi.h index f8789ee0d554..46dc74ac9318 100644 --- a/drivers/media/common/siano/smscoreapi.h +++ b/drivers/media/common/siano/smscoreapi.h @@ -616,7 +616,7 @@ struct sms_msg_hdr { struct sms_msg_data { struct sms_msg_hdr x_msg_header; - u32 msg_data[1]; + u32 msg_data; }; struct sms_msg_data2 { diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c index d893a0e4672b..44d8fe8b220e 100644 --- a/drivers/media/common/siano/smsdvb-main.c +++ b/drivers/media/common/siano/smsdvb-main.c @@ -689,7 +689,7 @@ static int smsdvb_start_feed(struct dvb_demux_feed *feed) pid_msg.x_msg_header.msg_flags = 0; pid_msg.x_msg_header.msg_type = MSG_SMS_ADD_PID_FILTER_REQ; pid_msg.x_msg_header.msg_length = sizeof(pid_msg); - pid_msg.msg_data[0] = feed->pid; + pid_msg.msg_data = feed->pid; return smsclient_sendrequest(client->smsclient, &pid_msg, sizeof(pid_msg)); @@ -711,7 +711,7 @@ static int smsdvb_stop_feed(struct dvb_demux_feed *feed) pid_msg.x_msg_header.msg_flags = 0; pid_msg.x_msg_header.msg_type = MSG_SMS_REMOVE_PID_FILTER_REQ; pid_msg.x_msg_header.msg_length = sizeof(pid_msg); - pid_msg.msg_data[0] = feed->pid; + pid_msg.msg_data = feed->pid; return smsclient_sendrequest(client->smsclient, &pid_msg, sizeof(pid_msg)); diff --git a/drivers/media/common/siano/smsendian.c b/drivers/media/common/siano/smsendian.c index a3573814919b..b957970c7d97 100644 --- a/drivers/media/common/siano/smsendian.c +++ b/drivers/media/common/siano/smsendian.c @@ -20,11 +20,12 @@ void smsendian_handle_tx_message(void *buffer) struct sms_msg_data *msg = buffer; int i; int msg_words; + u32 *msg_data = &msg->msg_data; switch (msg->x_msg_header.msg_type) { case MSG_SMS_DATA_DOWNLOAD_REQ: { - msg->msg_data[0] = le32_to_cpu((__force __le32)(msg->msg_data[0])); + msg->msg_data = le32_to_cpu((__force __le32)(msg->msg_data)); break; } @@ -33,7 +34,7 @@ void smsendian_handle_tx_message(void *buffer) sizeof(struct sms_msg_hdr))/4; for (i = 0; i < msg_words; i++) - msg->msg_data[i] = le32_to_cpu((__force __le32)msg->msg_data[i]); + msg_data[i] = le32_to_cpu((__force __le32)msg_data[i]); break; } @@ -66,11 +67,12 @@ void smsendian_handle_rx_message(void *buffer) default: { + u32 *msg_data = &msg->msg_data; msg_words = (msg->x_msg_header.msg_length - sizeof(struct sms_msg_hdr))/4; for (i = 0; i < msg_words; i++) - msg->msg_data[i] = le32_to_cpu((__force __le32)msg->msg_data[i]); + msg_data[i] = le32_to_cpu((__force __le32)msg_data[i]); break; } From patchwork Tue May 7 16:27:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657463 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 9DCCFC25B4F for ; Tue, 7 May 2024 16:27:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DOhoLbbLSacaop6Yur4t6X8Amzgi/yV85uJqpgy474M=; b=b0B0KMWmHCg3JB ARRf5i68eGbhH43EDtSui7pibEwgSTdaY6ANoYAjADjj79n0Sk+cjgfqGX2W5ccH+ohTYgr3Wqtmg +vhr/I0O4aTl3N3JPR6aNtGWaXzDbFDbbKCX2f/ZpiMhvAGb2N6b5ASMfM2oQiPeNef43w3ip24Qe 6knzeThJsn/4QuWN/2bGNf1pKqzjyegHpMTlT+lEATMfqCWE/EP6PUXS8XNQPg0NNIROJawgzCBTj kBf0U91uzkJUQF3h6WoUxsVipfp2MLUcL79GScMp6tO1Duc37iMvZuT3DX/fLKTdjAPxK1s/RYGEo g/HxHJPnIdEiZH11a2WA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4NfF-0000000Bxr6-3KA5; Tue, 07 May 2024 16:27:37 +0000 Received: from mail-ua1-f46.google.com ([209.85.222.46]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4New-0000000BxXC-2q4A for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:23 +0000 Received: by mail-ua1-f46.google.com with SMTP id a1e0cc1a2514c-7f169d3ef53so1522830241.1 for ; Tue, 07 May 2024 09:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099236; x=1715704036; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=bajBIKBKiGkzVrECr+DrCDdr2oyOzpQYYR0WAIoyaos=; b=KGfal2zbnys4FdaSJX5Jzj2EMBCwBxQpfy2m3MTIU19NblfEYj9uRosmuu97facQbL 63dg0Kxi0VV0DBOUm+s8vnKttvIleF7M2jIfWocT4Akm2LxzIZBj7Y9E8FLB7dA/3Lwt 15lEESt6dlCF1AZB3JW+W8/lqRzhpc6L3+oTs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099236; x=1715704036; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bajBIKBKiGkzVrECr+DrCDdr2oyOzpQYYR0WAIoyaos=; b=WY9F9KSvfKoUUKkifwwNZ71+YdRmK1d2+WOllmTDHqCbFSewPvPf1tmb3SXbSDfZec AyKRYaFgXZoxbXbPvOMW9xj6Iz7PDgm++e2ibG8i63Hicn90itDTGGbKUn5OGNpXixGP eN0vNG7m7pZPln7HXH0otEOfdQzJw9RU5yTHMMpHcTBh41PLHFsilYgaobuOJ1Uhebt8 PA8qBnx7iWO4kMQsXA4KLjb0flS6TQzkiR1LGlF/FB23giejWXNIHeIZNL27uTdXaf67 ge6ZDbp+ve27cjwWUklJuUIRrUa7H3Yxj158BJ7a1auFzMDATo9VcHUFcscVDTy2uUgm N0gg== X-Forwarded-Encrypted: i=1; AJvYcCVXOaHdnXQQDJxT9tyfa7jXe5e3hm2glOqiQ64pG0JHtjsfp7iq9yMHMQpMODSCdyT2PiA54wlcgvdUA4i8e0j4zj4cqStCttTKa4OWDE/l0CVBCak= X-Gm-Message-State: AOJu0YzvBL/IAkJmfkwKA48wC8one/mnqsoepz0JhbWMwf7c7ajfLf83 1IS3CyqwYB3jiX/+5wcCFmcLxL+qv8npHubiow7e9qHTgcVjkjHcpAJ7UkBGfw== X-Google-Smtp-Source: AGHT+IF792y8yHb1G1T8p5qXRpEfx35eaFsBGY9qOmU3ppGSWJfi2EDsEDzymoanJSEvwZpNFlF1oA== X-Received: by 2002:a05:6122:2a02:b0:4d3:4ac2:29f4 with SMTP id 71dfb90a1353d-4df692a6b65mr38747e0c.2.1715099235965; Tue, 07 May 2024 09:27:15 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:15 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:12 +0000 Subject: [PATCH v2 07/18] media: siano: Remove unused structures MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-7-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092718_821232_80D7E7E3 X-CRM114-Status: GOOD ( 11.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org These structs are not used in the code, remove them. This fixes the following cocci warning: drivers/media/common/siano/smscoreapi.h:1049:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/common/siano/smscoreapi.h:1055:4-8: 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: Ricardo Ribalda --- drivers/media/common/siano/smscoreapi.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/media/common/siano/smscoreapi.h b/drivers/media/common/siano/smscoreapi.h index 46dc74ac9318..bc61bc8b9ea9 100644 --- a/drivers/media/common/siano/smscoreapi.h +++ b/drivers/media/common/siano/smscoreapi.h @@ -1042,20 +1042,6 @@ struct sms_srvm_signal_status { u32 request_id; }; -struct sms_i2c_req { - u32 device_address; /* I2c device address */ - u32 write_count; /* number of bytes to write */ - u32 read_count; /* number of bytes to read */ - u8 Data[1]; -}; - -struct sms_i2c_res { - u32 status; /* non-zero value in case of failure */ - u32 read_count; /* number of bytes read */ - u8 Data[1]; -}; - - struct smscore_config_gpio { #define SMS_GPIO_DIRECTION_INPUT 0 #define SMS_GPIO_DIRECTION_OUTPUT 1 From patchwork Tue May 7 16:27:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657466 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 36D8AC25B4F for ; Tue, 7 May 2024 16:27:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QaO2bNnF968t7JXaftnAFuEpo1t26tO8D7IcFSYv0GE=; b=HvpMJDpREZIVM4 rErzcTyQL9Y7G2Fkc9wHhRG/JGmJoxNfM0GyuTHXIRsqthAGtqHrr4ttVVCJ6yRyljcBKBFia3J85 GKreAFo4v3tYB1lGVdjQMZmTj6jIu8jogW7l6SRK9+Qy9JN/z7PR//CMcy0LnapYz6pieRW1FoI0r s9E16+P7qhRUjWt5sdzAOV6subJBCB5e9+s/GDdZeb011uJnKEAaOOdt6v2hulMA0BEVq16Guqr9n fC577ryVI15+pNmIzaQ6IQVLkkFMFIqCSJYAO6PD+TlnijML8C8VDGltObogCEuu9cpucr5bhIILl KDO0KpgrvMKO3DqdEnBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4NfH-0000000BxsJ-0VHj; Tue, 07 May 2024 16:27:39 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nf2-0000000BxeV-0osn for linux-arm-kernel@bombadil.infradead.org; Tue, 07 May 2024 16:27:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=JKfhOSoHE1VqyRhgB0xYInvnK6a8zz5LZUqmCULZe+M=; b=UotZR0sQ66sU53KEP7xyEym34e asrxDmpJTiYqQ+vo3TMpUb7Vb3aFKyJpYxjihBv2B61iaTHXkhZaJ/9OBPCczjuivdaptAtEuax8a Xnv5SPZNJVcnBU7lHfOEAWoMfkkl4DMbUA2H3H5bd9Ga7ZPqNWOzc7dDN437UOTS4txTNaDJkuDRs FV6LGlTDUody2cvAOTgWm2L+C/XcD3LVaRq+uRPawZGTsO1NVK0YoLNtXAljKjVXswtqd2SrJ7azU fp9ZdYj+oja3W9H0hHMLp2+y4L1xTZjqeaZNKLNyKETiIz/jYnkWYl/S2YW7bn+Uhua4nb6DAWiPS 3ThKXH/A==; Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nex-00000002AXw-1ZIT for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:22 +0000 Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-3c969fa8fd2so1495188b6e.1 for ; Tue, 07 May 2024 09:27:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099237; x=1715704037; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=JKfhOSoHE1VqyRhgB0xYInvnK6a8zz5LZUqmCULZe+M=; b=KXGTxsaiR2SG2u9wXZPScx4Q8l8YwrGR6hRFJLYDp/klwIr7UCagbD9KJiTUehp0X7 SOkeX5MvVX4t/I1S/8gNUY6jWH+r+r2480Pe65ojceMzhm9I+8rDp0BSbJB4W6ijufab +Bwd7IUqqM2QawYNEoTP62FpWeIVJeBa/Zsdo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099237; x=1715704037; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JKfhOSoHE1VqyRhgB0xYInvnK6a8zz5LZUqmCULZe+M=; b=MVdoU5XzZTzrnn5JmTKiFdxFgrIiSSdHnBFTPmunR5nSydPcYCubHZH9laiwAoDK+p SmFegKqRut727EWKDR5/CVF9lxYS28dGy6iestwXQ0tqit9B2uFATy+NtdvkafMbjUci 4N/+mHHykFUVRP4Q8M78geBfU5RR3Q+rn2FlIke4s3xSrYw/ypmxwjW9jlc/ufmJwfQw fTeh5ce+6Rj4fkjORjaOFhL/XvnqZ0l3G/V4dK6ayo0cObzjGB+f6a5pe5ECCXGDKpwa LzO31lLI1omjMoatqtUShmYC7YI1scwffZGMJBzmm2GjzB3rymCBkXVViamXMtn9tvYk ujvQ== X-Forwarded-Encrypted: i=1; AJvYcCUC32QUA1oRk2HL1gIdKC+JMp253iDTQD1mA/Si896J1b6KxohqdaN9TdIXKCCjG7lO8ZB6UeChsAFYUSv+NOCLvi/Hkj2Tz0PSSE4lFDHkWkWe6WU= X-Gm-Message-State: AOJu0YwWSudQMGSvbNolANAoKTvPNsiGbIBgVl1+aGT9T13F44T0AHZd y2lJdVZ5yCWx93AIPYPym7eBTWwCw5+ydlHgCt3dlXu5TEZ+/P7RqsGtfla0RA== X-Google-Smtp-Source: AGHT+IH1n5rgepkFv+DmmmLViOZnDel/iUrOgLICLSZETgB3GeR4REJxlmdXw7sr6mA1VqvgfFFkzw== X-Received: by 2002:a05:6808:1990:b0:3c8:665e:1e57 with SMTP id 5614622812f47-3c9852c99fdmr89999b6e.25.1715099236642; Tue, 07 May 2024 09:27:16 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:16 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:13 +0000 Subject: [PATCH v2 08/18] media: siano: Use flex arrays for sms_firmware MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-8-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_172719_805488_F306FFEC X-CRM114-Status: GOOD ( 13.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace old style single array member, with flex array. The struct is allocated, but it seems like there was an over allocation error: fw_buf = kmalloc(ALIGN(fw->size + sizeof(struct sms_firmware), SMS_ALLOC_ALIGNMENT), GFP_KERNEL | coredev->gfp_buf_flags); This change fixes this cocci warning: drivers/media/common/siano/smscoreapi.h:669:6-13: 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: Ricardo Ribalda --- drivers/media/common/siano/smscoreapi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/common/siano/smscoreapi.h b/drivers/media/common/siano/smscoreapi.h index bc61bc8b9ea9..82d9f8a64d99 100644 --- a/drivers/media/common/siano/smscoreapi.h +++ b/drivers/media/common/siano/smscoreapi.h @@ -666,7 +666,7 @@ struct sms_firmware { u32 check_sum; u32 length; u32 start_address; - u8 payload[1]; + u8 payload[]; }; /* statistics information returned as response for From patchwork Tue May 7 16:27:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657470 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 CE300C10F1A for ; Tue, 7 May 2024 16:28:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NeruxJp++s2NcFSdstSug3PAIF9/9TqUukR2T/0X+9Y=; b=AMcrhMX9Jok4F9 bAGm7uO8Zu9ZCr02WumR8Ib83c0d8jegPhDL8tOpW8JLQY0GxSllCPkGA6y4/mymoDm4QDZQRXlSe QMMnCKBv8IRPwlh9XN3MNE/crsVOFdyhruDBsUrG+ZnyGZ8/QeCF14TxjM0afx0iUB1PnODS74O85 Zc+TtH0IDt6gACCCiDfpTYB4yIKJ7ioNGeBk3DihehC/1+uNOCZurrWTRSHHF7W2j8U7utPIBFhpY InBsMhKcSCcwUEGTv/VBRRs0t1Gya3D5OmiAt1zShrWlGWSi4a0UuZf1CNZC5P2D9obfUik5ZD6PS BpfZdSEpa+QcI5kBHQKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4NfX-0000000By7K-15oi; Tue, 07 May 2024 16:27:55 +0000 Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Ney-0000000BxYT-0LE0 for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:25 +0000 Received: by mail-qt1-x829.google.com with SMTP id d75a77b69052e-43ab76cac73so31118681cf.1 for ; Tue, 07 May 2024 09:27:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099237; x=1715704037; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=kaj6FcAMdKWO/HBrdvIpPTLyis7BoUMkhPcms6B+rAo=; b=e9JUsS3xlt09k2GHA/y91c0YugBgs1kuYWyyw1kabrdzeIZhUpBxoxmP5cF5/D7z4t A5swWpAkjdMMH/VsWqaSuG9SoclnARJu8aqGJ8Ms8a3ExihLV5776DSOvwp9tOpBVRM9 MbsKLSuLITTHnOgYoAuUVTFv2dGxjEcfOXUwo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099237; x=1715704037; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kaj6FcAMdKWO/HBrdvIpPTLyis7BoUMkhPcms6B+rAo=; b=twhFdxUyd2XUkq1/hrjJrDV8zif0vnzIQ/Z7jLgJl+0AIz/j+7Lmr2LPertxCJDCld huAEDhwRjRmnm3/XGRvDIMspdtCah+6dK/ZW7hyEZEedPulMLuJqwhnSsdOAM8gBLkGC MB+I9yS4l/2w5EdYK5b4lgg4OS1ttAaqU3UjnPYM/ZNs1uzq7lIQxT9R1TfAueDCgkYV 5zZ/2uoLzjx4XpMXLynF8G4xY7zdh+YPLgtLJiClN4hnv70hPO1Yew1PqMuzB2kkUfJ0 nRDUHSHyZwsYpErdiVohYS+dsYlr45+1R8wHMYS1Z9/j8OfZTiEhoWhNwFwRpcdgAsn8 /HHw== X-Forwarded-Encrypted: i=1; AJvYcCWV6Ta7JUW3ZncUy8XdNLw25c/NlTrDuMCeclcLB0UXs4KxpikNGwvlZbkp61yUD2IexPhlszdv5C5gMHc585uaukxV9YLb0WVInMg6KpLSJlT8Smo= X-Gm-Message-State: AOJu0Yx81y3UNdwHQW77001yOsWyiHCLmWeMV/ZAMQLokLaXoacMWQr1 xr68hizHd4cdpaTaQpaq2qFq6BQ0ntIowodvoOMx/46Sj+XA4AjCccc0fR7HaA== X-Google-Smtp-Source: AGHT+IHj6qoRnVnypcfsl4SMsq6a3QXSfSAsL/0HydIZfs+TT2QxcbwCNWNtumzYnUMZlJ9mwCoojA== X-Received: by 2002:a05:622a:2d5:b0:43a:b29d:36ae with SMTP id d75a77b69052e-43dbe00e35amr4071821cf.9.1715099237518; Tue, 07 May 2024 09:27:17 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:17 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:14 +0000 Subject: [PATCH v2 09/18] media: venus: Remove unused structs MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-9-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092720_244280_DADECFCF X-CRM114-Status: GOOD ( 11.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This structures are not used, and have a single element array at the end of them. Remove them. This fix the following cocci warnings: drivers/media/platform/qcom/venus/hfi_helper.h:764:5-15: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1041:5-15: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1088:39-51: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1093:5-22: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1144:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1239:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1272:4-13: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_cmds.h:85:5-16: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_cmds.h:180:5-9: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_cmds.h:189:5-9: 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: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_cmds.h | 26 ----------------- drivers/media/platform/qcom/venus/hfi_helper.h | 39 -------------------------- 2 files changed, 65 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 20acd412ee7b..41f765eac4d9 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -77,14 +77,6 @@ struct hfi_sys_get_property_pkt { u32 data[1]; }; -struct hfi_sys_set_buffers_pkt { - struct hfi_pkt_hdr hdr; - u32 buffer_type; - u32 buffer_size; - u32 num_buffers; - u32 buffer_addr[1]; -}; - struct hfi_sys_ping_pkt { struct hfi_pkt_hdr hdr; u32 client_data; @@ -171,24 +163,6 @@ struct hfi_session_empty_buffer_uncompressed_plane0_pkt { u32 data[1]; }; -struct hfi_session_empty_buffer_uncompressed_plane1_pkt { - u32 flags; - u32 alloc_len; - u32 filled_len; - u32 offset; - u32 packet_buffer2; - u32 data[1]; -}; - -struct hfi_session_empty_buffer_uncompressed_plane2_pkt { - u32 flags; - u32 alloc_len; - u32 filled_len; - u32 offset; - u32 packet_buffer3; - u32 data[1]; -}; - struct hfi_session_fill_buffer_pkt { struct hfi_session_hdr_pkt shdr; u32 stream_id; diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index e4c05d62cfc7..7c0edef263ae 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -759,11 +759,6 @@ struct hfi_multi_stream_3x { u32 enable; }; -struct hfi_multi_view_format { - u32 views; - u32 view_order[1]; -}; - #define HFI_MULTI_SLICE_OFF 0x1 #define HFI_MULTI_SLICE_BY_MB_COUNT 0x2 #define HFI_MULTI_SLICE_BY_BYTE_COUNT 0x3 @@ -1036,11 +1031,6 @@ struct hfi_codec_supported { u32 enc_codecs; }; -struct hfi_properties_supported { - u32 num_properties; - u32 properties[1]; -}; - struct hfi_max_sessions_supported { u32 max_sessions; }; @@ -1083,16 +1073,6 @@ struct hfi_resource_ocmem_requirement { u32 size; }; -struct hfi_resource_ocmem_requirement_info { - u32 num_entries; - struct hfi_resource_ocmem_requirement requirements[1]; -}; - -struct hfi_property_sys_image_version_info_type { - u32 string_size; - u8 str_image_version[1]; -}; - struct hfi_codec_mask_supported { u32 codecs; u32 video_domains; @@ -1135,15 +1115,6 @@ struct hfi_index_extradata_config { u32 index_extra_data_id; }; -struct hfi_extradata_header { - u32 size; - u32 version; - u32 port_index; - u32 type; - u32 data_size; - u8 data[1]; -}; - struct hfi_batch_info { u32 input_batch_count; u32 output_batch_count; @@ -1234,11 +1205,6 @@ static inline void hfi_bufreq_set_count_min_host(struct hfi_buffer_requirements req->count_min = val; }; -struct hfi_data_payload { - u32 size; - u8 data[1]; -}; - struct hfi_enable_picture { u32 picture_type; }; @@ -1267,11 +1233,6 @@ struct hfi_buffer_alloc_mode_supported { u32 data[1]; }; -struct hfi_mb_error_map { - u32 error_map_size; - u8 error_map[1]; -}; - struct hfi_metadata_pass_through { int enable; u32 size; From patchwork Tue May 7 16:27:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657468 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 9EB05C25B5F for ; Tue, 7 May 2024 16:28:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sXQiJjTM84JxC0wfuVBr5hJf9W/E/s5ZFdsaAZRhT34=; b=if9IDgnbGyYFXw 2GLsQBWVBX2BlcgKCEZJKycOMBxe+UTfvgXsWIu7wz7wQ0Uf7A4oAFkettZcs41WipfmaFkGVLsCT apyC0lVjjImVFqMLvJXGVCcSVQAtQaHIJ79MvjdBczphCgoeadZqc35zcuw/B09QsSrjU8bE61OPq o+44+uz/b2l9FkuJhzj1xZPnPj7+yiOKKWF6xcPaIkp45mPz0Tf/16nAMd8pmksQ79g+mZ32pMBJv yEJ8uffcYMMXN4itQM65bKY4aFSSMAMmT6xLH/CFaz++frOz+ergdQXMMNYxS/3rtDdZP3ErPIHqv MonWNEvItjfFVUGX0yJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4NfR-0000000By1P-0hki; Tue, 07 May 2024 16:27:49 +0000 Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nez-0000000Bxa5-02xc for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:26 +0000 Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-43692353718so23891561cf.0 for ; Tue, 07 May 2024 09:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099238; x=1715704038; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=WR87o59ttHnNvNigBqZHzwph/s3gT6BLw9Ga86sRtPA=; b=AbaA8ryjWlC1z+x8qPGMMY8j0yX4BKFRo7+hN+XcXAxqxR5e4gcWefenuA0d7xxrJY zHzR4bZyQkbIrfxKl1fbisVYnBtbwgqBzmiQ4bsqop3Bya3ia1qLK5M09qXBvAzh3vIw tmyOxMFfFbBLDYspfjRGYSC0awEulf3WG2mo8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099238; x=1715704038; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WR87o59ttHnNvNigBqZHzwph/s3gT6BLw9Ga86sRtPA=; b=A4p0aiPjumPUIgm2G0JPAflPps6C8ZAwvHB9fr7ISub4RbtKmEt015CTKLjUNrx7BX APoQxv7iEhTCuCg4RvnHDgzJy8M0Aeh7m5BjgrwU99Vx/6oZXq9AIeCPYVJ85dqpdCEL OhcnX5NSeT1UM6Fjg4yNPT94GECdWq6VZcehRWfrlnmxYHoUoi1OQehBT533MRazHkw+ ZNYQaWckZpbAFthRUdc6tVGefwpvVk7nyMO/2kXsDo4MsUe081VOXv8fJMVzdT/o1+QW ApUnGcCX4/hB2/b4bs1GKBwRTcC7Owk2oFhi8ehqq6bEC7gWLqUeaX6wy+gEEDfDCrrO Id/Q== X-Forwarded-Encrypted: i=1; AJvYcCXN8he29FGPqJQXJIsRYCdGYwPZ3kDxKMB3IN7/4gz5+MuV4M8va1VMoUhr5hlOtq6NCOhF4F3y/ETLJCtTsS5EdgBtjKRM9LkjBvJpA78IoyGJQvg= X-Gm-Message-State: AOJu0YzyGADZccinHxRWthCCMtAuJJeOoTn3ymJBy0qMQUzt/cFxJLTW U1+zZMHQ+pLTPpangKVOgXXvwitUsVC+lotdDN3K3VEfJjg0o7kUd1SSmI+wAg== X-Google-Smtp-Source: AGHT+IGBjH3AdmiLQTQFeu7s9S83R8vO1MeeESLv5H1A9n7OSdIiA2Y0rCHZA8aZ7JmFdPuh3j3q+g== X-Received: by 2002:a05:622a:1aa9:b0:43a:dade:7ad2 with SMTP id d75a77b69052e-43dbf51448dmr2415871cf.18.1715099238350; Tue, 07 May 2024 09:27:18 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:17 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:15 +0000 Subject: [PATCH v2 10/18] media: venus: Use flex array for hfi_session_release_buffer_pkt MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-10-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092721_911677_677A2443 X-CRM114-Status: GOOD ( 13.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace the old style single element array with a flex array. We do not allocate this structure, so the size change should not be an issue. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:204:5-16: 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: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 41f765eac4d9..6dff949c4402 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -201,7 +201,7 @@ struct hfi_session_release_buffer_pkt { u32 extradata_size; u32 response_req; u32 num_buffers; - u32 buffer_info[1]; + u32 buffer_info[]; }; struct hfi_session_release_resources_pkt { From patchwork Tue May 7 16:27:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657467 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 CB493C10F1A for ; Tue, 7 May 2024 16:28:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XGa3ThgN/NchEDnAYE79VJL/C2b2q73NN+/wpuxb0no=; b=g+9NvPCLi3otGx 8Y11w3q5aSW4wGkhkq5M/pfj/f/AcdQ64Qf1j7lC4zVklYeoELzYsOGCb5p3ny+A4UE3kEPEwh/lF 8kwldAIkeyDu0DARKKeeB/mqmmYD3vzW1Mi4WWbG7V2ZYLvP2DcW/tE+m9Ovgzic8M4WxJEjXY68b xMWh8gG871gBvGnIkpC7fDk32lPBVXd/O2MgRhdHt3jIY/KJmSVoQN8/BWXImBJiMsO1k/ni2lsVq g4tBjzF+DwHiqSPlskZSovOUFYNxalJeJ+WEebiUDWIoDqEmJsS9izpCHlAw5fhc6o9uayH/eXxZw eNLBpjJFjr6V3flCy2Xw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4NfN-0000000Bxy4-0Ib3; Tue, 07 May 2024 16:27:45 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nf3-0000000Bxfg-0Ox2 for linux-arm-kernel@bombadil.infradead.org; Tue, 07 May 2024 16:27:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=sqFGKWXdCy9k153fMpH4CQDZP31MGLQ/EHV/2T77xUQ=; b=MXqEzA5npbAczots6Pg0UvSKpl 3tv/xGHuFJdygj4acBT1d8T4YWeo17tOEnV7fiNn0LyG0LuMrGuWG7Y0/mCnvG3e9xy/TJ91I8cJb wFushET3wDIEz8oBuoRdR2iBKZMP3PqMBlAyp25iGRmAjqagJBwkHXTmiDcS/uASQxXdqhoEwL5MB SRbsIKloS30BiWr2m3gzLv3NgyjzMcyt/V4Z7vMnuRVCQrmgf7mNGansuwV+kfLDj8xZA6ZTpqK1r dgHpA8HEWkREydKlakhf52/4N/AuIU3X/+PGPs67I6TV9iEx/RJ1GY3r43o6EXbktg5aVYZm7k32X crBRb9VA==; Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nez-00000002AYQ-1XWl for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:23 +0000 Received: by mail-qt1-x834.google.com with SMTP id d75a77b69052e-439656c1b50so18592191cf.1 for ; Tue, 07 May 2024 09:27:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099239; x=1715704039; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=sqFGKWXdCy9k153fMpH4CQDZP31MGLQ/EHV/2T77xUQ=; b=mC9KWfJWwJitmq42yxKFVGbfHTLZXOtNjhUoTHKKSoqWIV3qwlpOGr4CkQa09WHCbW h7bqe1kZdUC+x0elmjTYV18lmCqj463MBR9TjexzcO/w+fr/9cUiJRTG0J5N/xNO50uK b7x83rO1pJmL2P1hr/Sk6YPXxtD5QE7nIZj3k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099239; x=1715704039; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sqFGKWXdCy9k153fMpH4CQDZP31MGLQ/EHV/2T77xUQ=; b=kMAYLKbI+RlyFzowXrhMF3oE540tJSd3uLb2XaH83J9VCnTG0+U6X5F6WtUWslB5Cv qTqOnz8pJAAbKqHy/lysovf80Gt+rSGCclfrgVmRFE0C3lRThhI8V7+h437tzFMlVjDD gGSPxor7TvHBlWpdUK+egwS9u8bVzTi9YQQ83cYsKNuba6Yk+/bJNGCBhVjYmjVu+A+E JSnmIrlVjXpOZDL5zgC4ZLPd8Mw4QfkgG1Uj9Hrs7NPdIc/C9Oc+1fbP1pmnj8ikWl+Q SktwyGpAhu6LCWuOOwhGj5w4vSVnPYaqgQUjciJAuDh/Rv8ess15uyoOhk11OgVRp11/ Oydg== X-Forwarded-Encrypted: i=1; AJvYcCXtx+N4sNxp5PHt9TagOZUzVN9YCkgH2I62zvvJTFEr6oHE67MClM8NTWM528EELIxkWfwWOYk0sJuPh3YSlxKKt4e2OHOkCMa/VxsgetlCtzryWNo= X-Gm-Message-State: AOJu0Yy7sfGTXf8gsK3DekaNPBqIN9lsgWahrHBRgG6Tz5mC7gm0r9e2 2iiB3fwLu+9DTVcUtRe+HZp6tTL1765z6rYr7aIhzaoTiietuvYQMxbKptdvmw== X-Google-Smtp-Source: AGHT+IGXgstEE7t4iz9TrxJ0NJkr1ggK5ABmNVeWRW76pFKi5ar58B4xxCSQc/Pi6zqHMhxLCg5DXw== X-Received: by 2002:a05:622a:301:b0:43a:c878:d7c6 with SMTP id d75a77b69052e-43dbf0bb523mr2235441cf.66.1715099239035; Tue, 07 May 2024 09:27:19 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:18 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:16 +0000 Subject: [PATCH v2 11/18] media: venus: Refactor struct hfi_uncompressed_plane_info MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-11-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_172721_578398_D609DA10 X-CRM114-Status: GOOD ( 15.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This field is never used, but if we remove it we would change the size of the struct and can lead to behavior change. Stay on the safe side by replacing the single element array with a single element field. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_helper.h:1003:43-60: 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: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index 7c0edef263ae..eb0a4c64b7ef 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1000,7 +1000,7 @@ struct hfi_uncompressed_plane_constraints { struct hfi_uncompressed_plane_info { u32 format; u32 num_planes; - struct hfi_uncompressed_plane_constraints plane_constraints[1]; + struct hfi_uncompressed_plane_constraints plane_constraints; }; struct hfi_uncompressed_format_supported { From patchwork Tue May 7 16:27:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657469 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 AFA5EC25B4F for ; Tue, 7 May 2024 16:28:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=z/FRoWxHms4MsWOTS+cPrZpjxWrYPm/tPR1ciC0aCZ4=; b=SUPHDFe8igCyWV P8Gi/i6S3Xxa2u6wiWga/yZF0CFh1vewddioR73rmfoGOOCq9T3zaB3jIzV4VwEmIqEbTvC0bZlyx uvBIph6Nw6KYHzzu+Gdu234EnM5crVrxlnlLz3wITXYoQL19gMm9+3CxlhC2RyCnBQcO6W0txq18p yUeyajusTMPTKT0QBnvryQTGzzoGzHYHKPMCD/BczRJF+6Gxspfhhv8e9+sXz4lbUDYB55Tl5vuST wH0PtpkBXZdwAQWn1P7F3l5PpSCl3yxpZNSFTEyCH8sGPsjdxHNS7qRcvRXqnXz2tat0+rLJ8V5PH onVTc8Nb4AFkFQVHWH6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nfc-0000000ByCE-2Leg; Tue, 07 May 2024 16:28:00 +0000 Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Ney-0000000BxbK-2urV for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:25 +0000 Received: by mail-qt1-x82f.google.com with SMTP id d75a77b69052e-4349685c845so19822131cf.0 for ; Tue, 07 May 2024 09:27:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099240; x=1715704040; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1Dzq1v7dj+VBVNk1zZzFNzIZj2cxfHYcizI+MBp1ZX8=; b=IlX13k0va5v+er7s3Rvwnsr8qXhc4QtcXtXm5v3DuORNFNqjSYOoCWgW++1cnZY+NA dQL7r3TFSaJLBO2r0ZQjZIcUQgd5T3NW9S1BT8hbmN82bXm0WTWE42MooIMGBPKX4zXe yx95aD3WCUftBdVbDIWAkZtfsq9vYlU54a3tE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099240; x=1715704040; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1Dzq1v7dj+VBVNk1zZzFNzIZj2cxfHYcizI+MBp1ZX8=; b=nCyay//2qhIAoo3E+1nRV+MMSGExvVPdZGBE1rfK4Y9LypZTVOAGS0BZHrlaMROIn/ AfOEqwRce1xBQtbtN4eKBA3mjbCLi2Mudb4NNSUD/pKZU3HZxe5eUvwfe4zbpZWxB9LZ mvm37pvYr0+50ixhSCXKf3VoApXpxYuqzznK/w+Gu+Ev7gPIxEevsE10GM8heX7zz7B3 kINcKOtlza8z+a1V+QISzNoE9mWphvw+24VvXoyv066tXMM7ragXtq5yo/ljwK+/eqWl 9KiJ9HtzKeWCoBAMPPtzbIPmZ5q4RTIQvDnNgakeZ9EivWulrj0aqd362UYZdRs77Hxo sQFQ== X-Forwarded-Encrypted: i=1; AJvYcCUfJ5XjNYWfJ2AhdNCdSdEWatmamEosJ90J/I/tIrl5XO/kvreQJEMmLBz/E2boR6Gwcq5ShVkeEsiCZYqZ/HsT6EKiPDCxGWQ6jzyS8qi9ZA2XYcE= X-Gm-Message-State: AOJu0YyFktZCYeO1rBTFOXNW1BF3Gwv26Cyx4AyKQ9HnqmGRxpkSLbwt rjsd45jxZuvjIcqJpYGB3OlyAwycyOQ0h/Fgg5GGjlMnFUn/0H0U7SD+dsCUww== X-Google-Smtp-Source: AGHT+IHXb5fqM0+WhwYErzB4YNZEKLztS54+R7oGh+gtQ5dv4ZRmegXN7RcfrH/DsD9yhahUSJeC+w== X-Received: by 2002:a05:622a:50a:b0:43a:829b:a32f with SMTP id d75a77b69052e-43dbf754b18mr1904941cf.66.1715099239735; Tue, 07 May 2024 09:27:19 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:19 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:17 +0000 Subject: [PATCH v2 12/18] media: venus: Refactor struct hfi_session_get_property_pkt MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-12-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092720_965292_6E0C041E X-CRM114-Status: GOOD ( 15.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The struct hfi_session_get_property_pkt is always used to fectch a single property. Make that explicit in the code and avoid a single element array at the end of the struct. This change fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:194:5-9: 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: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_cmds.c | 8 ++++---- drivers/media/platform/qcom/venus/hfi_cmds.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 3418d2dd9371..520ff8a587e6 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -401,8 +401,8 @@ static int pkt_session_get_property_1x(struct hfi_session_get_property_pkt *pkt, pkt->shdr.hdr.size = sizeof(*pkt); pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_GET_PROPERTY; pkt->shdr.session_id = hash32_ptr(cookie); - pkt->num_properties = 1; - pkt->data[0] = ptype; + pkt->one = 1; + pkt->data = ptype; return 0; } @@ -1106,11 +1106,11 @@ pkt_session_get_property_3xx(struct hfi_session_get_property_pkt *pkt, pkt->shdr.hdr.size = sizeof(struct hfi_session_get_property_pkt); pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_GET_PROPERTY; pkt->shdr.session_id = hash32_ptr(cookie); - pkt->num_properties = 1; + pkt->one = 1; switch (ptype) { case HFI_PROPERTY_CONFIG_VDEC_ENTROPY: - pkt->data[0] = HFI_PROPERTY_CONFIG_VDEC_ENTROPY; + pkt->data = HFI_PROPERTY_CONFIG_VDEC_ENTROPY; break; default: ret = pkt_session_get_property_1x(pkt, cookie, ptype); diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 6dff949c4402..e1dd0ea2be1a 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -190,8 +190,8 @@ struct hfi_session_resume_pkt { struct hfi_session_get_property_pkt { struct hfi_session_hdr_pkt shdr; - u32 num_properties; - u32 data[1]; + u32 one; + u32 data; }; struct hfi_session_release_buffer_pkt { From patchwork Tue May 7 16:27:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657474 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 9EDE7C10F1A for ; Tue, 7 May 2024 16:28:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+/Yt5910Y+odXkH1kkFE9ce8p4Rhtm1vAAvEtt6lXE0=; b=olRCzKYzM1GXX2 NcJhloAkaGMqrZ4koXL4rjKlwirO4YO8EfLJOjy2/n3NseWN1aAOcu3A/Nb2fm+KuiSDOOq46TbLr mmntpqV5OKQ5R9W9659+yvzJaugqZQOCLl7C3ZRE/7lOG+gNFKH6Hpc40f00PlkEyP7RAMEWlEyZH 0DaOBpTx3+KsGROG10WD74at1ynbQ6GyKShR9ziqyY9bQgpJtcGRPaJ9SNg47OyFuG5KI+fXH/W86 ovrAz/kB7Xm9LR8CuLg5n6nzugj06Cf6M4BhLY81XOmO61X66h8FSsd50vONePShR9Hfbg8006bhB xvCzlL4hxBSFXPFD0Rmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nfn-0000000ByL2-1Rro; Tue, 07 May 2024 16:28:11 +0000 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nf2-0000000BxdQ-10vZ for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:29 +0000 Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3c6088df378so451358b6e.1 for ; Tue, 07 May 2024 09:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099241; x=1715704041; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=grfwfbVNg0FYwVP8zOHueia/jYu69rJdnTVnLodDO7c=; b=njKMLf/RX12jI42zcMQfBcQmjfFiJfQbnRy111n4GzQbrDeAXUME8DGtRTeEKsjjMK X7ydPMxATZ/woxY++bQqjUq8sqxPIe7v+w+9nT00em5HDSwFrD6tZ9XzxSIrxdaByxuU KIXCPUDq7enO+ImnKh4nIaU9JgccDSJfQFN9Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099241; x=1715704041; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=grfwfbVNg0FYwVP8zOHueia/jYu69rJdnTVnLodDO7c=; b=rMPDPdAtPpU+6jyiyP+a3HSu0RG3d8i9ty2joYpzkBL+iKyg5gtqextXaKPG7TinZN XIckBmxKZz2qujQwta94vHbruVt09R2VusrRYGJBcNHRRDHWGWd1cZQBVDImVu4nC4Lb DyRpnNfz9FMhUlg1O8ZI6JcNjstRxujWnYrqLG0uBzPXmELtthmMPRUvVgekequ/Q43j lgY5WRPizGttqT4sRgRoFX6a5ycToEJ4h3bPUJYhYxON6BZkwR/9WXgLssP7w5dJwhGK JwMKTv5hmKKwqCn528xvcikNO8Fqeey+uoj9V577G3Yip0/rsyHn0ISgwxlcsVnlX3g7 vqIA== X-Forwarded-Encrypted: i=1; AJvYcCWhXyNMRScr4b2LZwqJybbbhXsexXcQmlaxVSOljb5RKgOLj23iAkWNRNlYzawN71D5skqkT0zRAXCmPpJOuoKpZtGmOubn+SSg+fHCLOj/LrQxxRY= X-Gm-Message-State: AOJu0Yw7V5JH+fXxzA0KqovdWt03KzGlxrYRaie6PLmdy3JAHKHA2rlF FmWPUIf+hwcEG/b8Fx2n8pDrPclZ6L4s9rKJBUCFswliyqBS2cn4tePqJI2g+UqiJApbIGCLetc pLQ== X-Google-Smtp-Source: AGHT+IGh8pK0RlJouH/fYCBI41k6wvrr3zRYdR0ye3qSLW9c+wx7vH7WZyfMG13hJNctWTluPMz8Sg== X-Received: by 2002:a05:6808:617:b0:3c9:7593:7613 with SMTP id 5614622812f47-3c98529bf00mr82279b6e.8.1715099240437; Tue, 07 May 2024 09:27:20 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:20 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:18 +0000 Subject: [PATCH v2 13/18] media: venus: Refactor struct hfi_uncompressed_format_supported MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-13-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092724_587417_154516C8 X-CRM114-Status: GOOD ( 15.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org plane_info is not a typical array, the data is not contiguous: pinfo = (void *)pinfo + sizeof(*constr) * num_planes + 2 * sizeof(u32); Replace the single element array with a single element field. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_helper.h:1009:36-46: 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: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_helper.h | 2 +- drivers/media/platform/qcom/venus/hfi_parser.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index eb0a4c64b7ef..dee439ea4d2e 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1006,7 +1006,7 @@ struct hfi_uncompressed_plane_info { struct hfi_uncompressed_format_supported { u32 buffer_type; u32 format_entries; - struct hfi_uncompressed_plane_info plane_info[1]; + struct hfi_uncompressed_plane_info plane_info; }; struct hfi_uncompressed_plane_actual { diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c index c43839539d4d..3df241dc3a11 100644 --- a/drivers/media/platform/qcom/venus/hfi_parser.c +++ b/drivers/media/platform/qcom/venus/hfi_parser.c @@ -157,7 +157,7 @@ static void parse_raw_formats(struct venus_core *core, u32 codecs, u32 domain, void *data) { struct hfi_uncompressed_format_supported *fmt = data; - struct hfi_uncompressed_plane_info *pinfo = fmt->plane_info; + struct hfi_uncompressed_plane_info *pinfo = &fmt->plane_info; struct hfi_uncompressed_plane_constraints *constr; struct raw_formats rawfmts[MAX_FMT_ENTRIES] = {}; u32 entries = fmt->format_entries; From patchwork Tue May 7 16:27:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657473 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 128DAC25B5F for ; Tue, 7 May 2024 16:28:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IVa5QhugHk8RKpbCNnzp0FkqGubqWd6vDvaRKuCi8Fs=; b=VB97TIwZdcj1AL s8Q+h2uTtFMovd59KUevaVQawe90SYI0MCnR1AjM+MtPe83V6wOxo+DiCPnzt/naVjQQRWGi4zGn2 99S6WnNns64fmSdG4wdlnjeeDgAaXOJg374caqLV9cKAlAvYz9ypW4jRXu9Q3QKLV/mI7g2elPa8X vvphMiafAEUPppQKCoRn3zZYFZwp+f069jG10UeFqCNhuJ0pJruJLhjpnp7FRj5LIBRRCu3KImKF2 591xVm57Oqu1DkyO4ler3YEw0ThxTc5qw5+ykqExNCyRNJgYm3qebEzERjGPQtlNnXplQHHBwPw9A 4IGg5oOuwtghGxzhoMmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nfk-0000000ByJ1-2e3y; Tue, 07 May 2024 16:28:08 +0000 Received: from mail-qt1-f171.google.com ([209.85.160.171]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nf1-0000000BxdA-3zdP for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:28 +0000 Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-4349685c845so19822281cf.0 for ; Tue, 07 May 2024 09:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099241; x=1715704041; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=7NkWJe8JlogUB1KQ6tzpQTV71nluZthbO4z82dt8idE=; b=P9Le47vIq/l0DAPgYP3aJ0ZnbjyOZZ/h4RwaqmLY2mpsW21SOq4OAx/sdyMWwrXv/U LsNaGFEwTzQux4ZsI5gzDGoEtv3iw8rUSx9l0+NIj2oXMBSNUsk4GQH39U2ReccKBZ3S bzCKnTXQQkwG++tHBmJNjNDQgRA/r72SmIlV4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099241; x=1715704041; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7NkWJe8JlogUB1KQ6tzpQTV71nluZthbO4z82dt8idE=; b=osPkXvjZpC52yPxkKWg7CtT79lXtutccGZTimvr0GoBos2Ri3drLkEdE1uIxWXdXsy OIREj/X40dfRqURIOF0sQwdqa7EgrfE7kdcXJNI/7sYF3vIOTFvWXJr58RHpS21J5H3y dWeCqOH2haOF9pKtmZukOl4q8pRoZlo0tXH+5fCR/BFYMnxqNjN7dMqW6RCCoCv6rvTb FrcU115Tz9WFfpB5KO9kBdBgUGNA/3Fo6qsBXR5/PWX0/1iHVRj0bskM0XIn71eNIYB8 5LACkY1MpQJ7NdQeP/PFGo8VJyRnhh7TEMv+1dN2n6uTqPY6DtE83I1hLK4ZuYl1Ei9B z/eA== X-Forwarded-Encrypted: i=1; AJvYcCXkDZVKoEa6ui4xcKqvENsjAYQHAknP2GIoz7TK06xMLdOTLw72VlTzs5FctvuiEQWCDlGDR9OUwUlFoPon1euwsrncNGgsnP50RvddemYZDBa9CME= X-Gm-Message-State: AOJu0YylzA6FS1lz6HjubM+L83grzxsUr8ZFOkkCkrWCW30xDeFeThQy hksydG+cqbMfKlGkhOe4v1cKS5uXescZIuR304D5ICEUgTPUdzmb4uXTYJKw9A== X-Google-Smtp-Source: AGHT+IGy63ktMUcef0pl0O/LB4NVLwAUnrH80knXHLAZJvTEQKiy8Aq4N4cNRIawlD7kkWl28ecX+w== X-Received: by 2002:a05:622a:1650:b0:43a:f441:b3ac with SMTP id d75a77b69052e-43dbf4e70d5mr2464831cf.32.1715099241340; Tue, 07 May 2024 09:27:21 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:20 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:19 +0000 Subject: [PATCH v2 14/18] media: venus: Refactor hfi_session_empty_buffer_uncompressed_plane0_pkt MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-14-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092724_131465_0FC17F2C X-CRM114-Status: GOOD ( 12.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The single element array data[1] is never used. Replace it whit a padding field of the same size. This fixes the following cocci error: drivers/media/platform/qcom/venus/hfi_cmds.h:163:5-9: 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: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index e1dd0ea2be1a..15271b3f2b49 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -160,7 +160,7 @@ struct hfi_session_empty_buffer_uncompressed_plane0_pkt { u32 input_tag; u32 packet_buffer; u32 extradata_buffer; - u32 data[1]; + u32 padding; }; struct hfi_session_fill_buffer_pkt { From patchwork Tue May 7 16:27:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657472 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 BDCC6C10F1A for ; Tue, 7 May 2024 16:28:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=t0grvpGCTC4yCBEENJxAX6sjSiO3dIpCfA6xuJh4mQg=; b=tQA4hzXjLWQ3yp m+j9uvjNoJB999V2Hqsi1JvtGrA5BmbVViW3v1bM87nwx+J6bAr/t29NtnF2aOsIw1jdiy3oB02Wu 2MU6Cteeowiu7UlQXzFSjinmM7A8ReP6eTWo1ltTX2vDjfituG7kZRTA7K/VpipmZ0lOUeTTREza2 3neItCDGWgb/YkEVdQSuCOfMbfAh52AzN5EUxxiKMUQCVxmNf4/T4d7vT+Mu0m9jaXJkys8SgP0jw WomjGjpn6/1ByZZvQXgWhrI2oozbYEpfGIDMFni3OUdvRsBmeib77+viPsvaLptW0fBGf1T/uFQ5Z 9/Z2MPMRzrjE7GT03y1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nfj-0000000ByHC-166C; Tue, 07 May 2024 16:28:07 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nf6-0000000BxiX-1mOD for linux-arm-kernel@bombadil.infradead.org; Tue, 07 May 2024 16:27:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=ksOWhtvDjU4SOAc5LYb/tmHPugkENGAwplW75xl0q6I=; b=rVR4c/8cagnspzuxjXdCc/q8B9 B5cRTiibUfArrzTvR3wqOZskNBQJRHjjd8yjHNJuB3ZbKZEHO2SnxJkN8YizlNpmLkq461vA1cbAU EFOZOCPWR0a+oohyaYsxpFZoxN3+44YD61GCmMnuj+T1F9Tu/yHF8/NU3Y06gUJh1nowVKp65AsHJ ypbGutuwV/zArbGT5HjYpBdnr/lC0zusteKab49jc9r0LedhSWIf5Q9aO5G04KnOBpiJqQrCQKbKj K1y70ATPz+N0WWi5KTxHydlfZgwx2+hKm8A5FG+UfqKv4DbcPLAE9zelKfpPQDBtg6ui4NDxQZ8V1 gVzelC7g==; Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nf2-00000002AZG-3K6v for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:27 +0000 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3c97a4857a8so603475b6e.2 for ; Tue, 07 May 2024 09:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099243; x=1715704043; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ksOWhtvDjU4SOAc5LYb/tmHPugkENGAwplW75xl0q6I=; b=RLmu+a9FmhyjgQovB2QVNRcUqaUorw4R7JkXPDHAqWFS4eaJGfR3qZQ9F+OFK9z3cX KfA0Z2L0CacuwIHr42hblm+h0j49EGw4U5mN//lZjoAMj5LB9pohDphgxj56jHtZkEhf q7oDcCNiYm01nZd5Oxt1kpiVNU4wZIYGQ7dFw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099243; x=1715704043; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ksOWhtvDjU4SOAc5LYb/tmHPugkENGAwplW75xl0q6I=; b=BXqKeVUIqJp7cVZLr1sndurwpzG7a2AjnNNQ/EvBiBT7xFjafLis02rdyyPgBS+QBj vu2uQ8/NyTKqVv7GMIYBUIVNR11eOHS1yfwaKUAPa9jPlbE4CCKelzChkpXEdiKhC9Dy aMQmJ6r4mKR4qCSE5JpYgroDKSRsT6nx77YjYdB3CfgcU/7ub432fQSpkZAQTOqHfYAo 1x61N7hAIgmkxIphiYfRuyks1kZ9kz5x3F7gEO1YXFTmIhRQa/wQ8iLU2hZzwwkhcQXj icTopQFV2T1W5CMwG4Jk3cCIFd26qKeqbeo91k302oMSf0DtxYgxMkB1rHks7wSOZaka O9xA== X-Forwarded-Encrypted: i=1; AJvYcCUtbiuHPTO0cNYgLUZTKAjGRTW8cyFP9058bwuEqfi7FVBCi6BV1PwbWuACsEx1ByeDV/DRCeWEFf1GWk/Orv7XQL+rueWRAzbed9Qnwj4ATM6rtS0= X-Gm-Message-State: AOJu0YwjaTw5UonKh08e+D36RVyA6Tj6ZAAcDyFRvGDeb9pTmalu+S8w ka0nrSidv68uInqD0SVp6ivKc7ESE2UASNhHMRhfX27KTn1AWh+mHKTjOcBBvA== X-Google-Smtp-Source: AGHT+IHvsozzVLWdoiBjQEoTd85TRkr6VfUZ3BRsJ3jAW62XAs6ZO3NhOM6uPqcyccfc0QM2jKHKrQ== X-Received: by 2002:a05:6870:c392:b0:23f:eea9:ae74 with SMTP id 586e51a60fabf-2409915a7e1mr57362fac.46.1715099242010; Tue, 07 May 2024 09:27:22 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:21 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:20 +0000 Subject: [PATCH v2 15/18] media: venus: Refactor hfi_session_empty_buffer_compressed_pkt MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-15-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_172725_138525_9348D6F5 X-CRM114-Status: GOOD ( 12.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The single element array data[1] is never used. Replace it with a padding field of the same size. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:146:5-9: 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: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 15271b3f2b49..02e9a073d0c1 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -143,7 +143,7 @@ struct hfi_session_empty_buffer_compressed_pkt { u32 input_tag; u32 packet_buffer; u32 extradata_buffer; - u32 data[1]; + u32 padding; }; struct hfi_session_empty_buffer_uncompressed_plane0_pkt { From patchwork Tue May 7 16:27:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657471 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 36629C25B4F for ; Tue, 7 May 2024 16:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=46D9IXQ0Wufn0Itk0GGfVnxOrfwvMSl2JJ+vj8ugDgw=; b=h1m1KeolpmZY3Y zitrJ3ITXE1u5SyMA1X7O0uRjje2RrXUzPXAFFZyonR9bZM/8IikWrYhO/K5NoECiKd7/Ga9mnJ4A jqaVKt5M/1QunFE5K2qrqetjhBTAtj7yIOwsSeXq1jkRmumpF/VPBAcna3BIZWPcFPCqhjn+fQuMG Dnk95oUdyE3HsGSEBK1HQUvCABD0I3biUXICDRkpeZTGrUoM0aVwwoVby+dJ/iOUkrDfvR6KRuNi6 f9I/GRPtMSKJngE9ud8SEXvN7tEpdh/dG4Xe2AQBMNtGvZStuBGE8LVn0VVIhxkk2wNjmadYAT/nS EWL10YQq7Z1jIf79WgYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nff-0000000ByE5-2we4; Tue, 07 May 2024 16:28:03 +0000 Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nf1-0000000BxeQ-2aVP for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:28 +0000 Received: by mail-qt1-x82a.google.com with SMTP id d75a77b69052e-43d2277d7e1so12882161cf.1 for ; Tue, 07 May 2024 09:27:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099243; x=1715704043; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=AxOzymIGy9oIqpVIjgGXcOBfnvf3rPmoINBWnjxn4+k=; b=nWo6B2DY+ikAvpuYLc2SrVfm+AzLNgpLduml/N7MaKUyk0yOrPtfcMW4hDLQK5kRQh 5YMVeXXZgWp+ALyEUqGTaMwSEY+mQXnksUik1Figlkq38Hx5lUV8zLD1EO76oDFCczKE m9W75c4wr9Ih0OBl4Rz6y3qZTSCJrHXwctqQA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099243; x=1715704043; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AxOzymIGy9oIqpVIjgGXcOBfnvf3rPmoINBWnjxn4+k=; b=cd+n2P8CkWk6ZA6XgnplgQmssqDT6Lh6OigWHAtMNVKlD5BUaE/vPKGdvGKnezeOfM 2/QJXXvTa7/OqFhYDdSXCTOx8ZduSqkUPwqhMWkmjWookHA7kkvUC7cqgdklIYbJkLZN aqfxo6kuCdSAHAHDNNQ82FFTM2wTefRRfcTAKfG1poUB0cXrqRfgUM8arjTdojeEjmK+ ny8HiFA0Kd5xQbAN8Io2aIxSJ+K9ksiNHaZzIOtHciwl9dQYzthabAa8/wVvw7opKyRW yYocCIVZyxkBIG/y+34tQSNtxppJ30uQ91TnheSkY6fl4w+sUX7aQciSkteazxxf82Pu 76aA== X-Forwarded-Encrypted: i=1; AJvYcCVviUBrkkCfRGCQ0zBn5xfqAbs52Jf9vn3WcAxG23J0tglKykOr9goLLpdWKCDdR1tMrMlpktKiH5LA+KFO5nkpBHZA4Ccb7vK1e0QkQCnmZH0ELig= X-Gm-Message-State: AOJu0Yx9A4AugeKOrS1Qri64kCoxJENWo5/CdhVdCyL4LCy7E+1CFiqJ /4Op01NsB1z6jRcFBxTsKIRiWsQkdI+fZXNrx0JTCZwiiOX2dCx76pybmyzpLA== X-Google-Smtp-Source: AGHT+IFMJpzLoBuvnKke7M8L8J1XyGnz4DA/DXF7pnXaUcfUvIroWGA26PbBGScPt2HZrKUNAeWChg== X-Received: by 2002:a05:622a:40f:b0:43a:ecfb:8a5c with SMTP id d75a77b69052e-43dbed33436mr2631381cf.40.1715099242710; Tue, 07 May 2024 09:27:22 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:22 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:21 +0000 Subject: [PATCH v2 16/18] media: venus: Refactor hfi_sys_get_property_pkt MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-16-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092723_741749_8745DD02 X-CRM114-Status: GOOD ( 16.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This struct was only used to get the version from the core. Make that explicit. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:77:5-9: 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: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_cmds.c | 6 +++--- drivers/media/platform/qcom/venus/hfi_cmds.h | 8 ++++---- drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 520ff8a587e6..c5123f2e76fe 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -151,12 +151,12 @@ int pkt_sys_ssr_cmd(struct hfi_sys_test_ssr_pkt *pkt, u32 trigger_type) return 0; } -void pkt_sys_image_version(struct hfi_sys_get_property_pkt *pkt) +void pkt_sys_image_version(struct hfi_sys_get_version_pkt *pkt) { pkt->hdr.size = sizeof(*pkt); pkt->hdr.pkt_type = HFI_CMD_SYS_GET_PROPERTY; - pkt->num_properties = 1; - pkt->data[0] = HFI_PROPERTY_SYS_IMAGE_VERSION; + pkt->one = 1; + pkt->version = HFI_PROPERTY_SYS_IMAGE_VERSION; } int pkt_session_init(struct hfi_session_init_pkt *pkt, void *cookie, diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 02e9a073d0c1..cd7902743f62 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -71,10 +71,10 @@ struct hfi_sys_set_property_pkt { u32 data[]; }; -struct hfi_sys_get_property_pkt { +struct hfi_sys_get_version_pkt { struct hfi_pkt_hdr hdr; - u32 num_properties; - u32 data[1]; + u32 one; + u32 version; }; struct hfi_sys_ping_pkt { @@ -239,7 +239,7 @@ void pkt_sys_debug_config(struct hfi_sys_set_property_pkt *pkt, u32 mode, u32 config); void pkt_sys_coverage_config(struct hfi_sys_set_property_pkt *pkt, u32 mode); void pkt_sys_ping(struct hfi_sys_ping_pkt *pkt, u32 cookie); -void pkt_sys_image_version(struct hfi_sys_get_property_pkt *pkt); +void pkt_sys_image_version(struct hfi_sys_get_version_pkt *pkt); int pkt_sys_ssr_cmd(struct hfi_sys_test_ssr_pkt *pkt, u32 trigger_type); int pkt_session_init(struct hfi_session_init_pkt *pkt, void *cookie, u32 session_type, u32 codec); diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index f9437b6412b9..745c2c0c0d55 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1142,7 +1142,7 @@ static int venus_core_init(struct venus_core *core) { struct venus_hfi_device *hdev = to_hfi_priv(core); struct device *dev = core->dev; - struct hfi_sys_get_property_pkt version_pkt; + struct hfi_sys_get_version_pkt version_pkt; struct hfi_sys_init_pkt pkt; int ret; From patchwork Tue May 7 16:27:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657475 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 0ACB7C25B4F for ; Tue, 7 May 2024 16:28:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PgS0DtdRe4cXNtmNJKJcPLwOal8073jJHJmev6VcxvU=; b=3VomhGOsdkA3yB AkoMLQB1dOPc8IW4GKHZgavMKyun56dUPGKlAsaHwDSXLFcTue6VZw25RpC/gjz36Gs5NwnfCwxWk u+qPe+fayXDc9c+no3dx3BKeNE5hFjfJBQcW+5jGGNOJLhw+OxsGlaBPiSsx5lvrtxXFd8pcnleaG SzmWTPQBBGGzVoTg+rqI7A4DML81XTzLr1VWjJcdoMTv3P3QzwPQIXTk+2iXR+5vBYOz2FD5ZB/H5 BOdMGS5z1KzRJMhXaSw1k3a9mqGc0QTgv1q8Dd/MIbDyMwSQaaZWXgA3ylB55KYBmMmXFRnpYmSor f9oSVkbaS6iBGonOh2Gg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nfu-0000000ByRU-3v3s; Tue, 07 May 2024 16:28:18 +0000 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nf5-0000000BxfN-3zXE for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:31 +0000 Received: by mail-qt1-x82e.google.com with SMTP id d75a77b69052e-43ab76cac73so31119691cf.1 for ; Tue, 07 May 2024 09:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099244; x=1715704044; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=LytlgeivFEVadVFPCSFVFsEkz0aZMS5bY0SwfM06VYA=; b=alhL6So3Yk/3pUugYykO2uZY9YF4hpeR0Z3CaVtWnkTf74RbXGYnWC5Zo6vYQi4W1B ekEcvS75RbgT8VAEDciB4ImYVsnegq1kU5v77s4apAhNfx3/DOog4kheeQGC/yXZLlxl aenUclyOJ/VT2P+j7DuaewRFTnUVnifHUDLPo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099244; x=1715704044; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LytlgeivFEVadVFPCSFVFsEkz0aZMS5bY0SwfM06VYA=; b=EMS1RIMhOUs28EQ1CxBRDJZnepcF6TQ4whuAdfk1HEK5s1RTybSJ9mqEo5i9ulQHQu j5li0tOAs6zsOp4mzlf89nBa+1mT1ULaSaT26ESJhwX8l2S8tH6it6r07x/uPC55KCVE 54VUF3xLre2MV0V9b3WlyzNwQ4LaAQ2Q9gjiS1QpDhI42Ze1FzjM/ondfaptnESUU+u8 kgv9S5mnALTUhaB0EWVaG4tjGOzF60rsgSPa/JDMACT/44r4wWjtHqYQ4hOEukzh+tZ7 mN6BzxCB+rIV230Tg/pudn2Ulekny7lTj4HSjKMSMvKmric6xzgvYk3wMfCwcBIjjb5G c+bQ== X-Forwarded-Encrypted: i=1; AJvYcCU0tEeAv/6YPn34V3FVD6y9RtV7AzZxn2J+CVUMsNBjZP4kXQ2jK228w6EOnMJAHeZa94mAFaJDfu+KoXo1tfm1iGzGFIS2qDIYPnuN/VfGKUqqqxA= X-Gm-Message-State: AOJu0YwGImqDodYUWN30EBDH2CJ7RSvpKznatV28NWRHNelQutlQix8d BZo1s97EZkngkCjzVNW2q203kzad+4McZjFYi46Hq8r2w4ubjSCI0QVP2/cP0w== X-Google-Smtp-Source: AGHT+IH3mMeaAQ3dPkDbtiyOlqK0t/M43w6OxFHdMVW2XCWSC0GBNoCeALnYs1IDQynVDH2ifLt8lg== X-Received: by 2002:ac8:7d0a:0:b0:43b:173e:ce1b with SMTP id d75a77b69052e-43d8f7cec66mr50519711cf.32.1715099243729; Tue, 07 May 2024 09:27:23 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:23 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:22 +0000 Subject: [PATCH v2 17/18] media: venus: Refactor hfi_session_fill_buffer_pkt MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-17-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092728_083711_70C48B03 X-CRM114-Status: GOOD ( 13.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The single data array data[1] is only used to save the extradata_size. Replace it with a single element field. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:175:5-9: 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: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_cmds.c | 2 +- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index c5123f2e76fe..35423e211ddd 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -331,7 +331,7 @@ int pkt_session_ftb(struct hfi_session_fill_buffer_pkt *pkt, void *cookie, pkt->alloc_len = out_frame->alloc_len; pkt->filled_len = out_frame->filled_len; pkt->offset = out_frame->offset; - pkt->data[0] = out_frame->extradata_size; + pkt->extradata_size = out_frame->extradata_size; return 0; } diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index cd7902743f62..0ccc4102ac3d 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -172,7 +172,7 @@ struct hfi_session_fill_buffer_pkt { u32 output_tag; u32 packet_buffer; u32 extradata_buffer; - u32 data[1]; + u32 extradata_size; }; struct hfi_session_flush_pkt { From patchwork Tue May 7 16:27:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657476 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 EFB6BC10F1A for ; Tue, 7 May 2024 16:28:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=y+y2ZDUvltj1ZCT1ojJHtresOj6mldQyxz3PcjlJeCY=; b=E2CFl5Uyfsru59 VFiCZdv8BMhGZHa+BwLitXsh/Mj25gDwFmWL0vlatLJUDB2ASFZsXvU3dW//JoutJhtYWcDSwxvCJ a2GT/hh3fhnJWbbf8oEAVLbizD3DXJOiWS5FPiNlV/oYAYN8DTVLJk+2lLiK2FxWwKrnaKdu/YGeu kEXQ9wwxZReoJUbi404EyTr3wEBCKodcfOn8qNP4usqt3O37BSYR1ZA5lDwFY/Tg3kztKzxKyvpCe NrHZkSYN0lIywWGAR0Mgj3FJN4rHXbbBjUPUekvN8cZCwUPkVX/CmsuSnqLnie8hA0Q9kUbs3IzR0 RpWGJh0uZZkYpj51mZjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Ng5-0000000BycF-3Qg7; Tue, 07 May 2024 16:28:29 +0000 Received: from mail-qt1-f170.google.com ([209.85.160.170]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nf5-0000000Bxgz-3oZS for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:32 +0000 Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-43b06b803c4so22430941cf.1 for ; Tue, 07 May 2024 09:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099245; x=1715704045; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=24yjDTHuOCF+C8SbX9O7bVVIA87jnk99ezK2b/3Gma4=; b=iwG6FhvYiQCuDVL8kR3r3bHbvTz2BR4aWsLWc4ua0sMpOcLx5scZWf/FLVXH+r91bu pHOgsFpOQArY1OYOOAmm9JbKP66s704tI0wjGSlmvN0BvRUIJjvVwld8h/44zNVP3p0F tdCerGCBPGzmm919K0qm7bc2hnQiv4NxWFUbA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099245; x=1715704045; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=24yjDTHuOCF+C8SbX9O7bVVIA87jnk99ezK2b/3Gma4=; b=rD4PdmN9jpbwd5WiOVELRNRVhMWRljJxczuQZQEgFtBeyobpGV8iUHftppxtYAPcKG 78oyqvzSV67D5Nmdg6n78Ecnjg40JGQWQIIqUBv9mvIt+GJG+pDgeXioHjbNebALqSFS kvFz4g6BnZwdepPOehkx7xslPz1zSrgNN6uGEh0wJwHH+Uj8R/1Q9Gcb9uCxHG2MIQB0 7myCYxQJd9MrnQXSc/wAUWliFbD4q27zDgt2xnQ7CUE8lk5hGBn51LkJX0UHVrCVj+Ai nSA+TZcOYRWzROmwjMPlN4linTz/kyVHa6IyskBL8x8Bf9FizIanQAQXBoFJK4jTDk6W dD3g== X-Forwarded-Encrypted: i=1; AJvYcCVhq/Yb9Ph3yRUv5VLZKtQeDVOrhDlBKXzfQ5u8HZZot1qZ0jfD/jJMxubg4dZAXyyo/3pRCpmdj89twwQVbWwvJOFa/+hR3L5IXBVl/KY3bRIGkWs= X-Gm-Message-State: AOJu0YxGneDn8E5vBWfiUo9OuWSbBbJc9PAAjAMPhQI+kV2GFt/Bx+i2 sF4AfM3i4r5l+38E7vq1IwgX+LRQgeyWBHnGYvntPl7xXTCJLlpVb/PfB0QtWQ== X-Google-Smtp-Source: AGHT+IFXk9TiPGkyPd47b/0bfL7TWw3sW2kfDIDAt+NnUsqL7Hhdu3EhERFFZlCigfyFh6dM5Cuiow== X-Received: by 2002:ac8:7e8b:0:b0:439:dfc7:aca4 with SMTP id d75a77b69052e-43dbf868fd7mr1746031cf.63.1715099244908; Tue, 07 May 2024 09:27:24 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:24 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:23 +0000 Subject: [PATCH v2 18/18] media: venus: Refactor hfi_buffer_alloc_mode_supported MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-18-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092728_092264_C84539BF X-CRM114-Status: GOOD ( 14.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace the old style single element array at the end of the struct with a flex array. The code does not allocate this structure, so the size change should not be a problem. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_helper.h:1233:5-9: 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: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index dee439ea4d2e..9545c964a428 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1230,7 +1230,7 @@ struct hfi_interlace_format_supported { struct hfi_buffer_alloc_mode_supported { u32 buffer_type; u32 num_entries; - u32 data[1]; + u32 data[]; }; struct hfi_metadata_pass_through {