From patchwork Tue May 7 13:18:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13656993 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD614168B18 for ; Tue, 7 May 2024 13:18:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087913; cv=none; b=Wfe/Z83var45IZup3AymH44S/lHXo1BNggCy/YwGqUsj1/QA+A4LLp7oWPJpXu75sw7RjwpbhC5WDde+EPSGG38wL81Ndoj4V9Pb28pl3WnrZQKYM5EtX6P0fsmXg+zZ42EUYCCj6Y4rIxN4Ai951Q3/JyqSzni3vlXdYszUmf8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087913; c=relaxed/simple; bh=znTu4kcBZIJ40DAZAzE4ZarYw+mhmMYgFA8GYOICILk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CsyZDN9BpuJnxaDWuj49Gn4G4oCPG24eyxHz5P3XhxfyDHw2ABVWpDsYMMapSdYj6CLEcnHB4QxChQ84B6TI83HDdnq9pWuJruL6XzgMTOd4H8lM/aENveCoky6MBsMrIbEKsOluAuwh+F6LD23Q1Z3I+LbWloCiKiZI1o+lof4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=W/ysPZ06; arc=none smtp.client-ip=209.85.160.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="W/ysPZ06" Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-43d4c5f7b1bso17264111cf.1 for ; Tue, 07 May 2024 06:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087911; x=1715692711; darn=vger.kernel.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=W/ysPZ06IYFhtX/6M3QRbwwJGPzhk/CIsHei/AljHXL4JN8aGL6yhVBUYEbi36qpad IA0pgS3Ljw0RtcNaz4Hi1KvWOyOSn4YmxL1sh7QEVCl4lj+o8exRPeBIC6MNNs5LrQWV q4a8DJGW98T/nOESWGyHZFg1FXPO39PWk2Sj4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087911; x=1715692711; 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=HedGcZmSJfTgf6juvsF/y8tLK2t3T9cAA6PjPOhu+QOs9rWqhP9UTCVg/iv8CX8/CW 2sx/jVn+wPskywtEkeQPrDCxjts08KpFk5JroUNIafTKf2IYeAUmAdhOLX0rHwZjY5ya Z7ICV1IgcM1fzMb9rGUVODaz5pS5yD9wfexdhtRAfFX/GkBNesxC+fM9pcrcdKOEYZG5 jEfQFO3jOeRoB2OkRISSxhhnW10VPW3oxod3DfJU+tr8QnSBnDPj5W5SQK4xkkLGwqm2 Lyz+1RsCU7szXTFcN4dJ1Fw1quLR0gGfUYiav3fOhoGIaT2e7pio3zcFMMVeFmL7Sz+L oEZg== X-Gm-Message-State: AOJu0YzKJ7toW75UCw0UkRZDWQ1x6a40cF9Gx4vddY78el/CXNmMsrFL 9X/wrIrK9N/SPEW4nBTvM2/GWtf3V4OkpgNU45mwt8+XZML5u+qURF/QIfvzQw== X-Google-Smtp-Source: AGHT+IGm6pXwHMdL9pFaV0FwWg8eqwPdftA0BUaILiny2B4bPC36O7QRhpTkxvdwYUJMzUmDBO5Kmg== X-Received: by 2002:a05:6214:1253:b0:6a0:b3ec:902f with SMTP id r19-20020a056214125300b006a0b3ec902fmr19399470qvv.15.1715087910820; Tue, 07 May 2024 06:18:30 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:30 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:27 +0000 Subject: [PATCH 01/18] media: allegro: nal-hevc: Refactor nal_hevc_sub_layer_hrd_parameters Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-1-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 13:18:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13656994 Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB3D616ABEA for ; Tue, 7 May 2024 13:18:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087914; cv=none; b=XIa+7DS++KMKv7OXE/cs0KtgYcbP9iBNPPlJ8J0cq20R1zYjNmiqcaJA2+Hx+JFQ3A/Uow8sVr7Keqom09NJ3yZrq5iuN0PimBpOTpIXfbMZ/K6/2o9Tya3lWAiG60/27AJ+9oWOLKepyAk04gK+eZyPUmqCydA6/fLE22kpoug= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087914; c=relaxed/simple; bh=gcgfOXZpVAPIhRvVAmX6aT02WeOzRZpm8OajsHdcMqo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CkmZHrOH5qC6izoobd2NYV0zH6Wyx4AvqYZ5dxSjuU7qyfUkaEgF/6nTGRcbBEj3cX+Ft3Z4b0hDoxPAn/aacGZQPKnduobZJchDKk/ay/ocOqe7zfTo5qcuS1n6SSQKsMpwOw3V4hAKn/NROXZW/RHH9FPr2c867zoiKdD2iWk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=MWJbM/cX; arc=none smtp.client-ip=209.85.160.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="MWJbM/cX" Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-43ca9047bd2so39274551cf.1 for ; Tue, 07 May 2024 06:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087912; x=1715692712; darn=vger.kernel.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=MWJbM/cX7EbscSOPeHi/T/KKwADPqBpUfpm1yZrj4iUqPCtvd+t42nlAPO9NPrmOYX KnIiVWe1kx+fUQxOGxOUmEQcVseVkRygoeWapSt/jJ1loCYt5eZDYHXyRIGpkDlVoR5m sFdHDl3h+mvVWCRLFCbQDC5H899GR2PYS3WJs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087912; x=1715692712; 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=Dq3rq5IWNBEbTa1v+s/ATytOYLh0L2tQCqAtooZU0XGj1VVAhGyqDIOndbcra5i0id VCGenIfV8fiDrU6S9oJ607g8ecJMxzDJiFtAHWv982Hyq06ebDyuRvna6lIfHYacZP3m EmWVuIFyIPuXEzwmXFHB9XVNRnm6JIFEdn3nl5EC3gvHwpmnuCZfVyk3ZRr2Q/+gJcOM 9GTuND1HNjg0Ty0bmJCQzyER3XvCq5hQmBoMZa2PRu5OBgasnwGfDlbhoSJgMzsOaRUP jdbgzMqouilmFBnY468G1OosFXh4SsOB2WfBQNfBhc2VeasT+J7/TkIQSUrMMeHeMsLH aFzw== X-Gm-Message-State: AOJu0Yx3hs1r2DDqiMBzjvKVX7EmOMqxMBqoHegmPACWkI81YeDo2Gfo drGGhOSonpyaRGYxgpNCzH/qsmjERO1VhhaKBAIhP0Y5YMWVwXw2jPTnPWs+cQ== X-Google-Smtp-Source: AGHT+IEDglfo4F9kZks6VdwXO2dFsis27euicA9VsC2TmfkNWeTSlqrnmzGMgOLPrUCqKhp03xspNw== X-Received: by 2002:ad4:5ca8:0:b0:6a0:c242:16d0 with SMTP id q8-20020ad45ca8000000b006a0c24216d0mr4441213qvh.31.1715087911865; Tue, 07 May 2024 06:18:31 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:31 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:28 +0000 Subject: [PATCH 02/18] media: xilinx: Refactor struct xvip_dma Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-2-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 --- 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 13:18:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13656996 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD42416C44A for ; Tue, 7 May 2024 13:18:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087915; cv=none; b=D4S1IzTsFbO1rHac6p9/xrkIxi5VOkGlVsqRuojWKF4eI2TxxWLL1Rnh+XsD+JztU9B5YMJz8VItNgZ64Ll1fsVQ/jfjtk/MKFfkDWNk4xQfgKjenkcDi92v6EhPrayPzRVXG6lB4FGRqwB2spasMhc9s9+ANRBYguar+NwGVZw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087915; c=relaxed/simple; bh=8PUpSF0/4qPVDDDsamD0PWejHF9bSQacFjYzGSE/u/8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=i8Edn5FfPen5zQ7cg2qBb9MCUaZVKd86HI/MkrxlH1sAzO41m2SSe7l6IyoI9srb8/uQB2O6aQbhBY31t+Vdh8G9HGRbcPhBaRmwVyrHXSTnCbOzWPZ/Y3v0tPyDQbZ/BzaXGnwuMpyha0k6lDIAwS1gVkoyKJaquJYol5UCRDw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=QQfJdixz; arc=none smtp.client-ip=209.85.222.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="QQfJdixz" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-7928c5be3deso250371185a.0 for ; Tue, 07 May 2024 06:18:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087913; x=1715692713; darn=vger.kernel.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=QQfJdixzzYCNPNcgRdEW59kLrcpsGqxk9Ydkaz9IyViLpgu6gg0nhDhA4e7FvQZkkB lxH5cICb8BT9QUv7vZOzghgDBXDqdw9XlPYQe2ksYuEb4RQNbTtmOQTXcwRGhYcR4pk0 mbcVs6NmjM9JEU15n7HCFCKSx4lLC2mRYK0ss= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087913; x=1715692713; 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=DO22wyJrYV8Duc//KlIaA1KdfPSI/tLfrskzwZkOppfDnIkQfQOALCxCqVjgUnf/cy l4mOoL9Tjqa0u3X8uLwTDR/LgtMS7nt+PZZfcxLKof7vRnqDAkGQsW7jDXHOlmtkYZN/ /w8yt7GRx3W3u4FMFYGNrGzu9KiUph6O/87rl4+1rOEMPnB4M75Brlaz1n+XSIW5d3+W nIeSbcOLqCVPODfgDvRFF5NcgCrE2t10MaJJODnwqdrY+qGUM3D+lnSUfNvKC3AtiC5v p0BZB4Ha7SNB74Wj6BtitqmoU4tuD0iJEdA0MUNs+rBta4C27qMK5MhNSN/p17zFb4r5 jFzA== X-Gm-Message-State: AOJu0YxVF8zSFcQsGRDKElRKtTbC/hVGEvXQK5mhjld9LyGu0s/1e2hC H2TR1OFK02J3agoI/8cWcp3KWWozHc4JXfzQmYlrVx62De+q2PvUbJoJkK5ZRA== X-Google-Smtp-Source: AGHT+IHQmC234jVmBfThVSOfa4/hAJa6mJSOT+8IOLfwmMAfT5gaNt64PTRiybToFecmCSMHrjM2CA== X-Received: by 2002:a05:6214:d8a:b0:6a0:7d91:8752 with SMTP id e10-20020a0562140d8a00b006a07d918752mr17005843qve.58.1715087912800; Tue, 07 May 2024 06:18:32 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:32 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:29 +0000 Subject: [PATCH 03/18] media: dvb-frontend/mxl5xx: Refactor struct MBIN_FILE_T Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-3-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 13:18:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13656997 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD9DF15ECCC for ; Tue, 7 May 2024 13:18:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087916; cv=none; b=eVwmdXJ2gxIJCCK6AoUz35i/InE3wnD06f1d2odCoTlG9zrpeqS+PU8gXmbBS3t6//x8DX7Sz3KGXrnYE543r5xwqaM0QAbMQshndrlGByV21TgxreK7bwlHc2DAdptVKBZ3Zv2k6GcbXX6JnSCUYWcWoz9cObEjLq9j543zkXc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087916; c=relaxed/simple; bh=OkrWWOrUN5GNEWioxP3gYdPUo0/0BfsqCVC0RCoziIM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=udm79pM/qPxVAxj/0GikG0pII/4r0gpBv4rQiB479noELa+z4xRxwYABY6bAfezrI64T4ar/p/UsxOPppvwXpv/VTMb+dhRmvaaBon9w6IXxxPoiCYf5hfVYVoTOG/RT+WMCxn3bjLkqRLBhU0Ym5x2TxzrgbCi+FvfxKPZWOK8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=bv7ZuYR1; arc=none smtp.client-ip=209.85.219.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="bv7ZuYR1" Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-69b7d2de292so14114596d6.2 for ; Tue, 07 May 2024 06:18:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087914; x=1715692714; darn=vger.kernel.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=bv7ZuYR1JSua4HN2zGrac6dR80LTnt3qfwi0LYYW10A4oCkGiy/9dj0lr5csx0dB6D pvlzvvBoE+0oi9e+NvhdD9hOkpm6ee2zH/O2Z6mYkRvD0/IXdVRgYf/BMt2TPxpheY4M pTXKYP+wd8A6lTiRyokt7qJNrZpmL3F7X+B1A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087914; x=1715692714; 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=Y7WVRZ5EdkwxKUjzsq6E5q1YqbNSD2/P5ydAmd4/OnvqsqBeYZDxQA8Hd/CGokMrEu qEqHCLcrEhOepO8eX2e5WWQF2wiGMBb/ZVTkfYX/mcR3U4fAib819PeuB1NMxH+57L8E iVEjAiqAtgxxDNkOXu5fi1dRJaVl8lVfK3esmKiPb3SCQHwSGWsjDR5Dqz4bTaJZGxAr URi7UB1EPMoaXod01OXSAW1tkFwusQm/FuSSHfOwjmGVQfQl42cKEr2i0/eLPYGRxQnE VNx6zXR/py6U+CSf2gfCGVkDhyUhAD7KKFbqiwpnBtNnfBpaxH+mQIHnvLUHq4Bkpw/H 6z3Q== X-Gm-Message-State: AOJu0YwX0RiE423btdcFcJjJvdmhOcYW9pBfvbAUyq3fd1mqfjWY+YgZ kYDc19f1P6/8Jvs3E3y6TTCmLwR5FgC9g8cbnRI2sUOa31XESbrL6X5QpoTwzg== X-Google-Smtp-Source: AGHT+IEHmgR44JJkt0kGIzW7NOaECWfdPMcTxHBijYkMDjUQ//6R0gtSxgRSvy3DiBlPMd5HBstr/Q== X-Received: by 2002:ad4:576b:0:b0:6a0:6545:2306 with SMTP id r11-20020ad4576b000000b006a065452306mr15355570qvx.28.1715087913906; Tue, 07 May 2024 06:18:33 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:33 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:30 +0000 Subject: [PATCH 04/18] media: dvb-frontend/mxl5xx: Use flex array for MBIN_SEGMENT_T Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-4-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 13:18:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13656998 Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB36616C6B8 for ; Tue, 7 May 2024 13:18:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087917; cv=none; b=IRNtdiFVqdu0KzUzC/S5i2PVvXASVEjkU1arzNWyhznd+EpxJERgW5F52CQAIXomCPxqS6oO4WjaUnhurc90hFJPPG1tB4EHj3ewOlKn2xUcgqefDMqIqMjNhGMTcufpNuTC0VSMskLVYQbK69K0Cnuqe3FDqxPsyx/g0WqY2HQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087917; c=relaxed/simple; bh=Ybzvge6Uw1Eh9FNqgRzW6qmy53LUrGIUlQOKIfHH8ug=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LxuYjogc6jblOcIv4wOa8YI9Kl4WQVfikZdI1KM3EREHgZnzDHFa3Yi1qWRI6utcbqbsCxr+T7zZ/kxlvJr/jLEwUCVKoPaDu0ZxGOmOV722dvpKjf+0ITQaNWWZ/h59dMeKsJExyTW21EFxbzrxlsfEvXV6tOSEZKd3oeP2OIM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=C97A5fds; arc=none smtp.client-ip=209.85.219.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="C97A5fds" Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-69b7d2de292so14114716d6.2 for ; Tue, 07 May 2024 06:18:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087915; x=1715692715; darn=vger.kernel.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=C97A5fdsOzRnQKPK00h0Illilfv/nREdZlJuUq8WKtUN7u6XhQiiXxSFudESkXztcZ MkzZbHHscl73Sn3QFmR5Xmt/f+drafqj8Jl+bZX7X20pVjc8NdrqK5EsaYpnEBb5YwKK +YReYJQsTHFj38bWpF5yoHvLtmkhKdeWS0Uj8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087915; x=1715692715; 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=tMEGI3aUH+udBW1xfue3b8CWcdB6MFAIgP8MXRMyY75l4i64T6AXCZNht3HnE+PTot ToLyPxyZ8Sd/DDPo3cEsRC2mKPwD6D2/PEzjFzDe3L9R2q+i+nLOnphWIUmnIuAUQFaY auN7vvaYCtet38mhnDo2yCh7VWFuwA+KZZA4spvf8VE6qwxhVadIn2a/UTFz3KK4GIjV npo4dBj8tmtPbMLHFXhfc7Y7638G0IS5Put4JRShHbrqjI4CXq5Fg9EIXXtYe5pa4jmZ CW8ESJD5ftUfKuZWrJ15t+MQMx2Iqs2qGtiuzlCuBNSx/j+UP+BMVV28ONxYwqBQXV13 KnjA== X-Gm-Message-State: AOJu0Yzzo/VD1oeNjx37rZtZgDND1DkaeWhSuCnDtyBPy0/F7/56mbAc 1IVPmGqf72quxZ7cTcHn1M1WIR0TLNtOjKWuM6qkbvYdkAsi2ySQl+gsapN7Lg== X-Google-Smtp-Source: AGHT+IH9XIpdU6+Gw+h8MPHG1GU0bBRHihk9hGC3h7gFftMNuTBDqQiQrQXelAgXIOFhdENJileoHA== X-Received: by 2002:ad4:4c48:0:b0:6a1:1f45:84b3 with SMTP id cs8-20020ad44c48000000b006a11f4584b3mr9905483qvb.5.1715087914592; Tue, 07 May 2024 06:18:34 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:34 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:31 +0000 Subject: [PATCH 05/18] media: pci: cx18: Use flex arrays for struct cx18_scb Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-5-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 13:18:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657000 Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9670416C85F for ; Tue, 7 May 2024 13:18:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087918; cv=none; b=HexdY2eKn8BwMUHtvUn/TWxLEhE1WpyeHchOSaFiWoaz/c98ZqpU1lK8rsXnzw6QSVhWzSmDUKxPK3Fd+RN95Yl3AGQAzSQXHcsTITwSMl16qx6nQ0f89d3lb+smf4hvpoTJL/psuxKqSBNG4EzMyy1CqtmmCSxZ7ekj9XBn6HM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087918; c=relaxed/simple; bh=ijopITI+g400QtGKLS59fnNFa/e12FntTcMx7Nqpa5U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JsnFaIgN/d0nWGDK0ukXgmSjNFus/aeDlOXFqtcftmj9FS5MS+uks4ucFhZC9TB80UDOpIlXGHaFk0A2ACSKzkwY3MMhVy99R5DPZGTSoF0cg6+S2+7XAo9qu2Y+B5o66gCb1j4bN6sSj/NZewKm/YK+ywHtCj1Ysqyma9KQLw4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=LD5VbC3C; arc=none smtp.client-ip=209.85.219.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="LD5VbC3C" Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-69b4e94ecd2so12668286d6.3 for ; Tue, 07 May 2024 06:18:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087915; x=1715692715; darn=vger.kernel.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=o/4oby1OzvPbisoZWbigQhOZs4utcCTPvU7cAHaoXZY=; b=LD5VbC3C62AUAa2nR4KgWdm3kuYSzH9cbgMdt+/EVWnIHtdeJhzm/pLWCTqlIr94s5 k//uu2AJywfQVcHVCDhQOnXA3nLl2zoNVOjqwAB6ruv252JzcGJDdWqz8+ucS08O9+2J L8glmdsq1N3jN6F/2zDjH6He4XIB4FhwDLO6I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087915; x=1715692715; 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=o/4oby1OzvPbisoZWbigQhOZs4utcCTPvU7cAHaoXZY=; b=JNLB+GIUPgZwOGRp4o0R4ctq6ioW/dZpnCL3dRRHSoj22A3efHBCCV6y2yJWKmg4Pz ndtWdUfjNiJyB6F5I3Z71HZ6A2hu+zfA8t2baKMZV37PPuKfF8EZa/j37vNNqUnLBUYq CWa9JC/oWVv3GwF4X32PdO86BCrik0Fug4b2KDLw+JiOQHyLb7ktqzOV2j8atHqoKm9c 69G/GEdJxQUxfYX9bGA6HlmiVIf1tz6Ujzzdck+69zAwVLusMB5RzTvzCBY1MUYLZPln pAhbIW9WtI/fQTejkfi/InQ0/t4ISzaMHCFlRQq7JRY/NhHZfiR5NiijC2YreT9k7eNI /EvQ== X-Gm-Message-State: AOJu0Yw8usx21MY8YKbHeJMr3xBKh5ZLR+afrFiT+ROmsqP8ii7y9gd2 hWyMxSgvO4e8zNz+1Y7y9H1dEDerLKLNZofhn6TaNH8ftT79L7yuDfz6E/CYhA== X-Google-Smtp-Source: AGHT+IEwGqKCP2RodY96Q7BvikThgfGTcpEIa62+nhVbtzbMCCA4jSL8KZCOlBJ4ow7E8ohEtntOvA== X-Received: by 2002:a05:6214:2401:b0:6a0:cd2a:8ae2 with SMTP id fv1-20020a056214240100b006a0cd2a8ae2mr15077797qvb.21.1715087915445; Tue, 07 May 2024 06:18:35 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:35 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:32 +0000 Subject: [PATCH 06/18] media: siano: Refactor struct sms_msg_data Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-6-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 Replace a single element array with a single element field. 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 ++-- 3 files changed, 8 insertions(+), 8 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)); From patchwork Tue May 7 13:18:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657001 Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8884816D308 for ; Tue, 7 May 2024 13:18:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087919; cv=none; b=HjRG1p9wnuqQzwMpcK7vqISfEJclrDr/9pVYm1OX1anR2QG20hJ3Bf5k9kOXQpNxR6sbPnmCkgLHvBzcHQmIw9057tN1b8ecyqPEkiHShH3TmUhx4p/NfjyaL40tUHsFSlFCrc1mJyGqLq+sU631zwG4yNVFQ+lduY27c5SrpUk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087919; c=relaxed/simple; bh=ENYjVBtJ4EPS9w/ftPm8y0fja8ouSlg/VUcwtfy4KyM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bFc+Pk//34pY0Tb5ThoIsX+Y/y1kJyf5t7svlNCtOhdfkIk5uDMo8gMx2w+dtKyt1hAeR4AfdcafLWiiSWmIIfznjNe8sdXNmzSmWk9lSUR6eNwTBfcqcg0MZpjOF6+BxbOTNpPiVE8Cu2q6xbEk8lCTYWVLZ00jkkiCpeiMIys= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=KBC519u0; arc=none smtp.client-ip=209.85.167.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="KBC519u0" Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-3c963880aecso1112943b6e.3 for ; Tue, 07 May 2024 06:18:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087916; x=1715692716; darn=vger.kernel.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=KBC519u0YUZRmCX814fdQKpA9DlYSwz1bySNckmrtHfZxffY9CGzwwo3nEWshOn0lS 8v9an28RN3ZuLUZoNoPCjNSUaymk5IwXUr1AI4Qmfzc6ZauF9dmvpstHrufZVgY5PRuy ZmGawl0KywrAVsBanr0/J+DjkUIek1bN8rc0o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087916; x=1715692716; 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=fYR+uomcxPb7yehcHYqMLD1uxwaSLxSOFCpqXO8MfVrDp8QrTODqvYB0W1Wtz8/QeD uWrMaFNrwk/Yd8K3PPCvhuE4e0G6LBAMDQGndaYPyrmW8C6uFM/iZ5B2ElmZTY39OXb0 FcDDuMMjvZml0X7D+B7NJ2ICz65U4aTp6nwIts2hiKwDQo1SiGvRnqhPFphnCdeiMUd+ 2ZYrdiX+AlXf6gc9D9DPs32G+JORBd2rXXT0KYsY9bpnPh2NEIyDbeaASEp5ZRRtKXLk ld2yISLOp2L/DJpP0BqCscHPGRs3Wl5A2LghmHz4+ycYE2j7ev2YWY9fbyQIWDfhGthv XZqQ== X-Gm-Message-State: AOJu0YxDB77nLuDrWZC1ZG3LSXFwFc7/YcZb0ePljvs4QiVFcjObKVaI F77S12tghet8C7M8iv5wvRC/rhnWGUk8MNAGOTsERUWNwR3fbjAF7P61weA8O2G42J5AxcnlGUw 2mA== X-Google-Smtp-Source: AGHT+IEfgZc+3NqAZNZgDbuMWn1SodDQc1fgSaycXBKpVQJhCw/vqcobpSG60CD78oLq4SUhp6OVxQ== X-Received: by 2002:a54:4195:0:b0:3c9:6e70:cf99 with SMTP id 21-20020a544195000000b003c96e70cf99mr5053014oiy.57.1715087916576; Tue, 07 May 2024 06:18:36 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:35 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:33 +0000 Subject: [PATCH 07/18] media: siano: Remove unused structures Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-7-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 13:18:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657003 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 574CE16D4C6 for ; Tue, 7 May 2024 13:18:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087921; cv=none; b=ausMOspgn3a/hL5lRqc3VxBvBOF2GFsnZmZj87fvLj5g6Itr7kWmAA/tUfhrNieCRWsJzOthwcZ32ugSDpEc33qwFYXjkVrwCEs9JPENdXGVX2U8cvD0KZdh47HLQaBUkF0l9fNnNJG3YIdb6UdIkH8s+l/4n1OMgt4kbiYbHA4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087921; c=relaxed/simple; bh=3FQmdzC7rLah5bHXqxL1pjRWMb/l2vnOq/dIwPsVxiM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HRN7KIqQ33dtRhpEDO6ZEMb9VSpvoYg5cEmcAYAeqwyfX4dvQzjO8+co9jVbINKn5Xtu2cFi4s6Ca1W2m1NnwO5q/Iq3shJeJ1HQMUeQArCXb/0MEViBWYsTkmbL/a160tE0hPNAj8BlWynsgihSYXKYKTAQj4b11MCPiUBtu8A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=JFt4TNkp; arc=none smtp.client-ip=209.85.222.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="JFt4TNkp" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-7928ec5308cso288067085a.1 for ; Tue, 07 May 2024 06:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087917; x=1715692717; darn=vger.kernel.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=JFt4TNkpMT5jL5IFAYGuw28lBWwu84Ak+EoHQOC6AlPJzZQOXDDwp2LfLftQDkcI48 kePHAN4Bhd5TFp56PnCYmL0IjqhZvKlhNTePDpTlPyuZOgFXVPm3H+gBFvSW2TKQP2V5 t4vOxqEd9Db93cAxWnLWBikZe5wQjTQDdToXE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087917; x=1715692717; 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=Ta5OWJfcRPY1y/n/0LEVopr2nR2uTZsJlbVe80Vkze9VETrzTnB58gcL2WksTNMZYL Ch2xykUOMZAPBqD9i7/JZ+hsKdVHy8M19zVtPWinkzKz9+V5OHNTD0IpR4qSg0MbIV+T NXfZmLoQDHJ3Aq03jZAWx3b7a7imGIDQhWZU/NE4qxJWieuuIz5W8mnfi/AfWDkZQOFp fCh7XECgdf0p/g94HhWs3YFSTkGL8GWsc4BcANrJ3w1/2GuPvHMrfYFe9ZDZKhZ/9BBA QANkHRXzql14I3D56RXu/0TU4BI0YQmqcZ3MHUpuyAe86mKNimC8lumNQ787a6JKTMdq y6tw== X-Gm-Message-State: AOJu0YyguDCYpx/wCocLAfjwsB7a2X4osW0MXzU6B3QCFj3//L7D+6d6 sbjFoD94HrMvNbdn1kFji/apUNFkXWoGO+A9U++cUc3ivusscDxlheI9c0Z/dg== X-Google-Smtp-Source: AGHT+IFKliypIzu0YjFcg14a69MBEAau+ZXpSAYRUE5dq1ueGc4ePsCBbZXpGGTph+KzlVWTljAkDg== X-Received: by 2002:a0c:e082:0:b0:6a0:f637:667 with SMTP id 6a1803df08f44-6a14600e407mr45875746d6.12.1715087917380; Tue, 07 May 2024 06:18:37 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:36 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:34 +0000 Subject: [PATCH 08/18] media: siano: Use flex arrays for sms_firmware Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-8-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 13:18:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657004 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A58B16D9BA for ; Tue, 7 May 2024 13:18:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087921; cv=none; b=F0J8yd2pYRECjFIle9f9ZBd42CIaGFWSL+FKV6HVmY8CPJoxyrjfCFOb1qQftW1yt9WUbiVmn9QFjeaPVmUa54S7YMnHYW/eCTAj8bq2Tsg4QrpfL3cIaQnbUzG6ck7BAxyb5MXrMHzbShk0+llt7K0O1EjmsbF82m2Gsf0FXdQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087921; c=relaxed/simple; bh=wXllf/Q1F0asZS1sTnO9eU/dGVrc8mBHMAVhM0rUTv8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cNKKpwmdqBy7RTlRMrUs765yK2MQJwmLUnunAAAIWVyAI958O7XvH76/FJBeywassdVDbpLtPKx76VbtU1InkDKTiPq81FHGjxcbbg0IFXyGqz5nhnEK3go3+hX5v7mfqLz3MbaJk/pkHtBz/S7OETcCOTwfjj+8XCRbnCyrWAU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=c+Tqbuas; arc=none smtp.client-ip=209.85.219.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="c+Tqbuas" Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-6a04c581ee3so12256326d6.0 for ; Tue, 07 May 2024 06:18:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087918; x=1715692718; darn=vger.kernel.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=c+Tqbuasm1vB3Kq9xl8HU2XfnueGFIeVOd8xESHGvQgPVG4rJRFgya6pUXWjuNlTaU UDFV4PnKfp5rcJTqvIUYeiutXrpYRl5XZE5FmBnwBFWsJbgc1ZSQaj58DWvKWoM95PAn vhV3SCgsgiZqaC0GNEpy2XicKPlnvyk2mQXjQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087918; x=1715692718; 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=nCka6uLJPx73/XdD70G84QPQ8f5tv/7DpZpyQiLhKUs2ble+vEJmWT8Ps/yYeTV3s4 QtdkwBMhU2tHoRix1mDiZqA7yTW8dP0i4AUYlbhygiPN5VS6trmCsV+FrpwNP55oaXge Yi/5mlaiOMjxWi2zcBoLMU02aFatS3AMXnEMF8WxjvC868J9NxdyJIE6JyyBE5HkorKW 113xOTpZWIuco8XbETIh15M2L1Sqhc2vv53e6b0wpf7u0/SMukKffaiOuY1Z5iEWWj9a 83R0jQJ5DVwuzphnRgzJG+JoHHkn/6Jn8Mt2fvB0WpW2qUti2fqYc76OdP78prISeRAU eqvg== X-Gm-Message-State: AOJu0YxPZigoPvfsYeizUi5VTv8aD1fgRCXOgS7NZv5mTNAPFKUny75S 6RctNSZ5lL6Z47rGtk4mMMO9zwTlFfOUCbhEU9HEFoeYmSj8zF7i5IqyDhbMsA== X-Google-Smtp-Source: AGHT+IFE9fQ9HKDwH26yKAPAZM/6TAnCx7pGdD2pD8NawZpJRVZDBF6akmAtnEWwGOg/Xa6r/F29MQ== X-Received: by 2002:a05:6214:e69:b0:6a0:cd65:5996 with SMTP id jz9-20020a0562140e6900b006a0cd655996mr15329957qvb.8.1715087918540; Tue, 07 May 2024 06:18:38 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:37 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:35 +0000 Subject: [PATCH 09/18] media: venus: Remove unused structs Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-9-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 13:18:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657005 Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C36B116DEC3 for ; Tue, 7 May 2024 13:18:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087922; cv=none; b=O3OYW42QGJkU/0gwl8RLGfaOXWz14Nz+U0DoZ2/oCKmKQDT3NLoefNwtPKQIvZwD+i8b+yCjC3xU1aLdMjpWhRLaddP/Xt8fONt+/OPqSbjuuTr2zGhkJ6FtZl0OBPJWwOOEkaW4cSsAFfOmNVL195hNvcC40N8S+jlDmGE97eU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087922; c=relaxed/simple; bh=9NQhYiz/IbLF6F7xrUyCvcZeCyvNKJflJvFw3WrA/2Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dXWyfPlzPraVKhkb4WCfbta4lkJtqpWDbnAXKlRHfHbUhHooJO9E6RbDR7s5wbsSvRXZmbonp6+E4J21FZdmQTbND2i2MzGsZq4JJZjV1pOKOvyRV9EbsdjYnT6KNRobnkwDIAAqEQHOl6LJlkFNfZsNYjxINw557AvwEryNe1I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=JtFfH2cG; arc=none smtp.client-ip=209.85.219.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="JtFfH2cG" Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-69b4e94ecd2so12668756d6.3 for ; Tue, 07 May 2024 06:18:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087920; x=1715692720; darn=vger.kernel.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=JtFfH2cGcjafuPkormhgFTXYN5icqyHToRCqOanoGWywBAv15WOhzX7Yr/hNCBbAh9 UL/9mfYyfkvnseYqsoXooMmkPQFGWZUochXnI59uSMICypEzYxNfS028r6x3qvuXJTtf LXfoHLOggxXCMD50eYw4FhGeXCnpuLG2X7ndk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087920; x=1715692720; 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=rnrLyD7kDWERzn7y/SocBNRMektyWGhkLozOI8qNV+tdN8tf8VLOFjtjPJjxUU7uQ3 m3lFpjxQ1AfQ1p1F5a2RoVrQ2Z7h6gFrRHGurx5lbP25dYG3iPYP3NGN5I4m5EbXN68M UI2XeYStgvg9hy4NuH4wyGMzZrjoUqwcKkX2UVYQJoe9iBr3bxHV5NEn5YVteqx7/7EN Ml633wpyN98hEDQOxKGaE3bFmMSbBztiauddT0GGSseuww0/M1X8zDzKpIkJGy6Tvmjg OltyLVx82Zx/krV4Dc4TAweo9/oyOwnuASapbB4YSMQ3KIiqg52rXO82UXJ42rgoCaH4 LYDQ== X-Gm-Message-State: AOJu0YzSjzutfGwvY9huYLy/gVI3LartwbIbGTkglwZS9RPH1ieux0W5 Jkc22jCVxv2eFPJ6mn7fpIGDkE672TnzAy0aMEDEp8kRV5pcVl5+Bi1YOJNNWw== X-Google-Smtp-Source: AGHT+IGatpIQRwE9h01tY7yyLZRrAcLmql6eJb+YKcxD2Wq6gpUB9pyNvjqWHkivGZUb+9PKsnvIcg== X-Received: by 2002:a05:6214:c4b:b0:6a0:def6:6c8f with SMTP id r11-20020a0562140c4b00b006a0def66c8fmr15390917qvj.47.1715087919625; Tue, 07 May 2024 06:18:39 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:38 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:36 +0000 Subject: [PATCH 10/18] media: venus: Use flex array for hfi_session_release_buffer_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-10-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 --- 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 13:18:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657008 Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34D6B16E890 for ; Tue, 7 May 2024 13:18:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087925; cv=none; b=OGmn/u5EFqXugTVTBzKSWvgcNy/e1j0lq00AmMeE48Qp3JkiorO1LehtmIx04E+9iEP0ihzUEDzgQtUb+cuzM28pstfSpn8ky4e9rcaUI1DCkYsxtZe7kSMpI5g0a+4McS2D/CH2ajHviQaaOKOO6lGvJbtxEHn/psOslYcn5wY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087925; c=relaxed/simple; bh=ty0RG2AjLK5Y8dTp7JoVE8oXrIivf7wrKgPB1ia8aog=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Dg3/21+TnDpzGTrf7VZy3WJEtk8XQaSMNhxTC3v2W3/prxch3zmzR8pGrigowAE5OOHJjJ9hiI+p4j/2ce8Jp/GlkpAwQX5U7rCzwis+LmyCQNSjl81RrWwP+tMaSCArpwIQv0UtP3SqZ66CFfWDlxcCoxaq81x8OEKxCrfuF0Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=obSyJrvw; arc=none smtp.client-ip=209.85.219.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="obSyJrvw" Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-6a0ce3e823fso19358086d6.1 for ; Tue, 07 May 2024 06:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087921; x=1715692721; darn=vger.kernel.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=obSyJrvw1dCDY3GDBwzEKkjnlj6UPysGGaSPXZ6xUOMQdUsEe8bA8J2OqNB0Xb2Esk A1sbLdCj+pLI2tJICTch1W9z28IuONUQbSSi4ZPcy6xAQk7SUY9a85KXHuuj+/7zaagK 7AjXfLsmpxpduU+CC1WRMNS1COCFJMiotwhL8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087921; x=1715692721; 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=d2aaMUUG/Uvj5a8c9pxohV6EudD+vZLMb/QmSCht3yG6NihC3apLcieUIiQ+Em8lrH fAL5p1oDf23W3NrjlDLNa+oIZynaqgcO3MggDTYflpOtZo1nSh5pFPbS9GFVrOp1U93k g1Rqvy4PNFxmYFD6IR3t3Cti8ZXNJ5n6xyu9UyiWd3X5uavBt9gYZgNsRSMUbiQHvVo4 UCrAmpEdwXLQGaiE0buFxy/oyqKGGdzmMc48aYz4eXwyfYNzOMBB44QHHt/i2pPuK0DR 0HHBH/LOd3IB1Yrof/lsCImqRiMqE59kvr4QgZOhjcDLPEX4NEWLFi5X7Q1DQH4tWRFn Fwpw== X-Gm-Message-State: AOJu0YwJz1ZomyIbO09KjDBNnF4fNcPALYruCDTHq7w9WyEp0kbdYjiH 2R9eqa+OkRd2dlJHXDy1CEklTP/zINlXI2hkQeSJVK7HrmF4VLjr0Ys9ySUFZQ== X-Google-Smtp-Source: AGHT+IE/nAbjO9kVczxA1gk0GPTE0dAFY7dS/lNzVrz9t9IGNz9TsBD03sWLikOngI39+ClQ/E7Uhg== X-Received: by 2002:ad4:5e8a:0:b0:6a0:b705:27db with SMTP id jl10-20020ad45e8a000000b006a0b70527dbmr17551263qvb.13.1715087920745; Tue, 07 May 2024 06:18:40 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:39 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:37 +0000 Subject: [PATCH 11/18] media: venus: Refactor struct hfi_uncompressed_plane_info Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-11-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 --- 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 13:18:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657007 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E68616EBE8 for ; Tue, 7 May 2024 13:18:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087924; cv=none; b=mK7NwtE7piIZqZDqs27IQ+tvO4WthDSWn1F/WYyQ8fZKdFAxlDCpMqD3O9fqJmWdRlYljUKaZFED6bYLwYvzKOHKPLNdjtAIrmNnlkH3hprSmHwkksfeYtozow6gakBhJ3++O+KJwVcrRmM9WiLPnQoUKWVwkqpQrkBAgz/moWE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087924; c=relaxed/simple; bh=cqQiASSb1ke8R5KptOfAxJYuMrFDRm8Ouf7QBhfinuo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=isSeVck3B6ZI1lHLgUoL00fY25YKVbcz6ajELIpHe+ieNd9h6PhdxOH0t6oGOHdMUNjlhGucjI6+sI71ww0dDhyejPhB2yuENsmqnWDezVrftDWy4xZsf4hgOdQRElCNtqVpaw4RikyKWAKvYY8f7JRiO7me2AT34UccFPwSG48= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=RDMbgFrt; arc=none smtp.client-ip=209.85.219.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="RDMbgFrt" Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-6a0d1032362so10595116d6.3 for ; Tue, 07 May 2024 06:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087921; x=1715692721; darn=vger.kernel.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=RDMbgFrtVCgPuxbnWbZH1qbBZ7pa/VfszDw/xgHARRfziEaMkRLGuDthwezlyexIIg +I+DgiQD8mukDI8r8lffQ73cBecqHxyhKEi8kTzHeKh1Jq99YJML+K5uJIZvtHl5r95C G+WqWVekOUJH4IrPCpBsTu1obb6pWA8Bpo9dk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087921; x=1715692721; 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=ALHBXddRNRzYXdna2p2yWcO3swZoswLQBgeUfqaMT3mSVWbo8vqItMVtzVeuMEHoq6 NWkVkRHEUb9Nu4BGI1zgrM4pCxDsyxDy5oe3fIlgTqyRJmFoaGeAAdailWcoh4ZboIGy AoCcFxFV06nn9q6mUxgdOzobPqwS/Ikj2wR7K56x1wMnmiWCLaWsO3BLE7PBYwi48bb3 JZDJEtE59idr9POgvXgFN0l8U3tGHorRBtywWtIkxCzleY5LQnZqpxqvy4/EoiGREY4E pTjB0Vaqiq7WTvINpOykiblO9Lq2DQ8DLgLUjgz+bGMa+1dkCliOLkKnQKFFKczY42mi RLFw== X-Gm-Message-State: AOJu0YyUD/tL9cCBBJTNl20Wm9+03RXepIhrKyi2bPkg81FqDwGx9ItL W9j11p0clAvT8/rp7BgpYwzdSsM9wa5swQ3gp7mmw2z/2nnvCE7tKGAoobOSnQ== X-Google-Smtp-Source: AGHT+IEAUZYdUkG16+sKKGfbxJ3Nv32xMw8WTErK9sJC2vrPaqjhZxuw8OroCcIO1SEdeCxTaiebPw== X-Received: by 2002:ad4:5be8:0:b0:6a0:55c6:9b47 with SMTP id k8-20020ad45be8000000b006a055c69b47mr16507653qvc.37.1715087921664; Tue, 07 May 2024 06:18:41 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:41 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:38 +0000 Subject: [PATCH 12/18] media: venus: Refactor struct hfi_session_get_property_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-12-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 --- 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 13:18:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657009 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2875816D9BA for ; Tue, 7 May 2024 13:18:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087925; cv=none; b=VUq7VhsN/B6qzf9oJpS+KaTVwBpZ4iTM9GqwgjE2ywpCLczLGPkzQovyXyu1NgMSM5oRN2mqjUhkOeHV43GD6xyD5NFvpF6UdXwT2mnRvtqD4y8uXZhq4iYJRhtnqpFFf+4nvzLHHD756asSRWQ5uOZIDMXSs1fUxitdIoFojG0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087925; c=relaxed/simple; bh=EDdfr0+Pnj9r3H0XIbqR962gzmaw2rY41SXbAP3xmuY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cEA7rHFdOhQRmqLISHyB1ofHPCVYZkZmSgL3ofBHDNHglsjQlgXrnogw23rwdcnBOIiK18N7+Durgtbqh6V7Wt8zs+chTqxGA1U68SNeQUHL4Jq+lBVRhgKc5Og23ESFpj7x2DVKJ8FeQAisKZMWuIgdo8JabiRB8iuOxz9qr3g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=bOMgnXAQ; arc=none smtp.client-ip=209.85.167.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="bOMgnXAQ" Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-3c97a48575eso476187b6e.2 for ; Tue, 07 May 2024 06:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087922; x=1715692722; darn=vger.kernel.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=bOMgnXAQIlSZ3+/vgUBIIa/mHpEFDCRanOzOdnSiWt1kvfa1jab0oi4iNDST74XXqk eMY8oXCbnQdPQejspqU4D3iNXc5upN8R96HVrP2IKCD4YxEC5wmlGufJA/By6sn61hw+ 1rj+NVp8HagunRxlzzj7kFWKxDD9aSiQ3yZug= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087922; x=1715692722; 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=a8EVZhpf5TPE4xE4gPpAaIXn56hPqHdXVwkUZXcDlqeYeyz9MdCKQfjNkoewPwDwG3 f8ug2Wen3DMdcLEMxBJ+FXpQuuyRmJ8nbvy27QvyuZeaMPrEDX71eFh3WsSovj5javtU I7BT3FLGJ+OZd3L4uyNE7geYHymUyPZmpPL7jNJ8Bgk/xrxAj2ZOwcHQq3SgMeKKEQkA l0X2JTWXe/GkGM0f/f+wMnzeCUqIH3EX1kLZ0jTZE35K/XMDK9WVKaG5BsxenyHPiWwl JltgkZSPUM92kJdevzU6KOMfJhrIOYiNYwqtaEzahvSf5u15vEX5rRN3PlOmxeIDLTrj 3TwA== X-Gm-Message-State: AOJu0YxHgdKj+TeCBd6DL+G6OteAfaKzhlU56WOu+R0sgLIUy52ieO9p EUDMkCBSD5Dt/skn7nzbO74iSVSkd1+ZcFNF1+hIg31nGanMhJ9sT3pZTl7JoQ== X-Google-Smtp-Source: AGHT+IFSSR3o5HtKdgIS/uE+VKpBV5Rv+stUdj3V5A3bS3LVQVk3ZyFe5CBq7bVuSTRuzIUL5DJ6ng== X-Received: by 2002:a05:6808:210a:b0:3c8:6223:c7bc with SMTP id r10-20020a056808210a00b003c86223c7bcmr17391584oiw.7.1715087922276; Tue, 07 May 2024 06:18:42 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:42 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:39 +0000 Subject: [PATCH 13/18] media: venus: Refactor struct hfi_uncompressed_format_supported Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-13-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 --- 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 13:18:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657010 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC7AE16EC14 for ; Tue, 7 May 2024 13:18:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087926; cv=none; b=WB7opHx0PMs5SRwUdCJXIAOcknIqp3n6TwZUb+fVnNlALtCHWcY9TkbpC3LkF47/dKHfg2YU9xol5IW8X+4uFFnu3uY6Um7yzJCanXt23JwYwvM94M/NU5OumOth/blQKZiXJwYowMjqlU+HoBX3EB7oWBY+CoCfKtFgB0iFmSo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087926; c=relaxed/simple; bh=yspSc0vXW80bDStJJU6njW8ROGAmYm1HyjTlHpef53U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uNuyP+AWNKkbFKoU6iSTPzFJWzppy3obJlHUxo5yH1egRyfeKuZNnDePD0sT4Wi0RanAk7+93CLpqg0PqPsXO3R67gtmpbQOejDm9KJh8KJ2tqm22vUIZEu4zu3piM+LfRJos8CCC5HPRlNQCwvsKxT5U8IDgSutkxTgMA6ayng= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=I65H6rof; arc=none smtp.client-ip=209.85.219.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="I65H6rof" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-69b50b8239fso29891486d6.0 for ; Tue, 07 May 2024 06:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087923; x=1715692723; darn=vger.kernel.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=I65H6rofeep41/6v6/LZuouHXo+dQExIclgd2rGra9OW1eOnPYVVEv/Rik8spS+1+c IWzHOTuICIyl5VcEPSF3ctMSYrkEt4IA8EN/qRKYvxocv3l7hQbP/D8mIsK4yxSHdW8S 1J4qwjQhDcZMoYD2dLjqaSbb2dImNFlxQ+aAc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087923; x=1715692723; 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=eCx20DAVCvIwlP/Xo5RsvNccX+L2Wgv50TPvXvWwLq+2hGLzRtofZRD7dzddRkwehK ocqQQGydJvIgofiIhyz18zuWa2V8laX2SPDe1ycTaQDer/0uet+xntfVJXx8muVmblr9 /jVLw7VGhx6YSRWGtR8+/YvUKaK4L1HTNLkci7urTomMseruMnxz5PVKo5wV/1xq9NzM xT2sjsXK6tWJ6y/QOUZa0d12T3+c+238c0RC80ZnwHH7h0fzjfnys5sfit22ApSY5L7G PLd7p6sH6d3bK3UiXon0vns3zGA5mZwu80aiCz9PupuSwi5WspHr1iDweFo84Gbu07nZ ILUg== X-Gm-Message-State: AOJu0YxtKPwUrfqkaI2tkbA7zIaDcLI6JWHKCdtmt6RhM87m8cu2JRRJ JGfvWRB9ZRPn6tAsHmxsLaCWDT3AUvakO1QKIJfYKYYOOAZXfB0NwYK23TyoHA== X-Google-Smtp-Source: AGHT+IHtK11JNQ0Mp4ZynJH1X6U9hIM5Ax6eZry5/k41CUicJOL6ws6WrCLsSXzFe5ZsTI8+M4i8kQ== X-Received: by 2002:a05:6214:288:b0:6a0:f057:402f with SMTP id 6a1803df08f44-6a14608b428mr41532076d6.32.1715087922869; Tue, 07 May 2024 06:18:42 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:42 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:40 +0000 Subject: [PATCH 14/18] media: venus: Refactor hfi_session_empty_buffer_uncompressed_plane0_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-14-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 --- 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 13:18:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657012 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4242B16F0F9 for ; Tue, 7 May 2024 13:18:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087927; cv=none; b=kVYf20bZPOx9OFoZOjintIzvO/ElZKGcGqVZgC4qNyotkId+Zmtoi5QY60o8JWhp4vx9Eb6pozRypMPTJmQJhxIk51OSC8UCGlKxxEHwNGBYK3elR1AhaaDHK6CktoXDD3FZI87vcHKC3dA/mLrhvFCidJUt7Yo6qdTSLGij+mI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087927; c=relaxed/simple; bh=NAI8v6owc4vhrxHrnDBAOrLbBtSLWdHrs5V1XLgw6yE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PcaEt9ZRAzd/3x/JMkPDhgZzf9ye/hGig6Pyaz7tGSfGbbZUw+b3uFyWUgFAqhwhotfkS77QKmu8djye0TuDgv082PJIJkLfzv3+X5WeOutWLAosTphFikO6l0e+EKg+srt4Y4rcLeZ/rkWbOaJs4qWBAcdmiVDDxhhznPaigMA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=mkE1ZY08; arc=none smtp.client-ip=209.85.160.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="mkE1ZY08" Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-43692353718so22515631cf.0 for ; Tue, 07 May 2024 06:18:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087924; x=1715692724; darn=vger.kernel.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=mkE1ZY08WgFx5e9j3ZW6XfmX1UhPu3Oup76tcm/uSloODw+9SZu/D/pbdfy3EsNT4y 87Kfrmr9CEv/JFxXQgOdWTsOcJYquFZt5puPdTQeUMuAOC1dnmQ4pDIPVzrVBZNBqok5 KACSkAzkfY/LSexeSVmgj44XuGexd81Of1hfg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087924; x=1715692724; 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=dgrIeFZmgdWT2eouFGaTzmezV0peNVRhh61hU+dfR/T7QNpUaqgAym+ph7LD9wzBWj biZaXAjYwMKytUUPprVgZRfjrMxW3icMoyAvFA60/HJ7s/6y7786cy+KgAipUmFN0ef/ O+a46+3mOvxTLOHqE2x596IH5kfjijaNa7HE/WUbGpMXsmasAVjp/d+T7DFymz9SoSH/ Knl/qTF+u0kKGuv1znpFfw981AwZu/dCBx65wD9nsoxGAL50OmCRtDfy1Ovcnq/OyDFi 6kTRUi7EvYAkb+NygWQcc8tCWTRa4B95cuZ22Oq12c74l9RhVz9hsFgS2HDC2oDhL1r+ 9VxA== X-Gm-Message-State: AOJu0YzdwkxTOTt7mDmE8O3GOOyUQIt9RZItpk0NrcSa3u6TW4sxofH2 6YqJv+QdrM4HGIGXzLwuhM6iGPrtbwcK5SCwMJoudcgJCBSqHIilqxzu5J3Z1Q== X-Google-Smtp-Source: AGHT+IGtSin+RqjeeAuWjhc+2Qu533gps/bRqdwUKUS9So7G1IUcL44UetlZwIWAlGuPmz38aWSKJQ== X-Received: by 2002:a05:6214:d63:b0:6a0:c117:372e with SMTP id 3-20020a0562140d6300b006a0c117372emr15802826qvs.12.1715087924051; Tue, 07 May 2024 06:18:44 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:43 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:41 +0000 Subject: [PATCH 15/18] media: venus: Refactor hfi_session_empty_buffer_compressed_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-15-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 --- 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 13:18:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657013 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 359E216F29C for ; Tue, 7 May 2024 13:18:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087928; cv=none; b=InsfOh1K5pWjcYE+cbHDj9urvT3rxPMlGmcn9ouNCa7tzNlFHYF+0lE1vrmD506ZrTVOJgIe4nuSz+Cok91HYP7BlaV4cJ7hMeahx8g9uolx4BKZ7Y3rM46E5HR3To62Ab0mebWSE1HFV3ugQJFRU2awn4UCZQq3epHDgOQIUlI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087928; c=relaxed/simple; bh=P3Bstv/vPDiw+M+/G70Utl3bAIKOevXPnXzJX41+MtM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YvhUvttT3zM22cZ340rXOoFXIgMl934rwWEIQNgGOiyeDkNA6606idKfi4mQJGf6KA7nQ6+oUGyU45u512XoLhzRwYmiJbHOsLs0rBaNwVHqS0UBnaYY0dlcEl9puRWu8MTqBxAKO8akwNTT06cqNaEkgewwMYLQf850fYyC6d4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=AZ9ltb3I; arc=none smtp.client-ip=209.85.222.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="AZ9ltb3I" Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-79291d441fbso286968785a.0 for ; Tue, 07 May 2024 06:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087925; x=1715692725; darn=vger.kernel.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=AZ9ltb3IB86//wjqAH7/jpArg1gKvlnnLw7s02NXnOtuJVXBWw7kooU45uZcNHklBd aK1pD4AXZnXMMGAv5kdV2vRa6gjO5ckfFFKqygzSku65tfhXBWoSHHN07jwtrr32lHe3 exseckclPfoZlET2o8NH98/Ha8qaJQFh8sXNo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087925; x=1715692725; 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=PeIIZTWElNlEg9M89a/WY+pdUjdHVCMSjhVKlyWfy/8OJ7J/CFSV6BFmXqhHAlUpjk XFgjorv/PPJ+QpexRW7mVgiGiFS3rURssPSZqOIOnLI9aBbG4wfzkNPLbToXs3HkOmxP F2RDDyCMvUdgKRwnAi9pbtVRW978MpbtC47SjzcXk70ZBo5qJ0PNUH1EBSCKG/uZxX88 I6khXydzyEaVsxNCp8YztTNjLQ+cfu4wQfGFbti0O2nrHoAGYtmDlWgiAxmgM3e2U6pJ 5O5QBqz9iDPg7IMP46k3rX4gkJkvAhlHlIfxeEtlfrYcQfUCJAgbjAPpKNDNgdYR4t3t IPVA== X-Gm-Message-State: AOJu0YyuWebNbebRmL4w3WkWJQ+HK+WcqekUzqksmSyBrZ3hYbshdB0K ES9t4ZInmT/U0oRcgJg8xFvHMWaVDqf2LZHXg5MA5FMjIsYoLWQxTLJtY7+h5g== X-Google-Smtp-Source: AGHT+IFjQZjYTO14egmCt9EZ5CsVr4euVVQfMTbFSXKPd+8yhvIiVkrVYxti26YpbA+ubiSl4OVazw== X-Received: by 2002:ad4:5fcf:0:b0:6a0:cb53:a78 with SMTP id jq15-20020ad45fcf000000b006a0cb530a78mr15569643qvb.8.1715087925149; Tue, 07 May 2024 06:18:45 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:44 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:42 +0000 Subject: [PATCH 16/18] media: venus: Refactor hfi_sys_get_property_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-16-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 13:18:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657014 Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8A8416F834 for ; Tue, 7 May 2024 13:18:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087929; cv=none; b=OH5fRCq6/tGq6yZZSRgQtsJ7DqDJddRC8k2DAHKI1H6RA73JS5WojXbzMwKKlT5/x8Cn9CVQCJIOVhNNC1FQbndTOLYJR5TLp4iaOV3pQoWDy+P9KRVxgKjMvdz5oCuZ6+eSbZSRj+gY39Clw6Kqsw7v6i5tFZHCI5VjLd6xk6c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087929; c=relaxed/simple; bh=elaKiW1ZWISf7j4z+HRijCG6vyiv0mxL1YyGQ0pIffU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=omFR3ImYfqSGZbnTz4k19cjLLKMTfe3JLEM7Bg8kjEuEBLzSH6KAwcC1Wubsi4OYwXZyPtjFE9D4zvx3cD5hcNGiNRrbqI2jIb8dzJ9KJ3ka2b3AU2BzubVIbqslWGk8WDXb9/cRm6Bu3Bb70QTv+gjavr4eA58ghfYWqsrrWzQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=nZYAGeqY; arc=none smtp.client-ip=209.85.167.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="nZYAGeqY" Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-3c86f066256so1750307b6e.2 for ; Tue, 07 May 2024 06:18:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087926; x=1715692726; darn=vger.kernel.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=nZYAGeqY3KsuXviL/MhKELUaufwc5kYqtWJO7OylzglCLXWkJHdLNCK6vbQqX/WS1E xHpXeaz9GtHx+TB9rqJLucFJT14yKWSOXxt1bE0otb8xib8e+S6cnGYJ4wE6epOsEqk5 g8i0q7/DL65FJJLy5Ltj+3Sz2Lq8267JZY2Ic= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087926; x=1715692726; 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=mmrqbvDAiaQZB0/Z1wfv6ohHvQEQprSydyyvd4N7WL9aaJ+pQf+pmGk0lLA7wnw3GN T+BZXfXOL/4Qo6uAG689r68ADGPhhcC7X919o+2+fNNna8HRvPEmyAp+bsDy+VYaZt6m GdRKFN5l401jOasc8Gn9LPQZeH4FKIdlt+Nz9q7wy0io3QfE3yZMnXXJDciYQBmX25Q3 Hh6woeeqKPkXImCcKf72ZxVwfJ3WSIejVr6gbK4Z2QqyjeDHZV8IC3rP/9qW1jRpkP5y gYsy28gHXSdvpvUsDzId0SjG+WZiDF+SuZvpK60YgJXPhTakraOV2qeyFVHZFCKmWeZA JfMg== X-Gm-Message-State: AOJu0YyBdw/1E+b0HCZk29wQZp3U035o9/41lrOBu/BYfkrIEn24qW0u UXHBVe026GYzxXRBMnvpFxYAIu6py1Ksw10KpSF0xzNbr66f5PNCphfIWZqzRw== X-Google-Smtp-Source: AGHT+IGZMw5Pha/VROCdriiOpH8uUYadLoc23B2z0lYFRFwtANajXpC+2XNhKb0eZC6xMtAWx6sdeA== X-Received: by 2002:a05:6808:4d3:b0:3c9:70eb:151b with SMTP id a19-20020a05680804d300b003c970eb151bmr4342969oie.59.1715087925910; Tue, 07 May 2024 06:18:45 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:45 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:43 +0000 Subject: [PATCH 17/18] media: venus: Refactor hfi_session_fill_buffer_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-17-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 --- 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 13:18:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657016 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB32816F85B for ; Tue, 7 May 2024 13:18:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087929; cv=none; b=XNvetHaIi3aGKIEfbVi6NU2I+GXWCvXtJsGydQpB9AC+cC47DuELFlGKRSgQ3mTCrLH1u0At4YLvrqmByqra9fEyRpGKudHBO0OYLXz8UQ5CLFjfIAQ25512gDSjEHVbzgA3CSx26znWwi32ynQkaODp/2aSnASPJd3E7/UMn5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087929; c=relaxed/simple; bh=xx+wxFNs3ZuqK7Hxds/mLdbM5HIFghI8UQG5DaBamLQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DAqMtgQYVK3RuQsml70ZmOQbHYT/HK0ox8OJfWF5kLFVmVrEZ978QxoDAXXxc3ozwBX46wd2H+CW9i5dbwWotiiDJPEqyLU1ftzaK1S/HROMIOvl5vNyqPOln6ozQfLa9QLDsLT8VTT3xWwdT9gKAj2+9vX0STacxtZjVSPIuWA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=garPljce; arc=none smtp.client-ip=209.85.222.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="garPljce" Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-7928c5be3deso250384385a.0 for ; Tue, 07 May 2024 06:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087926; x=1715692726; darn=vger.kernel.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=garPljcecjdkN6g8mvA+SMMfsdgqxokHgqjgJwXYDnh+7+6pxUpSAk0DUlD95uevNs TCt/3xTog5KdLlcGfUR/zheJUzVyYhjYmnE6SQaQP9+qsMZI+sQILhIXBVQG+OLCt7+I RnDymbMwEyyBe148rcabRZCSHfxiCz58EKJPk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087926; x=1715692726; 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=kazxyLSWG0oYPeselmCl6Ebu4cac0x7SDYddgu0O525h8NgcC3VpnwN9rLi+ZdXZN4 ePTAMBaATN2+ZdJN4r7l7mGhhGKJZHYVO0qcumWWPtrEymeGeNfGSQJudg1sb4XlN0oz /e+2GHB2ZciKnddWtUznTz1BuDPRgVm57CsmqnlGGtXq4DD5P7ZfNaMZ8F+LvoVd/XP6 75apYsofuTTXiAHhK+PHfEpbmHjd6nMuTmIJpJ1jisW6DYHjCYvBQodY5E2skIlMffNK 1W7OdFMpwNRvN2qGB/+Bpgy1+0e3zBSwRFq4hGXpqbYFoZZiWg3G6jPbtUHsJEfMF7Vl 1rEw== X-Gm-Message-State: AOJu0YzEc0ySmua4m/n5bEtZ3Rg3T/DBpPdpTtchWdmvj4//G83WeoAZ Krk/VKr5a2Gq7vbfSzQQ08aTrtV4SnikEz7RevDRCCu4i7DNcTcD3Gu2rKPzJw== X-Google-Smtp-Source: AGHT+IE6WEUHWsRpAsJ5BK3gENbuRTlCVd8egHvgiFgdym5FLM6gUWkr0leru0COMDpv6wPoQvFI8w== X-Received: by 2002:a05:6214:d6a:b0:6a0:c903:7243 with SMTP id 10-20020a0562140d6a00b006a0c9037243mr17142784qvs.55.1715087926638; Tue, 07 May 2024 06:18:46 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:46 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:44 +0000 Subject: [PATCH 18/18] media: venus: Refactor hfi_buffer_alloc_mode_supported Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-18-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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 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 {