From patchwork Tue May 7 16:27:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657440 Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.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 A0B5816C434 for ; Tue, 7 May 2024 16:27:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099233; cv=none; b=Gkr1P2kk1VQtxzWxUBk0tVpV1GCD76d3o2o9QVBs4hcQ0o02/QsRxeD2PO2eE+grewXyHovGqEkTEHjtRSPOPHfIt7HbwDqx+Mt4h4PGrlpcehR3AChH4CUZAu7+KUTewTGsRx4m/KsggyLcxBhHfbWpkz2r36NvnVzAXWK9FsA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099233; c=relaxed/simple; bh=znTu4kcBZIJ40DAZAzE4ZarYw+mhmMYgFA8GYOICILk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KuQVBEND0tONHGzQjLggSE4NdQzcuDktJfArroWpgW88uHnFAScdOq100J+yV1Su/EAMSOq1Hx6xZNMaiSdVWcLKbUKGhnrk/3JOEehxkKuzL7ALJcGvs8LbPRZitHpwtkSQGo0i8dzOlstUs4+MPxwcD6N3uBoYuWjmgcoy+mw= 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=XxRE+I/T; arc=none smtp.client-ip=209.85.160.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="XxRE+I/T" Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-43cff222427so13955391cf.3 for ; Tue, 07 May 2024 09:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099231; x=1715704031; darn=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=XxRE+I/TVdkqbZ70usqG6oIolpD7Sj1GI79dpPrxojndgCxNE+f3K4rMKKp8kAloPI xre8gfimtXQ3UyvB9XzsGI1YzMX9GjUk2eo3Tjjy5/K1mJV8rdIWoM/2LXzeFkJmrtD4 JnmiYRf9UYJ8zhJolP5zKBVR8EUE66AeQ9nY0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099231; x=1715704031; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XvJOy5lJ/u6e9yHF9m7H/WFxuEXKyxfgmG432+rwWPs=; b=C5zETEPcGqB8qBn/0QfyC/ftM4+Zs0nNcqsLCwnMTXVlcr/0XpkXlIX8gNpJa+EKlO iwxVBFC4dBco4aItfN73weUVYmiozXBQPdmBJCLBlY0HJq6k6D5ZS6t0QY8MfBsVeBnM q5XVNBjR7nokzJyLDQCREe6Lb3UuNMjROl46dEP906bATzSwlwmDiGEe4It/JJiPAYnT tzFL5biKBiBmFHwrmFy5efFPRMnmQXNvFt3jHOGaVn1y0NLDFvqE64006i1z4SWV9/Zh lErXXkFCcrRPNMmgVhjizuz73G3dmGpRKKnIaAOn6ECvXiXKsHxQTRrzEpcZGQ4DYtim L6og== X-Gm-Message-State: AOJu0YymY1UclLh0IjSd7rZn4pjMGThTDXeSpqLyx3FXvF1/IHfNUfC2 pxZHUWfJCY9CgLWWv5NVQVicOYQ7/9Gf3XuJM5Axcrr6iRx7B49facSp+9qyxg== X-Google-Smtp-Source: AGHT+IH7wfmDbfR6Z2qEtq3pMk9IgeemDK1hAb5WzD+t2OuchV1RCwEJOdhdz0vPw5QCvormiuhN7g== X-Received: by 2002:ac8:5882:0:b0:437:c024:73f3 with SMTP id d75a77b69052e-43dbef87227mr2207121cf.44.1715099230572; Tue, 07 May 2024 09:27:10 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:09 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:06 +0000 Subject: [PATCH v2 01/18] media: allegro: nal-hevc: Refactor nal_hevc_sub_layer_hrd_parameters 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-v2-1-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 Replace all the single elements arrays with the element itself. Pahole shows the same padding and alignment for x86 and arm in both situations. This fixes this cocci warning: drivers/media/platform/allegro-dvt/nal-hevc.h:102:14-22: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/allegro-dvt/allegro-core.c | 6 +++--- drivers/media/platform/allegro-dvt/nal-hevc.c | 11 +++-------- drivers/media/platform/allegro-dvt/nal-hevc.h | 6 +++--- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/media/platform/allegro-dvt/allegro-core.c b/drivers/media/platform/allegro-dvt/allegro-core.c index da61f9beb6b4..369bd88cc0ae 100644 --- a/drivers/media/platform/allegro-dvt/allegro-core.c +++ b/drivers/media/platform/allegro-dvt/allegro-core.c @@ -1852,14 +1852,14 @@ static ssize_t allegro_hevc_write_sps(struct allegro_channel *channel, hrd->dpb_output_delay_length_minus1 = 30; hrd->bit_rate_scale = ffs(channel->bitrate_peak) - 6; - hrd->vcl_hrd[0].bit_rate_value_minus1[0] = + hrd->vcl_hrd[0].bit_rate_value_minus1 = (channel->bitrate_peak >> (6 + hrd->bit_rate_scale)) - 1; cpb_size = v4l2_ctrl_g_ctrl(channel->mpeg_video_cpb_size) * 1000; hrd->cpb_size_scale = ffs(cpb_size) - 4; - hrd->vcl_hrd[0].cpb_size_value_minus1[0] = (cpb_size >> (4 + hrd->cpb_size_scale)) - 1; + hrd->vcl_hrd[0].cpb_size_value_minus1 = (cpb_size >> (4 + hrd->cpb_size_scale)) - 1; - hrd->vcl_hrd[0].cbr_flag[0] = !v4l2_ctrl_g_ctrl(channel->mpeg_video_frame_rc_enable); + hrd->vcl_hrd[0].cbr_flag = !v4l2_ctrl_g_ctrl(channel->mpeg_video_frame_rc_enable); size = nal_hevc_write_sps(&dev->plat_dev->dev, dest, n, sps); diff --git a/drivers/media/platform/allegro-dvt/nal-hevc.c b/drivers/media/platform/allegro-dvt/nal-hevc.c index 9cdf2756e0a3..575089522df5 100644 --- a/drivers/media/platform/allegro-dvt/nal-hevc.c +++ b/drivers/media/platform/allegro-dvt/nal-hevc.c @@ -210,14 +210,9 @@ static void nal_hevc_rbsp_vps(struct rbsp *rbsp, struct nal_hevc_vps *vps) static void nal_hevc_rbsp_sub_layer_hrd_parameters(struct rbsp *rbsp, struct nal_hevc_sub_layer_hrd_parameters *hrd) { - unsigned int i; - unsigned int cpb_cnt = 1; - - for (i = 0; i < cpb_cnt; i++) { - rbsp_uev(rbsp, &hrd->bit_rate_value_minus1[i]); - rbsp_uev(rbsp, &hrd->cpb_size_value_minus1[i]); - rbsp_bit(rbsp, &hrd->cbr_flag[i]); - } + rbsp_uev(rbsp, &hrd->bit_rate_value_minus1); + rbsp_uev(rbsp, &hrd->cpb_size_value_minus1); + rbsp_bit(rbsp, &hrd->cbr_flag); } static void nal_hevc_rbsp_hrd_parameters(struct rbsp *rbsp, diff --git a/drivers/media/platform/allegro-dvt/nal-hevc.h b/drivers/media/platform/allegro-dvt/nal-hevc.h index eb46f12aae80..afa7a9d7d654 100644 --- a/drivers/media/platform/allegro-dvt/nal-hevc.h +++ b/drivers/media/platform/allegro-dvt/nal-hevc.h @@ -97,9 +97,9 @@ struct nal_hevc_vps { }; struct nal_hevc_sub_layer_hrd_parameters { - unsigned int bit_rate_value_minus1[1]; - unsigned int cpb_size_value_minus1[1]; - unsigned int cbr_flag[1]; + unsigned int bit_rate_value_minus1; + unsigned int cpb_size_value_minus1; + unsigned int cbr_flag; }; struct nal_hevc_hrd_parameters { From patchwork Tue May 7 16:27:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657441 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 82D6516C6BD for ; Tue, 7 May 2024 16:27:12 +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=1715099234; cv=none; b=SrI4rMpzEshVr+iEHDe68W7onj32biueq01CX0QA6dwZvtjtN6q8A12zxctMd1+hW8+KNHe9fxlbXp5PR9g1V5fEJQF5Sz/uFlZqUar4jFwRprLkZUrsocImK68IWjOXib/Vd3jRdcjxN99eAbkiVgs2Zup5G3yH9Yi8qakdL40= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099234; c=relaxed/simple; bh=gcgfOXZpVAPIhRvVAmX6aT02WeOzRZpm8OajsHdcMqo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=n8b86wzwoTfnZh5OtBO9FeI52Idc8GqULTbTMC6LsgXDmcEND2LBa2Uy9DOZ4ygBIB/fmnVNAb9NInJ8Y/4xtBviHz0WX+hExoOgi4kPpr3KkANSbzGoP1Sgt5SyXj2YD45A2sVJ7cuSNCONpJoWwwZcX6sFil229LFlT8mA9Y8= 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=EWrsmasr; 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="EWrsmasr" Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-43b06b803c4so22429511cf.1 for ; Tue, 07 May 2024 09:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099231; x=1715704031; darn=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=EWrsmasruJmAsuCQ4HnwOxZv3Sb1Qb+ZKM+FUTvAwpxy1MTn509ain+ehT3gI1Qbgq t3Yuh7VCJCzeS5hTdMDxxwB4Aik0qSw0dDgFveURZxjDhdZtEdYcAeSmyCAkoKgY8hS3 r9QPmJjf6xDUxx+sgkc/JVsYlbRStJjA9npP8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099231; x=1715704031; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dp/a3NMmYGz+hm8qsmJibF9yTx35ajv4b4FGHxOOJ3Q=; b=NvaLYxCD+Nbg9YSusx7wU0a2qFNAX74K2HsunoeB/37Dk+cHs00pGF5bc3aCA+ec60 KAVooqRaR2hmKVhiHNuR/QpdJr8h4MZFcPeeH/Vcoa7ZhxfPf3jBanhNskfQi/ZVdGZh 1OWUHN2hsrVuMeu7qJjlUesRbqZW1x0UIM6NxzaAwOkMBdwcIu1bDy8vSTNxBxOm0gpd AvF7h/Xhcm2BA3OfsVrIJGPqo9dAt6T/FADQ4YTbmTDhRoRgQGZk++OxFAJoQqtPu+d7 nl5djGSVSw9Icpl4Lc4Y4bPq7HF4GOgfR4kK0W9V9yGXuhvG/EFSZwsT0rVuHp7Z1pWY oTOw== X-Gm-Message-State: AOJu0Yy/jYuLTUAlPYghGB99WrGVCr8IQ3Jmpm5uimVvWAs+ph3VmjR4 gkyDytR6qZLqg14V8LBY0oi2x1+APolwZzsokwcjlEQUG8oMD26qEv82ecGckQ== X-Google-Smtp-Source: AGHT+IEOeHKGmS3SHashwweKO/vUQBNCSRFTe5jpqSXB3JxcQpvTp7L0R+6KghhNE4f3RITfPrM5nw== X-Received: by 2002:ac8:5753:0:b0:43a:f64f:c2a with SMTP id d75a77b69052e-43dbf853b66mr1566601cf.46.1715099231571; Tue, 07 May 2024 09:27:11 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:10 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:07 +0000 Subject: [PATCH v2 02/18] media: xilinx: Refactor struct xvip_dma 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-v2-2-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 Replace a single element array with a single field. The following cocci warning is fixed: drivers/media/platform/xilinx/xilinx-dma.h:100:19-22: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda Reviewed-by: Laurent Pinchart --- drivers/media/platform/xilinx/xilinx-dma.c | 4 ++-- drivers/media/platform/xilinx/xilinx-dma.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c index a96de5d388a1..a1687b868a44 100644 --- a/drivers/media/platform/xilinx/xilinx-dma.c +++ b/drivers/media/platform/xilinx/xilinx-dma.c @@ -348,8 +348,8 @@ static void xvip_dma_buffer_queue(struct vb2_buffer *vb) } dma->xt.frame_size = 1; - dma->sgl[0].size = dma->format.width * dma->fmtinfo->bpp; - dma->sgl[0].icg = dma->format.bytesperline - dma->sgl[0].size; + dma->sgl.size = dma->format.width * dma->fmtinfo->bpp; + dma->sgl.icg = dma->format.bytesperline - dma->sgl.size; dma->xt.numf = dma->format.height; desc = dmaengine_prep_interleaved_dma(dma->dma, &dma->xt, flags); diff --git a/drivers/media/platform/xilinx/xilinx-dma.h b/drivers/media/platform/xilinx/xilinx-dma.h index 9c6d4c18d1a9..18f77e1a7b39 100644 --- a/drivers/media/platform/xilinx/xilinx-dma.h +++ b/drivers/media/platform/xilinx/xilinx-dma.h @@ -97,7 +97,7 @@ struct xvip_dma { struct dma_chan *dma; unsigned int align; struct dma_interleaved_template xt; - struct data_chunk sgl[1]; + struct data_chunk sgl; }; #define to_xvip_dma(vdev) container_of(vdev, struct xvip_dma, video) From patchwork Tue May 7 16:27:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657442 Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (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 3C95016C853 for ; Tue, 7 May 2024 16:27:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099234; cv=none; b=XboY7hTkxXPHTCZm870DQZYTwnBlKomBplFNppBugQKzGGA57lFNFvb2h8m2rv+bsghvlzgWf3cQUxUAl/UI8ej+8qw9OrxWPluQppfLcY6CX1H0wE32IpVy/E2UMwwZfoESV7njCw2BBwVihjSy7OC8Rg1Q36/U6nv8rIvNuc8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099234; 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=GrUghwBGRD8VQcFf8BTzolr3+WW0hXBzHSrS0d2F3v0/ou4tsYbAGdrST4GHCuyWbCITuPSRt+VPKfyV9ORQZppVFuQ1oA3dUaZsoDzs/bCC5SVXjlii5oXFm100Hsq5lMU3WGX7wJdNW6byz4coknNceYf57aDOOElsclKzKKo= 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=aOZS1PuR; arc=none smtp.client-ip=209.85.210.53 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="aOZS1PuR" Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-6ed3587b93bso2067923a34.1 for ; Tue, 07 May 2024 09:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099232; x=1715704032; darn=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=aOZS1PuRYowzcpnKFw93tyCjn1TMW/H+eUOMROQtGijkZWCUuVLHsSdHdOGAneU3Og H8nSJOW90VS7gDBO1PX54YohzD31tINvktPfYeCjwYaYx7b+DKwEAeJs9Rly3y+psNBK P4w1INioENzgvSHG4+EFsAdzH6Q3pttcEc+68= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099232; x=1715704032; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2A/cdtQJ5ubVGGh9zBSnEjfvf8aW68DShS0IQqplaqg=; b=W8qx3xOGpp/0D945pKVKMbWJnH7o7AdboO3toNy2w/6mFJ7Pi1i9fmbni8gtN3vk3l /yUe2RazmVzdGCS22CGEc32ciLcqIyqRowqQP9BPd7zAZb7yOJqUbwDXOJuzOv+z+HvT CdXMQefVapvlcatkiq1wgqH8HkUBjt2uCmluQZkutEAob36RFxTLC0YuDg9GS0Rawydf U5OpEFN/o9wroj0FPYrFeNd8Ynu7vGU9I5J2ahtbV9/E1J1feKq6B/D/i3n4o11+GOCs wi9r8ZH6XBolj9QhCETkOainZn8Tzx/Epro7IKRtTsxkosG55yj0OBQlXOGpzu8efJxZ Qhcg== X-Gm-Message-State: AOJu0YzIgn7ptBxJb+cr6lgm1krLYkqSVeW73nz8hp7ZmZTDxzPxDG5h NPMEAYPMzjhh8cBoY5ouRFiY7tmQ/2u5WYHXtKj0RjBtNRmKYQ3BNHVik7jFzA== X-Google-Smtp-Source: AGHT+IFNJz8W2TliqlWnVCfeJU7sKKv7snchkh8btiT9U1bG50pXZSjddsLAAbR+Un47VkXMoaVYdg== X-Received: by 2002:a05:6870:e998:b0:23e:b42a:499 with SMTP id 586e51a60fabf-24097bdf8camr109598fac.2.1715099232296; Tue, 07 May 2024 09:27:12 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:11 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:08 +0000 Subject: [PATCH v2 03/18] media: dvb-frontend/mxl5xx: Refactor struct MBIN_FILE_T 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-v2-3-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 Replace a single element array, with a single element field. The following cocci warning is fixed: drivers/media/dvb-frontends/mxl5xx_defs.h:171:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/dvb-frontends/mxl5xx.c | 2 +- drivers/media/dvb-frontends/mxl5xx_defs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/mxl5xx.c b/drivers/media/dvb-frontends/mxl5xx.c index 91e9c378397c..a15c0438b07a 100644 --- a/drivers/media/dvb-frontends/mxl5xx.c +++ b/drivers/media/dvb-frontends/mxl5xx.c @@ -893,7 +893,7 @@ static int do_firmware_download(struct mxl *state, u8 *mbin_buffer_ptr, status = write_register(state, FW_DL_SIGN_ADDR, 0); if (status) return status; - segment_ptr = (struct MBIN_SEGMENT_T *) (&mbin_ptr->data[0]); + segment_ptr = (struct MBIN_SEGMENT_T *)(&mbin_ptr->data); for (index = 0; index < mbin_ptr->header.num_segments; index++) { if (segment_ptr->header.id != MBIN_SEGMENT_HEADER_ID) { dev_err(state->i2cdev, "%s: Invalid segment header ID (%c)\n", diff --git a/drivers/media/dvb-frontends/mxl5xx_defs.h b/drivers/media/dvb-frontends/mxl5xx_defs.h index 097271f73740..3c5d75ed8fea 100644 --- a/drivers/media/dvb-frontends/mxl5xx_defs.h +++ b/drivers/media/dvb-frontends/mxl5xx_defs.h @@ -168,7 +168,7 @@ struct MBIN_FILE_HEADER_T { struct MBIN_FILE_T { struct MBIN_FILE_HEADER_T header; - u8 data[1]; + u8 data; }; struct MBIN_SEGMENT_HEADER_T { From patchwork Tue May 7 16:27:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657443 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 14B4116C870 for ; Tue, 7 May 2024 16:27:13 +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=1715099235; cv=none; b=UTr1HgBXgjqCVMrBIIB9ua4VnijNLboM9O+TUvXv/+IdDbKG9A5TKjp8n3Sd7sXUovYlXsHui77lu1PbcJAvy7PLAC9Qsb0a2/9YOiYemWwGp7XX5aXjS01hF4KMrZE0el++oqiw8XFImQy9gXpKhCDjeFuVrfFpTvVmVBuj5Qk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099235; c=relaxed/simple; bh=OkrWWOrUN5GNEWioxP3gYdPUo0/0BfsqCVC0RCoziIM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UYsnMtiz/oi15lRYBKvkhGPzHTzdj4B3O6XslC+CLaebBiX0gU2aGsE51VRC8GP4Lhp1KaE7ym/sK3MDkaB6DyaAGSwekT+tkxGEH4ivQ2xMvT+wGv8BhauPqTaPhW7AwC6AD1LYm1XZ9q5RpP4z3jOGYqNmVc+nZDZSlE5UpJY= 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=XAmU4MYL; 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="XAmU4MYL" Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-43d2b4d4d3eso11665871cf.2 for ; Tue, 07 May 2024 09:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099233; x=1715704033; darn=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=XAmU4MYLi02oAxX+z7YpNhFUitd+z+s2/ZOhYAy6yaVetxmgXSpGURekWjjgAUa6jG VIm0RbDfmm7P0O5j9sHsPbV++h8J/7OD874thrmLJyGM9oeyexdvAe20zb52YWmfPcCe mQeE8LW6y4KVyL9iTrbV68gBhmLkSUAkRijBg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099233; x=1715704033; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1/P1ujR64RjpeY3CCEbW1xPPMvUuqlT7weCmbLOLgyg=; b=FOIXjgJjE9HyX6Xrr8nhQYK1MC5WQMwFPYn/MFA2AOvVJNXfbwGIs8Mgf4cjRQDNcs 8Z2EZt2laxm/Turea6TCdHo/uu9gAZ8oQ6j83cS9Yz1JZNHyDt/wyi3xFHWU9r65W8Ns Mo3iiXsVbYGWk2o2+cWT/9/0XGuL4j0SOJoDO4hNY2y+59bCXyfyffyh4xVo+CfGrvzx lnB37EnoXSfFys+mRASPNcEEQ6bRXW1cch/mkCqq+1gUnMrl45+FqqV+O9916cpQoIB+ mCgLabJEixmRV2GXN7BNlaiTDNy/hZBc/eTFcjgD5si7lWymcskZI5KplzxBTyvs5WAM Xh0A== X-Gm-Message-State: AOJu0YwQrin6BeYq0wtHuCguPzsQxnNg+9ugCGYsLjLYNreCewbV0N3p qtkIjdIcdetkQ5P+vsc+YvlRnnRv738HgPVXL4TE2baj4eCxbQaL2bIbGaM5sw== X-Google-Smtp-Source: AGHT+IF13hjL17rg1ksLknz8RID4/qPhKnOZgs0TD68SX8wPAxraoJfg23Be6Og+r0EAzRQ8G/LBRw== X-Received: by 2002:a05:622a:2994:b0:43c:748f:6e96 with SMTP id d75a77b69052e-43dbf622550mr1868001cf.39.1715099233022; Tue, 07 May 2024 09:27:13 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:12 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:09 +0000 Subject: [PATCH v2 04/18] media: dvb-frontend/mxl5xx: Use flex array for MBIN_SEGMENT_T 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-v2-4-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 Replace the older style one-element array with a flexible array member. There does not seem to be any allocation for this struct in the code, so no more code changes are required. The following cocci warning is fixed: drivers/media/dvb-frontends/mxl5xx_defs.h:182:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/dvb-frontends/mxl5xx_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/mxl5xx_defs.h b/drivers/media/dvb-frontends/mxl5xx_defs.h index 3c5d75ed8fea..512ec979f96f 100644 --- a/drivers/media/dvb-frontends/mxl5xx_defs.h +++ b/drivers/media/dvb-frontends/mxl5xx_defs.h @@ -179,7 +179,7 @@ struct MBIN_SEGMENT_HEADER_T { struct MBIN_SEGMENT_T { struct MBIN_SEGMENT_HEADER_T header; - u8 data[1]; + u8 data[]; }; enum MXL_CMD_TYPE_E { MXL_CMD_WRITE = 0, MXL_CMD_READ }; From patchwork Tue May 7 16:27:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657444 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 9E74116D308 for ; Tue, 7 May 2024 16:27:14 +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=1715099236; cv=none; b=uZIJAWLGb5QtWphr+xetThnGwO0YmaPuXn8um6Ox2XgE+TlRt1mTQSb7WapAwhEhBf4aZuJV9DW6IS1JrQkIyr0MLKA6k2wuAAtR5lXT2OROrQ3KNQ5cwNmrfS5B1QAF1ZRxtKKx/6xctmHJD4vVDIgd+Xyl37dcYeOq9wcrJJE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099236; c=relaxed/simple; bh=Ybzvge6Uw1Eh9FNqgRzW6qmy53LUrGIUlQOKIfHH8ug=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lPzm5zSZwNHUrUmAZmqR7XPEhHApCRvJJzJNmc4gni4dqI2QB4Ep6ENQ/5rT8oSDem2yi33ljKZNzdbEhHVOk+qQjShpXpjgHbvdXwa4wsTSnFmGePndFDVy8jhQBTVmEvWLPSStS5SB29w5FYdKE+9n8BxUJHRuHpsuvxUzNVE= 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=QW9gJ5yp; 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="QW9gJ5yp" Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-43ab76cac73so31118051cf.1 for ; Tue, 07 May 2024 09:27:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099233; x=1715704033; darn=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=QW9gJ5ypl03UwodfkeFY8pxPS83KW6HL+RNZ95hB3frMgnXPejntZrrwmLsoZ6Irg3 M+IJCLVXluMO9DWeHleoeguQlKPdg6CVYTYAb6OVQq+IkHkUH5R4c1bQYWj+UVegOOKy fzfiSQ6a58hSgddB5ZYYMrg4sKZYRfH+usGmk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099233; x=1715704033; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yEp5ZozBkj0x9D1ws5SUxXE7DcMsbsSxhL1FOw8KqVY=; b=qPrrp7YaQVyI5lSNPg4VGFYMA6PJnwzgPOeAGNzixjyJdftHu8xevpAOEmlQF5tMTn WdcnDdrwgG+8ttXNGwgTvaVPWFH0GXWVZjh7I1KNvvWRdf8VXvK4fqGYGDIPrG+ZNO/F 9sV13JD4vZ9ffGf9/RjyYSwFM1w7uabSIGQzpiOLQkCscyNwdOSFb0xlDKSWWMeHVDBR XbPD2xN4fILCbWGLz7z1hhQYMYuvNPqyuAQoUt5BOqHKwfjfrVregM0o+fjdwjeIFxJq hCTg7Hi2L4PORMABo1dhvIJhU0gu4NsfEzFDBZZdYFq8JFRIyLMq5DaC3D1enIziKJbO SOlg== X-Gm-Message-State: AOJu0Yzb7HlZuVvd+xKcrJ1hNlaUWQHAjJKTHubQP9g0Q59GOaae/HW7 jTMfIWWfPvsWqDgaruJVbJoVCU8asDgqYxrDDR+6xURWloJuypCg1ee2v8c7HQ== X-Google-Smtp-Source: AGHT+IFG5P8cF3bvogi35ZVCCh3mpoFd/JBPtTJGyHj5A6ptYc39Pcqw/IlsAeEpo3GtlKvW+qflBQ== X-Received: by 2002:ac8:5a15:0:b0:43b:16d1:a6ee with SMTP id d75a77b69052e-43d8f44bd11mr53130171cf.17.1715099233681; Tue, 07 May 2024 09:27:13 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:13 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:10 +0000 Subject: [PATCH v2 05/18] media: pci: cx18: Use flex arrays for struct cx18_scb 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-v2-5-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 Replace the old-style single element array with a flexible array. This structure does not seem to be allocated in the code, so there is no need to change anything else. The following cocci warning is fixed: drivers/media/pci/cx18/cx18-scb.h:261:22-29: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/pci/cx18/cx18-scb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/cx18/cx18-scb.h b/drivers/media/pci/cx18/cx18-scb.h index f7105421dd25..841edc0712ab 100644 --- a/drivers/media/pci/cx18/cx18-scb.h +++ b/drivers/media/pci/cx18/cx18-scb.h @@ -258,7 +258,7 @@ struct cx18_scb { struct cx18_mailbox ppu2epu_mb; struct cx18_mdl_ack cpu_mdl_ack[CX18_MAX_STREAMS][CX18_MAX_MDL_ACKS]; - struct cx18_mdl_ent cpu_mdl[1]; + struct cx18_mdl_ent cpu_mdl[]; }; void cx18_init_scb(struct cx18 *cx); From patchwork Tue May 7 16:27:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657445 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 094F916D4D2 for ; Tue, 7 May 2024 16:27:15 +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=1715099238; cv=none; b=kbUoaTNQNvgMv3qUWpdJjm/z1eTgsfw+iVMTSEdLSRh+8R5THl2bBs6sVhrhmVwZjknRQrZa1+93AKJ8+3Mg7NXu5hCVmWtaR657g0lZAR7CJQbIFJ5x51L8uypIu+dk54bsQt0gPspJxvyJOo83Thai50U3PWbpYj6Gt/bXtLU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099238; c=relaxed/simple; bh=TBNCx1gGrBDy9NxmrHPxnzPFvK9qlBkf27idsj7B9Cw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VWVu5fTU/OI/yaT0aO+dwP/ENQdSqN1COyBi4Cw1Khw7ZoEheMm/16v6sqrviQrnfpKM/Oj5+eklhZ3jUCAbHxN8XyuTKl07nrzHSm9sXlrywqGldelf7Roun2b4ySRO2c2GPo34rt+NI0YkehMguB1bLzHpH2P3qNxHHBwLN74= 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=lxo11x3g; 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="lxo11x3g" Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-3c96be1ef20so1349572b6e.1 for ; Tue, 07 May 2024 09:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099235; x=1715704035; darn=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=ckyXB1RMjwvOvAxa8fnxheCGm68/C6yK7+APpHNPb5E=; b=lxo11x3ghsc929qK2ouDhbNp1XXSubGQ+xHrF3xRV61eMhBUSy3MO6hDwDntJQOWMa vdp6uuLnm2lQOAiI4C4IQouaPHpNPj9Hth+LlKxEZUeUHUCj3t7C2L3C+t7FU+GiiPH1 cGBeGjqXE+dC33Km/zbjEksoo3JwB7aT5AhvI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099235; x=1715704035; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ckyXB1RMjwvOvAxa8fnxheCGm68/C6yK7+APpHNPb5E=; b=ox/iOFcUYEDpdlthuvm15j1jkvLcU/O2CrxWWQJZPBzxiWrNqECVnfNl1UordwpTiq 3ArwAIKCK1N2qr9agv4UNQcKRk1Eirti+7ZrA1pCeYKyPvTRAi4i7cCmyGxVTSEvIWNa opuSf03J5NzR38Rawdv8QCh304gmfmz3r9nDIl186tHFdYcmdFB9chyMwRiDKCYkrH3T L4EWPyFLKnjuOEInhpQBf1qWnAtOl/B3P+0lBB90IeN3ozJ493YkxiEEhUsh5oPPw+zB YQ8RTBssUgLRxaO6LriC9unur7OVdokL+A1mZKNypnV1CK42PY/tzASLKHwUngpEtee/ ZGcg== X-Gm-Message-State: AOJu0YzMPdVZxc/Q8vB+LTCFKRS/K7CWzlCt9fl6GZbOEtNTEKedsgWs 9nZXQ/Ah5cgUoTBiYuxFZvSNQNZTnvvcExZQOM7y90vPlb7Ay72Ej3epZRTa5Q== X-Google-Smtp-Source: AGHT+IHK8MR0ETZCa+Cso9ZcR2kzwzSwWzWxtW7LPWutI3GEHlRvYRnkrjbzVhChzSF546k9ojGUqQ== X-Received: by 2002:a05:6808:2ca:b0:3c7:3d8f:7ef1 with SMTP id 5614622812f47-3c9852be83bmr64772b6e.17.1715099234965; Tue, 07 May 2024 09:27:14 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:14 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:11 +0000 Subject: [PATCH v2 06/18] media: siano: Refactor struct sms_msg_data 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-v2-6-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 Replace a single element array with a single element field. The endianness conversion code seems to support multiple elements. To avoid changing behavior a pointer to the single element has been used. This is safer than moving to a flex array, because in that case the structure size changes. This fixes the following cocci warning: drivers/media/common/siano/smscoreapi.h:619:5-13: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/common/siano/smscoreapi.c | 10 +++++----- drivers/media/common/siano/smscoreapi.h | 2 +- drivers/media/common/siano/smsdvb-main.c | 4 ++-- drivers/media/common/siano/smsendian.c | 8 +++++--- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/media/common/siano/smscoreapi.c b/drivers/media/common/siano/smscoreapi.c index 7ebcb10126c9..b6f1eb5dbbdf 100644 --- a/drivers/media/common/siano/smscoreapi.c +++ b/drivers/media/common/siano/smscoreapi.c @@ -839,7 +839,7 @@ static int smscore_configure_board(struct smscore_device_t *coredev) mtu_msg.x_msg_header.msg_flags = 0; mtu_msg.x_msg_header.msg_type = MSG_SMS_SET_MAX_TX_MSG_LEN_REQ; mtu_msg.x_msg_header.msg_length = sizeof(mtu_msg); - mtu_msg.msg_data[0] = board->mtu; + mtu_msg.msg_data = board->mtu; coredev->sendrequest_handler(coredev->context, &mtu_msg, sizeof(mtu_msg)); @@ -852,7 +852,7 @@ static int smscore_configure_board(struct smscore_device_t *coredev) SMS_INIT_MSG(&crys_msg.x_msg_header, MSG_SMS_NEW_CRYSTAL_REQ, sizeof(crys_msg)); - crys_msg.msg_data[0] = board->crystal; + crys_msg.msg_data = board->crystal; coredev->sendrequest_handler(coredev->context, &crys_msg, sizeof(crys_msg)); @@ -1306,7 +1306,7 @@ static int smscore_init_device(struct smscore_device_t *coredev, int mode) msg = (struct sms_msg_data *)SMS_ALIGN_ADDRESS(buffer); SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_INIT_DEVICE_REQ, sizeof(struct sms_msg_data)); - msg->msg_data[0] = mode; + msg->msg_data = mode; rc = smscore_sendrequest_and_wait(coredev, msg, msg->x_msg_header. msg_length, @@ -1394,7 +1394,7 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode) SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_INIT_DEVICE_REQ, sizeof(struct sms_msg_data)); - msg->msg_data[0] = mode; + msg->msg_data = mode; rc = smscore_sendrequest_and_wait( coredev, msg, msg->x_msg_header.msg_length, @@ -1554,7 +1554,7 @@ void smscore_onresponse(struct smscore_device_t *coredev, struct sms_msg_data *validity = (struct sms_msg_data *) phdr; pr_debug("MSG_SMS_DATA_VALIDITY_RES, checksum = 0x%x\n", - validity->msg_data[0]); + validity->msg_data); complete(&coredev->data_validity_done); break; } diff --git a/drivers/media/common/siano/smscoreapi.h b/drivers/media/common/siano/smscoreapi.h index f8789ee0d554..46dc74ac9318 100644 --- a/drivers/media/common/siano/smscoreapi.h +++ b/drivers/media/common/siano/smscoreapi.h @@ -616,7 +616,7 @@ struct sms_msg_hdr { struct sms_msg_data { struct sms_msg_hdr x_msg_header; - u32 msg_data[1]; + u32 msg_data; }; struct sms_msg_data2 { diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c index d893a0e4672b..44d8fe8b220e 100644 --- a/drivers/media/common/siano/smsdvb-main.c +++ b/drivers/media/common/siano/smsdvb-main.c @@ -689,7 +689,7 @@ static int smsdvb_start_feed(struct dvb_demux_feed *feed) pid_msg.x_msg_header.msg_flags = 0; pid_msg.x_msg_header.msg_type = MSG_SMS_ADD_PID_FILTER_REQ; pid_msg.x_msg_header.msg_length = sizeof(pid_msg); - pid_msg.msg_data[0] = feed->pid; + pid_msg.msg_data = feed->pid; return smsclient_sendrequest(client->smsclient, &pid_msg, sizeof(pid_msg)); @@ -711,7 +711,7 @@ static int smsdvb_stop_feed(struct dvb_demux_feed *feed) pid_msg.x_msg_header.msg_flags = 0; pid_msg.x_msg_header.msg_type = MSG_SMS_REMOVE_PID_FILTER_REQ; pid_msg.x_msg_header.msg_length = sizeof(pid_msg); - pid_msg.msg_data[0] = feed->pid; + pid_msg.msg_data = feed->pid; return smsclient_sendrequest(client->smsclient, &pid_msg, sizeof(pid_msg)); diff --git a/drivers/media/common/siano/smsendian.c b/drivers/media/common/siano/smsendian.c index a3573814919b..b957970c7d97 100644 --- a/drivers/media/common/siano/smsendian.c +++ b/drivers/media/common/siano/smsendian.c @@ -20,11 +20,12 @@ void smsendian_handle_tx_message(void *buffer) struct sms_msg_data *msg = buffer; int i; int msg_words; + u32 *msg_data = &msg->msg_data; switch (msg->x_msg_header.msg_type) { case MSG_SMS_DATA_DOWNLOAD_REQ: { - msg->msg_data[0] = le32_to_cpu((__force __le32)(msg->msg_data[0])); + msg->msg_data = le32_to_cpu((__force __le32)(msg->msg_data)); break; } @@ -33,7 +34,7 @@ void smsendian_handle_tx_message(void *buffer) sizeof(struct sms_msg_hdr))/4; for (i = 0; i < msg_words; i++) - msg->msg_data[i] = le32_to_cpu((__force __le32)msg->msg_data[i]); + msg_data[i] = le32_to_cpu((__force __le32)msg_data[i]); break; } @@ -66,11 +67,12 @@ void smsendian_handle_rx_message(void *buffer) default: { + u32 *msg_data = &msg->msg_data; msg_words = (msg->x_msg_header.msg_length - sizeof(struct sms_msg_hdr))/4; for (i = 0; i < msg_words; i++) - msg->msg_data[i] = le32_to_cpu((__force __le32)msg->msg_data[i]); + msg_data[i] = le32_to_cpu((__force __le32)msg_data[i]); break; } From patchwork Tue May 7 16:27:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657446 Received: from mail-vk1-f178.google.com (mail-vk1-f178.google.com [209.85.221.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 0586016D9B2 for ; Tue, 7 May 2024 16:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099238; cv=none; b=iKPY4L+qmLd8vE6VleV34NUXIZKOgCKi9vF2lwqIskXYxNBuod4gstpmgX84p5RwTMTZJg5MA9LXoFOzaIrmDFYGdQ4spBIE3G0Tpw1oitbladTAJyUqhki4IOl0qomvGWiT38T2KAnyA9pKwG6hqlIm3PgxmFSnHIIMAfg+NbA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099238; c=relaxed/simple; bh=ENYjVBtJ4EPS9w/ftPm8y0fja8ouSlg/VUcwtfy4KyM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jll0vjnwJCZIPmaDDXfe2rl+pSerOXDs8tZong8ueueIWwkH4Vy0Hu8blGgfZUYaLXZOR3e1neQD6E05wQxKw/CjZVtkmHeVWGStVotUewmWvfRNSAcmmGqvNXVk1drIVdi4aVbvPMErBKBEqQiExLoGbZurLSA9gFDDjNAhTWA= 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=UA3k66DF; arc=none smtp.client-ip=209.85.221.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="UA3k66DF" Received: by mail-vk1-f178.google.com with SMTP id 71dfb90a1353d-4df4b388887so534078e0c.3 for ; Tue, 07 May 2024 09:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099236; x=1715704036; 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=UA3k66DFfs3JyEw6Ln1PQp42U0s8/PnEhrADYrBRrV68wiEopRlrjbeo4QlpOpjp8m 3kJidugwcb8u74p5/ZEfcgZQKRRPFFnD+3pISJp1t12on7X+hI/WVwUe9IAaru/GLXM/ fcoJmssdPd1J55izmRHLqXY1UCsYcwziFqODQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099236; x=1715704036; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bajBIKBKiGkzVrECr+DrCDdr2oyOzpQYYR0WAIoyaos=; b=peKjVqcPFXKDzU4wp9GCLfDkw+cqEH3iEw/nI47AWCn7mzelg5wpAERRJxnoRMgULk Dj7/QZYqdwYPpimtgFQVUbKNjz3q4YsdOZx6e2a0SI/LEQynPH48UfqxIDEFW9QHRpm6 k7FQUxOvWUXAJ43ktobuPEIQx0x+oAyP0TncVGe0EbjPMuCG+PZWpKBcxasc2ohhq543 6KMlYgbRN22JwsVP/LKHDKxvkq8BElquygKLx/eXWS31w67Tmhl65785B/zG9Wgcp2yk uHB1HiR9lrojlG6Bmb4u8nnFC5MNuztGYvZzV/jIshLGRgAKgQZp3LJu73/Hx/7Bczr9 TV6Q== X-Gm-Message-State: AOJu0YzaHg7VmMKNY9vyANc61mDWv7P8L3MPwpiV6Fr2dNpGDN+E6EaI /B2KC2ov83652rM2nuatjK5SAJpvD3AfD8tPA9qz08wWPlZ9iFKtMF9hnPi7eA== X-Google-Smtp-Source: AGHT+IF792y8yHb1G1T8p5qXRpEfx35eaFsBGY9qOmU3ppGSWJfi2EDsEDzymoanJSEvwZpNFlF1oA== X-Received: by 2002:a05:6122:2a02:b0:4d3:4ac2:29f4 with SMTP id 71dfb90a1353d-4df692a6b65mr38747e0c.2.1715099235965; Tue, 07 May 2024 09:27:15 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:15 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:12 +0000 Subject: [PATCH v2 07/18] media: siano: Remove unused structures 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-v2-7-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 These structs are not used in the code, remove them. This fixes the following cocci warning: drivers/media/common/siano/smscoreapi.h:1049:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/common/siano/smscoreapi.h:1055:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/common/siano/smscoreapi.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/media/common/siano/smscoreapi.h b/drivers/media/common/siano/smscoreapi.h index 46dc74ac9318..bc61bc8b9ea9 100644 --- a/drivers/media/common/siano/smscoreapi.h +++ b/drivers/media/common/siano/smscoreapi.h @@ -1042,20 +1042,6 @@ struct sms_srvm_signal_status { u32 request_id; }; -struct sms_i2c_req { - u32 device_address; /* I2c device address */ - u32 write_count; /* number of bytes to write */ - u32 read_count; /* number of bytes to read */ - u8 Data[1]; -}; - -struct sms_i2c_res { - u32 status; /* non-zero value in case of failure */ - u32 read_count; /* number of bytes read */ - u8 Data[1]; -}; - - struct smscore_config_gpio { #define SMS_GPIO_DIRECTION_INPUT 0 #define SMS_GPIO_DIRECTION_OUTPUT 1 From patchwork Tue May 7 16:27:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657447 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (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 CF96816D9DC for ; Tue, 7 May 2024 16:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099239; cv=none; b=ediNSShpnjDppoyHF76Bs+JWYL7dgM3dQ964LR0QYRebTntOO6n35xdqnOOFq+90ElzkRthvWN0nPomNRysVhh9yUegr0NV4ijJJuV51Zkt2F8rq+3dbSkxSlbnmiEs7PlxYNZczlLQnnEHKP+qCzMq1YUxLd05UHZ5UZFindkM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099239; c=relaxed/simple; bh=3FQmdzC7rLah5bHXqxL1pjRWMb/l2vnOq/dIwPsVxiM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=A02zBcZV6QwJ8Fk3nVCRvKhdf+d72YEypMmsAym7xinq1nUFLlgRCcbvpzlrS07TpwANPRwgyZLVut00772QY1ZBJNyoU0I0klQgIOSx3SQTZ8Ew5yxRSh293mrsP2ckSvNOkiQp4bosOz8lncnHnYz/oABxgui3emyGVfIPkXg= 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=d2fw3tcx; arc=none smtp.client-ip=209.85.167.173 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="d2fw3tcx" Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-3c96a298d5aso1550488b6e.3 for ; Tue, 07 May 2024 09:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099237; x=1715704037; 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=d2fw3tcx8B7ebQuzRheafY/HF13lspqh3qU2RkyjcthAncGKEa7QeIed+ec4X3NLv+ 7MRi9U7Vt1ATwL/dQIezPReprvccyBX5OKfVejS+EvZkeUxmu2MNo64kczGvQNqe8DUg G3RX+SjTHmVUCLghqdzIK6J3gbIowcPupJR3s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099237; x=1715704037; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JKfhOSoHE1VqyRhgB0xYInvnK6a8zz5LZUqmCULZe+M=; b=rc9aBMEGAW8gjUkxkk/VgiWpfMdRRyJfziWVExq4qAxHIkTuXcmDLdDkQnbILu2Xvf W/uExdUnyFt6mvLqNq40rvcdhgbGhXgQj/sfWfL++DBFAfCWKzqkPGNMe0yinZ+mB8QP C+nCtfxkrVSz4L57If0BDsXdlPogqE0rUdQlmCjKzxl08GZUSsWD3XJC+FjXIIVAthyr PsmelCAd5Iv6f6wXFPlO//n5YnhJHCvYjvlBIQLKVP5m/Ucre3Rpsm8wVT26GVlT9KKn U1DVUvve/vkSR3nvMdDArRQ2fDjoF2YkAYnQDHwgqzerRTjm47+Mnr5UAU3vW0kDtfqY vlzg== X-Gm-Message-State: AOJu0YwinPgy123FsC4ap11/NGVIcnfSe2k1E6aVbPwrodqoypDvYKO9 9Eh71+B+/Ah7u3alVMJZj/Cs2QpFXMZ0iIXvhuEJdwid5dqW7Zqy8XnMUm7S0A== X-Google-Smtp-Source: AGHT+IH1n5rgepkFv+DmmmLViOZnDel/iUrOgLICLSZETgB3GeR4REJxlmdXw7sr6mA1VqvgfFFkzw== X-Received: by 2002:a05:6808:1990:b0:3c8:665e:1e57 with SMTP id 5614622812f47-3c9852c99fdmr89999b6e.25.1715099236642; Tue, 07 May 2024 09:27:16 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:16 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:13 +0000 Subject: [PATCH v2 08/18] media: siano: Use flex arrays for sms_firmware 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-v2-8-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 Replace old style single array member, with flex array. The struct is allocated, but it seems like there was an over allocation error: fw_buf = kmalloc(ALIGN(fw->size + sizeof(struct sms_firmware), SMS_ALLOC_ALIGNMENT), GFP_KERNEL | coredev->gfp_buf_flags); This change fixes this cocci warning: drivers/media/common/siano/smscoreapi.h:669:6-13: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/common/siano/smscoreapi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/common/siano/smscoreapi.h b/drivers/media/common/siano/smscoreapi.h index bc61bc8b9ea9..82d9f8a64d99 100644 --- a/drivers/media/common/siano/smscoreapi.h +++ b/drivers/media/common/siano/smscoreapi.h @@ -666,7 +666,7 @@ struct sms_firmware { u32 check_sum; u32 length; u32 start_address; - u8 payload[1]; + u8 payload[]; }; /* statistics information returned as response for From patchwork Tue May 7 16:27:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657448 Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (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 7FD0716DEB8 for ; Tue, 7 May 2024 16:27:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099240; cv=none; b=FshuRASf1nscqox6IwI82aEqhdjZaLR/xZs+cyQzkYzARzR8ivy8EeJxj7StL38i/vlzmCnsm/n17djA0O77cmuTzd8erAK7YBvBEDgWHySpaX1tkrwHVngRAd/NqM7BCpW4RruMY/LP8IePZKBt5DJDk9+kPKAfP9IrLkA5oEs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099240; c=relaxed/simple; bh=wXllf/Q1F0asZS1sTnO9eU/dGVrc8mBHMAVhM0rUTv8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=etXEUZCTXSua0vAjyodLckXx0e++Reapqjp9Ofxx059JJG+t+aCNNd8E7w+ZCw6rW8VbzMu0dartxBdnQ1BPs6SUNdN8fGi2OhZeFBIOODvA7xYQFOigaes8VApQCSxN9x5vV711b6m5m595Czp9FaB1QjKDxwVx299ED9fPtVU= 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=S8ipRpGA; arc=none smtp.client-ip=209.85.160.179 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="S8ipRpGA" Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-43ab76cac73so31118721cf.1 for ; Tue, 07 May 2024 09:27:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099237; x=1715704037; darn=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=S8ipRpGAFek1bIdCBm1Llol4r13d0Dl5r/F3x3OZRbzjhIIWT9Ez+irW1ivrFNR4B8 UquMySi/MlZOqdozUp8Y9G4pitEpb2fVGgaLfinoJo4Drn9iWJA39vA7Rx0cQyVj4ykO 1+8UJuWiMEtEzjlvp3xsQ3rALLUsUPQqDzk00= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099237; x=1715704037; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kaj6FcAMdKWO/HBrdvIpPTLyis7BoUMkhPcms6B+rAo=; b=YuJRH1+6/NY9Ob/mfnkBnY2tR2OlpWdmku8y80ufxKz8VKibpyIUkrC8WYuWAW84nu tddX/fniM60k+6gJLPiWeQisOqzg7b5U8mdBabAwR+0s0Nn7SgPbGJivhROA9a++0H4k +hQPjpIFxHidSJTW8XtnaB5uKzhD53Z+wLSI1M2Ic+KOXhVJiUpX+WgvKvqKwg2QVcNj qsIElbp4uU7r2QEmj+BsPI0IqczsgWK4ekmqVIC/TQ2VcZFcshiDyK31lK/6RFv7J9r3 vxZqR72liofO3ZB/BQlLUE4PXjW9kqKYV0v3g3zk3F2g7XOTIPJZuguQIiltayPxxJTD KQRA== X-Gm-Message-State: AOJu0Yw7amG8OX/orxaO6gouNpUl2i5fxQBzXsipBCSKl2SWEhIfjuzS oNjuiNnrs1BKZ+nHTl3tfkpiwp/eup/+gI480+9DwKBD3GKXA2gCWOtIqZP14A== X-Google-Smtp-Source: AGHT+IHj6qoRnVnypcfsl4SMsq6a3QXSfSAsL/0HydIZfs+TT2QxcbwCNWNtumzYnUMZlJ9mwCoojA== X-Received: by 2002:a05:622a:2d5:b0:43a:b29d:36ae with SMTP id d75a77b69052e-43dbe00e35amr4071821cf.9.1715099237518; Tue, 07 May 2024 09:27:17 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:17 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:14 +0000 Subject: [PATCH v2 09/18] media: venus: Remove unused structs 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-v2-9-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 This structures are not used, and have a single element array at the end of them. Remove them. This fix the following cocci warnings: drivers/media/platform/qcom/venus/hfi_helper.h:764:5-15: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1041:5-15: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1088:39-51: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1093:5-22: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1144:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1239:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1272:4-13: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_cmds.h:85:5-16: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_cmds.h:180:5-9: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_cmds.h:189:5-9: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_cmds.h | 26 ----------------- drivers/media/platform/qcom/venus/hfi_helper.h | 39 -------------------------- 2 files changed, 65 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 20acd412ee7b..41f765eac4d9 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -77,14 +77,6 @@ struct hfi_sys_get_property_pkt { u32 data[1]; }; -struct hfi_sys_set_buffers_pkt { - struct hfi_pkt_hdr hdr; - u32 buffer_type; - u32 buffer_size; - u32 num_buffers; - u32 buffer_addr[1]; -}; - struct hfi_sys_ping_pkt { struct hfi_pkt_hdr hdr; u32 client_data; @@ -171,24 +163,6 @@ struct hfi_session_empty_buffer_uncompressed_plane0_pkt { u32 data[1]; }; -struct hfi_session_empty_buffer_uncompressed_plane1_pkt { - u32 flags; - u32 alloc_len; - u32 filled_len; - u32 offset; - u32 packet_buffer2; - u32 data[1]; -}; - -struct hfi_session_empty_buffer_uncompressed_plane2_pkt { - u32 flags; - u32 alloc_len; - u32 filled_len; - u32 offset; - u32 packet_buffer3; - u32 data[1]; -}; - struct hfi_session_fill_buffer_pkt { struct hfi_session_hdr_pkt shdr; u32 stream_id; diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index e4c05d62cfc7..7c0edef263ae 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -759,11 +759,6 @@ struct hfi_multi_stream_3x { u32 enable; }; -struct hfi_multi_view_format { - u32 views; - u32 view_order[1]; -}; - #define HFI_MULTI_SLICE_OFF 0x1 #define HFI_MULTI_SLICE_BY_MB_COUNT 0x2 #define HFI_MULTI_SLICE_BY_BYTE_COUNT 0x3 @@ -1036,11 +1031,6 @@ struct hfi_codec_supported { u32 enc_codecs; }; -struct hfi_properties_supported { - u32 num_properties; - u32 properties[1]; -}; - struct hfi_max_sessions_supported { u32 max_sessions; }; @@ -1083,16 +1073,6 @@ struct hfi_resource_ocmem_requirement { u32 size; }; -struct hfi_resource_ocmem_requirement_info { - u32 num_entries; - struct hfi_resource_ocmem_requirement requirements[1]; -}; - -struct hfi_property_sys_image_version_info_type { - u32 string_size; - u8 str_image_version[1]; -}; - struct hfi_codec_mask_supported { u32 codecs; u32 video_domains; @@ -1135,15 +1115,6 @@ struct hfi_index_extradata_config { u32 index_extra_data_id; }; -struct hfi_extradata_header { - u32 size; - u32 version; - u32 port_index; - u32 type; - u32 data_size; - u8 data[1]; -}; - struct hfi_batch_info { u32 input_batch_count; u32 output_batch_count; @@ -1234,11 +1205,6 @@ static inline void hfi_bufreq_set_count_min_host(struct hfi_buffer_requirements req->count_min = val; }; -struct hfi_data_payload { - u32 size; - u8 data[1]; -}; - struct hfi_enable_picture { u32 picture_type; }; @@ -1267,11 +1233,6 @@ struct hfi_buffer_alloc_mode_supported { u32 data[1]; }; -struct hfi_mb_error_map { - u32 error_map_size; - u8 error_map[1]; -}; - struct hfi_metadata_pass_through { int enable; u32 size; From patchwork Tue May 7 16:27:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657449 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (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 678EB16E870 for ; Tue, 7 May 2024 16:27:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099240; cv=none; b=TdmHnLK1KpSVTzaxKLS0ORUalzu4eValqQQzXsgD5PshglQwAW3MT+Qfoa/X7+4eY0uR+0aPBsCdWEpqBkkF+h4kliAHkov/AFn3fEX1M7a0+t7TbyMjpxBG5zqlf+hoe1b2YAD2nPr0GZj1tHQ9m27IFNKb6w0zZcTbw1kyfGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099240; c=relaxed/simple; bh=9NQhYiz/IbLF6F7xrUyCvcZeCyvNKJflJvFw3WrA/2Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=htqnNuMngUNHpJ4D2+zrG9SFRJ9503o+K8ncnyVl7B+ein5CHAsdW/ZUXnLGIXV6VHacU0SanbJT1ANowKBgHJvbWaJAz4oZW1z34EOlzA6J85DLULGS6VwbmTTPMEZOZBGx33qkkaAlwMm7VVI/pVuPg88b9vqNCJKjAfo7Sq0= 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=X0fcPP6X; arc=none smtp.client-ip=209.85.160.175 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="X0fcPP6X" Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-43692353718so23891551cf.0 for ; Tue, 07 May 2024 09:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099238; x=1715704038; darn=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=X0fcPP6XV9gErF/+4W1Z2PmcakgwH2aR6w5ezvGuPZgIgzfX67v7HlVU9wXeFvw0QH kjerepixGiDuoMQQBv35iqKyJ2r/dXb0IP3Y39y91FJjN9db8u6c2BQuka7Spfg7FjoU eowjiNN+hFx3oyTZf85+N3+nqDs+thzQI/e0c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099238; x=1715704038; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WR87o59ttHnNvNigBqZHzwph/s3gT6BLw9Ga86sRtPA=; b=AMmOfRImm2agyggzXG/mt5vD6az/E4ALMjmx230pIYBLlAnmXnmMdw1FbxbpYYdweS zaZZgBm9FbTU2L7KBEki9iC9qZaVvQDhQ7tSv5I5NnqFDqm7npFgHHb+uaageXQWbVdg RyKLITS3mHOBgurKClL/CCqSNK6UNsChwARBbESXvXYJ+Zi0cLCDF6bk+wn8LAdTa3jh GiFGtj808//5xNa8KYzC5ZEqGEfF2ddDlwY3qFEnx3uPm5CMJkDaRcQWEqN0RxddwfYv U89XNHxvEw8YkeO2vk2+31vEdOmSKbyprmzhhOQS/cokd7ES7mZXddxfjuPkpWvE+o/u j1Rg== X-Gm-Message-State: AOJu0YyVy7EUFaGHjLozuo0R6RqgXXMhETxOI1CmDwaQtnpAWjtb3+3u kdkywXTR6LRicL2WC5F3cZa0klLNm5dkNo5JMJXYTSNDEyapU9m3snPR9DmfGA== X-Google-Smtp-Source: AGHT+IGBjH3AdmiLQTQFeu7s9S83R8vO1MeeESLv5H1A9n7OSdIiA2Y0rCHZA8aZ7JmFdPuh3j3q+g== X-Received: by 2002:a05:622a:1aa9:b0:43a:dade:7ad2 with SMTP id d75a77b69052e-43dbf51448dmr2415871cf.18.1715099238350; Tue, 07 May 2024 09:27:18 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:17 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:15 +0000 Subject: [PATCH v2 10/18] media: venus: Use flex array for hfi_session_release_buffer_pkt 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-v2-10-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 Replace the old style single element array with a flex array. We do not allocate this structure, so the size change should not be an issue. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:204:5-16: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 41f765eac4d9..6dff949c4402 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -201,7 +201,7 @@ struct hfi_session_release_buffer_pkt { u32 extradata_size; u32 response_req; u32 num_buffers; - u32 buffer_info[1]; + u32 buffer_info[]; }; struct hfi_session_release_resources_pkt { From patchwork Tue May 7 16:27:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657450 Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.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 0EBE216D9DB for ; Tue, 7 May 2024 16:27:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099241; cv=none; b=r+DjSc4rAA1D7mkSNqC44usBckTgPIS7bMXBsx0JKESq9sFERibAN05fgAZNgP1p7cusUXV80THb4R+tNvh/jt/EykIhqWRZYn2swMJww0ltDzU5QRi+GgSK9EePSmb/jZdaeH9zLUPYh9OCAuJGOrcWBzUmG8K9KqzGET/gnBY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099241; c=relaxed/simple; bh=ty0RG2AjLK5Y8dTp7JoVE8oXrIivf7wrKgPB1ia8aog=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mNkQwSgnX7GAD3aw5C1tSSfUECIBhOCrfH4GcOv8NchW4cndu46qsrxm6wFCXt5JWBQCD4rlrv9uonC2WRuaJe8aDZoOxtN18IzTC+AzrVsSyE1pN42PighKOvfN9YmwlYUuYYMqP73KoJWCE9+w7L7n6NAgcVZ1l6l9ch4gMGQ= 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=eWRLL4sY; arc=none smtp.client-ip=209.85.160.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="eWRLL4sY" Received: by mail-qt1-f172.google.com with SMTP id d75a77b69052e-43c5c5496a3so15194601cf.0 for ; Tue, 07 May 2024 09:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099239; x=1715704039; 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=eWRLL4sY5006yFpYtGO03NVIrSE+P/SXeJiMtBBShfMEu19+18l3U18AE23B4LO8ba tU8nSqMyERKIxFsGEDjeDMJDh6l2gpLS2CBUSUQvssQt4z0tFXfM1cOb2262uh+gsxaD o4R/SQZpOEAaUsrCYC6En4VCqbo1+06KlRdq8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099239; x=1715704039; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sqFGKWXdCy9k153fMpH4CQDZP31MGLQ/EHV/2T77xUQ=; b=JSkxDzrxLqkmu3L+a0CeEImulg5TW23FExVs1bgdQL5MEkr/xBjN9bfYNRK9R+cXtP TaiRR5QEZWQjQxcwFlhlE2oj7RmG6Vyd1aEzmJrr+Bq8axBi0lEu1zxdTDiEHbWR70kn ay0/jv4C7q6pjd4fEbGrMdhdoQU8XT0DZRq1r3eQhqtIK7hHH9ggezEOmYaQIAL8P6Tu Dbnyv2xEtNNyu8Dbv778Ebg4V7zvLVigA0TnmBGkiyuD9jed8YvZ26wLmC/vVHkrTOtD U/oVnu+TnFDz1L9xSEz+XyzDiWB2rn2sGN4/xDzxTxqY+Fhfgx7YawuAp6b9EGKVOhQ0 0qWg== X-Gm-Message-State: AOJu0YzOdVTWY3Rd3ylzXKd/n6Lm6owLqaklT1hMbFoJgqjwulqt7xYx a06QlYcZp1xAtATuB7uS667+HgqymDMonTKHDSVdRxKNvmPgd06vesc+fXEXeQ== X-Google-Smtp-Source: AGHT+IGXgstEE7t4iz9TrxJ0NJkr1ggK5ABmNVeWRW76pFKi5ar58B4xxCSQc/Pi6zqHMhxLCg5DXw== X-Received: by 2002:a05:622a:301:b0:43a:c878:d7c6 with SMTP id d75a77b69052e-43dbf0bb523mr2235441cf.66.1715099239035; Tue, 07 May 2024 09:27:19 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:18 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:16 +0000 Subject: [PATCH v2 11/18] media: venus: Refactor struct hfi_uncompressed_plane_info 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-v2-11-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 This field is never used, but if we remove it we would change the size of the struct and can lead to behavior change. Stay on the safe side by replacing the single element array with a single element field. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_helper.h:1003:43-60: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index 7c0edef263ae..eb0a4c64b7ef 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1000,7 +1000,7 @@ struct hfi_uncompressed_plane_constraints { struct hfi_uncompressed_plane_info { u32 format; u32 num_planes; - struct hfi_uncompressed_plane_constraints plane_constraints[1]; + struct hfi_uncompressed_plane_constraints plane_constraints; }; struct hfi_uncompressed_format_supported { From patchwork Tue May 7 16:27:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657451 Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (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 CA1FD16EC0E for ; Tue, 7 May 2024 16:27:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099242; cv=none; b=ZTJlZ9umWWu1cY+ey+OhLvDQ5YLBvtKCmsjlfHad8E8Mk6oQZLhl+4TyYOdtyTGMoynEmaa0VfZuIw3WM+pKm+MOrzwOlC91xpWy6hAHoSb5ahsgHgtmnlOBhntfZwVhzxDyoIgx0SJ/L+UDNT6nsfZSc3f6AWXwsW27aPDCLFE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099242; c=relaxed/simple; bh=cqQiASSb1ke8R5KptOfAxJYuMrFDRm8Ouf7QBhfinuo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KXt5xhYtqzF0NUuUgtSp8kKy3uTDRf9EBtd/JNB68jK9xP4GlbgvzZxbv1FbOukx4+/b528mtqJPTSAc0Wi93fMHrchH+dOboGBhsaxQRqhveovTQr/qvppSUfOW9H/VjWvRR6N11UJSUodkI/UI+U61nPY0zZSDIamzY6hoV1o= 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=K+IC5bPN; arc=none smtp.client-ip=209.85.160.174 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="K+IC5bPN" Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-4349685c845so19822141cf.0 for ; Tue, 07 May 2024 09:27:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099240; x=1715704040; darn=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=K+IC5bPNXCf9EbQsDCio0EEQQ89Rl0AWp3jW1km2IZUxiUzR8r6nK9t7wN6MSD6rN2 l75dvH1kZ2ikOphpShYOXCg4CRUGX763J/Czqm9bP8USGvETq2MdWWKBk0Ic7jvYVCBJ IGG3IO8dWU6mBHcszdzXe0t/FP8woipHBFIeg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099240; x=1715704040; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1Dzq1v7dj+VBVNk1zZzFNzIZj2cxfHYcizI+MBp1ZX8=; b=DPee5whIHPan8aJIAd4cEe2cOtdfz4wXUqSjyXX8HRH3RsQvs0gFlO5QBNAsei2tTr grx4KII/GlSYUIyfo3XkVP9vduMHi78VbaS56963l8gVs1uCwCixVODRYO1tpGOzOEna itYKYXwsx46qN0ajqgkT9VzBR4Du5V6lp8SFRgk2ydnKx5RH/u7OnZBOkp4HLxvICsc2 40bRlDL7ILjR6Z/w3Yko/yunKXruYi46++JQaX/0mu9n5hbWndqAdonFewhciB7tYiUu rn7T+qY1pcfb/nfB0OHxCVEch5MNEnH8tZnhUWt6JAXAwukVYbth7SI2aThlcdqTeqdU MZxg== X-Gm-Message-State: AOJu0YziFhBXhetTa5grB4z5T9sNyEaTrynO576YX6g86PypPFEUZQSA RMk3gjyPivm1S1sMSt+fFwayMpH5d4VKLdrHKwfHc+FRo6n4wgSlW38WV3x4Nw== X-Google-Smtp-Source: AGHT+IHXb5fqM0+WhwYErzB4YNZEKLztS54+R7oGh+gtQ5dv4ZRmegXN7RcfrH/DsD9yhahUSJeC+w== X-Received: by 2002:a05:622a:50a:b0:43a:829b:a32f with SMTP id d75a77b69052e-43dbf754b18mr1904941cf.66.1715099239735; Tue, 07 May 2024 09:27:19 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:19 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:17 +0000 Subject: [PATCH v2 12/18] media: venus: Refactor struct hfi_session_get_property_pkt 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-v2-12-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 The struct hfi_session_get_property_pkt is always used to fectch a single property. Make that explicit in the code and avoid a single element array at the end of the struct. This change fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:194:5-9: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_cmds.c | 8 ++++---- drivers/media/platform/qcom/venus/hfi_cmds.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 3418d2dd9371..520ff8a587e6 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -401,8 +401,8 @@ static int pkt_session_get_property_1x(struct hfi_session_get_property_pkt *pkt, pkt->shdr.hdr.size = sizeof(*pkt); pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_GET_PROPERTY; pkt->shdr.session_id = hash32_ptr(cookie); - pkt->num_properties = 1; - pkt->data[0] = ptype; + pkt->one = 1; + pkt->data = ptype; return 0; } @@ -1106,11 +1106,11 @@ pkt_session_get_property_3xx(struct hfi_session_get_property_pkt *pkt, pkt->shdr.hdr.size = sizeof(struct hfi_session_get_property_pkt); pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_GET_PROPERTY; pkt->shdr.session_id = hash32_ptr(cookie); - pkt->num_properties = 1; + pkt->one = 1; switch (ptype) { case HFI_PROPERTY_CONFIG_VDEC_ENTROPY: - pkt->data[0] = HFI_PROPERTY_CONFIG_VDEC_ENTROPY; + pkt->data = HFI_PROPERTY_CONFIG_VDEC_ENTROPY; break; default: ret = pkt_session_get_property_1x(pkt, cookie, ptype); diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 6dff949c4402..e1dd0ea2be1a 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -190,8 +190,8 @@ struct hfi_session_resume_pkt { struct hfi_session_get_property_pkt { struct hfi_session_hdr_pkt shdr; - u32 num_properties; - u32 data[1]; + u32 one; + u32 data; }; struct hfi_session_release_buffer_pkt { From patchwork Tue May 7 16:27:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657453 Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.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 97FC116F28D for ; Tue, 7 May 2024 16:27:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099244; cv=none; b=HNvjjQ7PL1JrEl1emL+saotY5YkUD7E+zeAsJa2ZxrvYWuawZ9sfokIcHb8FBE6LSc8BfOCYGH1keAKb8rpgBebTNfIIJLYGwiSYwK4VFwXX5xbcInrylJsSGZ8LDZmffdmyrgis9++EEcrj/KNVD1rFu0B3X6/zvd9hVo8wvUg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099244; c=relaxed/simple; bh=EDdfr0+Pnj9r3H0XIbqR962gzmaw2rY41SXbAP3xmuY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jX+lBT6279X7vQ7EewORYYqThyWcjOspK0dJqPM8rqCyNrnM4EZfyxuiZ1b7mWOJpT/6QhVzL9OOXKU7oHCfLurvPKupAApnBdbPdALcKbWMnWe/H/cY3VTLoWliTkLzpmWP3oRzBayhen1LPhWqP4+iy+bujO3FehwJAmT0ick= 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=WIKjFtO1; arc=none smtp.client-ip=209.85.167.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="WIKjFtO1" Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-3c96a34a263so977319b6e.2 for ; Tue, 07 May 2024 09:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099241; x=1715704041; darn=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=WIKjFtO15qIEiOUIaH8zNzHAeoTTRSau1VhKV0Tb8pgaGmqxd0Qsigle8ftUITsYhW QY6ViB12ThStBYQASSGqEWs8cIGw1ZjHM3bi+KLg7eLZUCItD3TkeXqgYc2umVmIkWp9 tHJz/xKRUiO/x7Lz2BI6PPc8zMp9d0GfIrrYw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099241; x=1715704041; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=grfwfbVNg0FYwVP8zOHueia/jYu69rJdnTVnLodDO7c=; b=XaFoIltg47jOGlXJTHM81WQxmmDjOIckkjgoebp5a3b4vDRzOHt02BeB+4mVyBzc9r xOOATpU5v32d5aDzCVXzNasdPCnlaaBOGrhTIlW3zkSc4ApJ+ht/9Igw88898UfPobs9 FnhM5EO3UQqlRKImc1hYnyzW+NR+ml1cNihWXB2CmjLPvADYZ5STWNW19cc6OJxWhoVg ACtPEMPrOS5xUe5gOtsT5sylYvgY9ixVyFpwDERfblCyAN2vxX7/MTpw8BpaEXvvAmtc FDRnUS/V93PHMe+ronrK0WhM4E8F3ebJ1z11V2cGVuIEHQyF2oZIkDBWrYMlB3Y46IXP 2V3A== X-Gm-Message-State: AOJu0YwgQZ0pOAeTEGrF4Y0sWTexbDAx/4NZaGqnidZtV0q8C+3ruhG2 xi2jWons/ZegY6ofjy0Ax7Qi3tygpYQljDjthWad7yNbXLdO61eve2nf5qaKBw== X-Google-Smtp-Source: AGHT+IGh8pK0RlJouH/fYCBI41k6wvrr3zRYdR0ye3qSLW9c+wx7vH7WZyfMG13hJNctWTluPMz8Sg== X-Received: by 2002:a05:6808:617:b0:3c9:7593:7613 with SMTP id 5614622812f47-3c98529bf00mr82279b6e.8.1715099240437; Tue, 07 May 2024 09:27:20 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:20 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:18 +0000 Subject: [PATCH v2 13/18] media: venus: Refactor struct hfi_uncompressed_format_supported 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-v2-13-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 plane_info is not a typical array, the data is not contiguous: pinfo = (void *)pinfo + sizeof(*constr) * num_planes + 2 * sizeof(u32); Replace the single element array with a single element field. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_helper.h:1009:36-46: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_helper.h | 2 +- drivers/media/platform/qcom/venus/hfi_parser.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index eb0a4c64b7ef..dee439ea4d2e 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1006,7 +1006,7 @@ struct hfi_uncompressed_plane_info { struct hfi_uncompressed_format_supported { u32 buffer_type; u32 format_entries; - struct hfi_uncompressed_plane_info plane_info[1]; + struct hfi_uncompressed_plane_info plane_info; }; struct hfi_uncompressed_plane_actual { diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c index c43839539d4d..3df241dc3a11 100644 --- a/drivers/media/platform/qcom/venus/hfi_parser.c +++ b/drivers/media/platform/qcom/venus/hfi_parser.c @@ -157,7 +157,7 @@ static void parse_raw_formats(struct venus_core *core, u32 codecs, u32 domain, void *data) { struct hfi_uncompressed_format_supported *fmt = data; - struct hfi_uncompressed_plane_info *pinfo = fmt->plane_info; + struct hfi_uncompressed_plane_info *pinfo = &fmt->plane_info; struct hfi_uncompressed_plane_constraints *constr; struct raw_formats rawfmts[MAX_FMT_ENTRIES] = {}; u32 entries = fmt->format_entries; From patchwork Tue May 7 16:27:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657452 Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (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 5B54C16F27A for ; Tue, 7 May 2024 16:27:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099244; cv=none; b=NtSA3EsJpLw8o1CZGx+W4Bq6X+/gaX3+4yW2/6bLdIcWqBSAlB40sraIw65U9BZN8rRAYqj8sDmLiyrYfOcTeMWOXUIoEeKCSGRTkXTqywbD0B6DY3KDKHm9bqbq1Cgiy+L6wpS1MHfWadWdwnlWFSq8z05IzA+c3iYuk0KBlpA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099244; c=relaxed/simple; bh=yspSc0vXW80bDStJJU6njW8ROGAmYm1HyjTlHpef53U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HmRZo0oCfQZ8RCSq2XD3hhaXYdWy2G0NDf0xbv/PLRf89bmMIhLX1UcCLGcNLCAV3oMvUiFlyPediO6dwdtRhGhyMThuAnQl+rJrWxF8CAbgJyiBGIRCZ/BLGihCf/GGFjhHbpWqnIGkQ8Os8/kDapY2X7mlSMbFhsEAoEACoR4= 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=Ih1Uydkd; arc=none smtp.client-ip=209.85.160.174 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="Ih1Uydkd" Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-43ad398f164so14397051cf.2 for ; Tue, 07 May 2024 09:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099241; x=1715704041; darn=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=Ih1UydkdSYL7D6Y4C6DxytlIs1qR81AfUGZZba3QfeLyiuXoWX1OriB+ok/TmrGPBD uAedXrg3bP3EnX7vIEybdyzlW8IeiUfUX6bE82uhK9Rab+xdcKrxxrb2Czdn41bLZ+gR gwlvrUJeUkXf6+lDwp+4UtgqeLc5RmM/aSX78= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099241; x=1715704041; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7NkWJe8JlogUB1KQ6tzpQTV71nluZthbO4z82dt8idE=; b=oNGCxGVfh8fqhWE1MVaXNSFoOU3WQK/k4uWmtG4S8NGq2G+7V6MEFCDGcovANN7MEa Hx1V7jJxBReNMdfOuNvQsyEUVTNXU6+c8DIW7ecWDA+NlffuGatOrxDuOgGFds91Qsxk vrhPbcCH3aj5axQDhEh9jRhBlVh/9OiyQHivyL1PcOhZOjllkaVRL97GlalSyycugaOr U0SrszU43gH5zy77cA3PGES4MubQYoxp2D8WyvRFykauIuCEUVa11wi1wQVEF0rVDTq7 1eOIAOkQpC9Qr2lXj0squimPZxazGzzEVAp/Fx3Ooht9CEhxdReshGVNdPvJtSU85MC2 EtdA== X-Gm-Message-State: AOJu0YyfJE2W7R7+JxA22LOJz5oi5LQ2nWxdGKZY86Lc77goa1k3X+70 lhb8/rAzB7pSAymllfy8AlfHf6TS0TO/UPu+s3+3WBEk2fvVJEPbJ2lIvbp0Ww== X-Google-Smtp-Source: AGHT+IGy63ktMUcef0pl0O/LB4NVLwAUnrH80knXHLAZJvTEQKiy8Aq4N4cNRIawlD7kkWl28ecX+w== X-Received: by 2002:a05:622a:1650:b0:43a:f441:b3ac with SMTP id d75a77b69052e-43dbf4e70d5mr2464831cf.32.1715099241340; Tue, 07 May 2024 09:27:21 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:20 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:19 +0000 Subject: [PATCH v2 14/18] media: venus: Refactor hfi_session_empty_buffer_uncompressed_plane0_pkt 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-v2-14-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 The single element array data[1] is never used. Replace it whit a padding field of the same size. This fixes the following cocci error: drivers/media/platform/qcom/venus/hfi_cmds.h:163:5-9: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index e1dd0ea2be1a..15271b3f2b49 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -160,7 +160,7 @@ struct hfi_session_empty_buffer_uncompressed_plane0_pkt { u32 input_tag; u32 packet_buffer; u32 extradata_buffer; - u32 data[1]; + u32 padding; }; struct hfi_session_fill_buffer_pkt { From patchwork Tue May 7 16:27:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657454 Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (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 98DCB16F831 for ; Tue, 7 May 2024 16:27:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099245; cv=none; b=FQhsuuoiDZOxCxAE/zZdw1vyMbjkyMEYrYRNMawt+j7qTbu4AwCjRR2lK59sEhT7yDCLzdjRjyVDBvIhZ/Cd+wKH7KMjgXuJSu90jueR9/qaujcVFwHsAQDLvCWu6WMxhZMZQPD2iq0X1IRiajRl7gWgTEHfaYH+XT/pN/wLBsk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099245; c=relaxed/simple; bh=NAI8v6owc4vhrxHrnDBAOrLbBtSLWdHrs5V1XLgw6yE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Maek1+H6pLkGICRIVGjihmYU4cB1oprA+E0C5lhYW52FiSOvTG5LQJSkLqqVBa1CSjLglsA3IPJsvQ7w7+JAY7n3FGgVJIPQms77/78mV3btJLq8nvMnpKPIlYQrJxx75134PCtQfz8BJI29NgHXNDLNyXF/ZZCHj9oYwKbFpCU= 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=W00zVTc9; arc=none smtp.client-ip=209.85.210.53 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="W00zVTc9" Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-6f05b8fc6c1so1328384a34.0 for ; Tue, 07 May 2024 09:27:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099243; x=1715704043; darn=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=W00zVTc9aMERGDSydzmCMFZRwcnm7aUra8kagSRdRTv8THCXr/AiIc7K81+Ciy7IEv i21FIFrJDTB1jBhQOJf7uuV0ngZwZ14aTFeeB6Ey7VIaTr1TKvfBwPdJ/vyHIu8Plgko Hbv98E4ThhatFk1snKI4i2Dgw+vUS4ICR9ZTc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099243; x=1715704043; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ksOWhtvDjU4SOAc5LYb/tmHPugkENGAwplW75xl0q6I=; b=xAWsrnMzdQrNTpI/8Z10sjHnlMKBrVbVJ5GR1QxHap1xf6Jx+KsKumLm0ZOQMcjPDb /sZ/eiNSYmhceXhXFADwPTOvl5jnEjeeIEonfLw0F/4nPp/KI3QxP/5SNXyi3fed7AXt oQcyEWsy/xYoUgkStX4BlZXsM662tdRW2DDdEEIHtoQFZwPR+bLQtjKVthmjK5PK6tiZ cOmkme7bGblixoUU9ieTNASbjvU90PGg37rXaIX1qnIYRJbY5lTzacp0oj7oh6susFVu d0LnMby9CEHDsxIvBp7g3++w6zUPCKS7/yWXe4AxH2oxc7jId9x2+otiH2QCADku5OPg hoZg== X-Gm-Message-State: AOJu0YzfQQ9hba+yXh9+o+JMJZT6n77UvUCKiY4tN8iSmsUQ5NA8KoVm vxtfN+L+f63Ih0bVfDmDgmic1XdnXr8ejKuX5YPNg6rEyZEwBqNthMDdqIrhFA== X-Google-Smtp-Source: AGHT+IHvsozzVLWdoiBjQEoTd85TRkr6VfUZ3BRsJ3jAW62XAs6ZO3NhOM6uPqcyccfc0QM2jKHKrQ== X-Received: by 2002:a05:6870:c392:b0:23f:eea9:ae74 with SMTP id 586e51a60fabf-2409915a7e1mr57362fac.46.1715099242010; Tue, 07 May 2024 09:27:22 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:21 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:20 +0000 Subject: [PATCH v2 15/18] media: venus: Refactor hfi_session_empty_buffer_compressed_pkt 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-v2-15-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 The single element array data[1] is never used. Replace it with a padding field of the same size. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:146:5-9: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 15271b3f2b49..02e9a073d0c1 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -143,7 +143,7 @@ struct hfi_session_empty_buffer_compressed_pkt { u32 input_tag; u32 packet_buffer; u32 extradata_buffer; - u32 data[1]; + u32 padding; }; struct hfi_session_empty_buffer_uncompressed_plane0_pkt { From patchwork Tue May 7 16:27:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657455 Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (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 B33F116F833 for ; Tue, 7 May 2024 16:27:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099245; cv=none; b=hR2G8vgldsCZeYw46t7AYxnz/c2adTq345wNO6b4p+8lCdxM4FGUjfkIHIayUPonpVqU21lZXpSTzHwgYKvCz4RChtKwzdpfrA+IKbeRmXkAsBa9+VGcnwrOhoU+x/PHMHnZ6I1ViQM39Cb9eYIytg/xhHnmepTdzIlqm3czraM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099245; 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=oQBIYB6GeFVmL/VoZROtXHLkbrIr4EeSz/imF9yooj7zsnV4qaY6RrKPDhQxiGG0cEfxwl4TX/KjWXUiTFQ+vMbTFlBAkai4foiGfzzWWqgKO1PbAxq1GdY3oHymQOMFyzZEkpGVpcYDSxeWfJxNKif59n80ESU26Cjf62a3j+Y= 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=VVhua+f2; arc=none smtp.client-ip=209.85.160.179 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="VVhua+f2" Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-43d2277d7e1so12882181cf.1 for ; Tue, 07 May 2024 09:27:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099243; x=1715704043; darn=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=VVhua+f2IRXtWZm+z2Ufi8G5EGsfSiIA5IyT/ME88xa87qP99xZm8fXUJXyPEJSpkZ 69D93gy9FlyCa2/++yv9qeL2jWnyKnVXaex1/IXCh8AYJlM5tmHUVze64Sgxg5o52nGk Sdav2TsI0a2gIboyQE+C4ZRc9pzpK82o+k7jE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099243; x=1715704043; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AxOzymIGy9oIqpVIjgGXcOBfnvf3rPmoINBWnjxn4+k=; b=woisvTJBFnck1YI+OSWWAzWx8ozKqV7RLOCbLQvesHT/bNQbDtCcv8OSBAl155YRLx 49/ujHOv6iyqBsHVDIP/MXnmGBWjsbGpmX1EScuxThRL8/QXN8x7R7+nUfxdT6HfxMwn 4iVAetHzKbyt0EsjmGCi9PAutI/ltd4QYjrNbE3eWUOFV0ydAvo4TSnJDZtjeaxrj7Et JzFTiLe4UpnE0IpC5jqNs8PnqqVhsO7wB4NwZtb3r6wtBK0asmNaC1Q+ACAVVuUa0HjZ x85b7iwGMMmOLOGiIi8+f5NwR9XSee8rOCzfns/lqIGKlbHjXpkKAN1XGzs91xYMfDd7 uY0Q== X-Gm-Message-State: AOJu0YwdLC62MLaBp62i72Gys+74eMsGCgx6WQ0H58BS5n/yDyKeUey1 VdNIyWBG7l0rH0ioEr4C9VWuyYacD9ud3/0nWhcprFeb40tPNf7LcBESAg3C6w== X-Google-Smtp-Source: AGHT+IFMJpzLoBuvnKke7M8L8J1XyGnz4DA/DXF7pnXaUcfUvIroWGA26PbBGScPt2HZrKUNAeWChg== X-Received: by 2002:a05:622a:40f:b0:43a:ecfb:8a5c with SMTP id d75a77b69052e-43dbed33436mr2631381cf.40.1715099242710; Tue, 07 May 2024 09:27:22 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:22 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:21 +0000 Subject: [PATCH v2 16/18] media: venus: Refactor hfi_sys_get_property_pkt 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-v2-16-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 This struct was only used to get the version from the core. Make that explicit. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:77:5-9: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_cmds.c | 6 +++--- drivers/media/platform/qcom/venus/hfi_cmds.h | 8 ++++---- drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 520ff8a587e6..c5123f2e76fe 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -151,12 +151,12 @@ int pkt_sys_ssr_cmd(struct hfi_sys_test_ssr_pkt *pkt, u32 trigger_type) return 0; } -void pkt_sys_image_version(struct hfi_sys_get_property_pkt *pkt) +void pkt_sys_image_version(struct hfi_sys_get_version_pkt *pkt) { pkt->hdr.size = sizeof(*pkt); pkt->hdr.pkt_type = HFI_CMD_SYS_GET_PROPERTY; - pkt->num_properties = 1; - pkt->data[0] = HFI_PROPERTY_SYS_IMAGE_VERSION; + pkt->one = 1; + pkt->version = HFI_PROPERTY_SYS_IMAGE_VERSION; } int pkt_session_init(struct hfi_session_init_pkt *pkt, void *cookie, diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 02e9a073d0c1..cd7902743f62 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -71,10 +71,10 @@ struct hfi_sys_set_property_pkt { u32 data[]; }; -struct hfi_sys_get_property_pkt { +struct hfi_sys_get_version_pkt { struct hfi_pkt_hdr hdr; - u32 num_properties; - u32 data[1]; + u32 one; + u32 version; }; struct hfi_sys_ping_pkt { @@ -239,7 +239,7 @@ void pkt_sys_debug_config(struct hfi_sys_set_property_pkt *pkt, u32 mode, u32 config); void pkt_sys_coverage_config(struct hfi_sys_set_property_pkt *pkt, u32 mode); void pkt_sys_ping(struct hfi_sys_ping_pkt *pkt, u32 cookie); -void pkt_sys_image_version(struct hfi_sys_get_property_pkt *pkt); +void pkt_sys_image_version(struct hfi_sys_get_version_pkt *pkt); int pkt_sys_ssr_cmd(struct hfi_sys_test_ssr_pkt *pkt, u32 trigger_type); int pkt_session_init(struct hfi_session_init_pkt *pkt, void *cookie, u32 session_type, u32 codec); diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index f9437b6412b9..745c2c0c0d55 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1142,7 +1142,7 @@ static int venus_core_init(struct venus_core *core) { struct venus_hfi_device *hdev = to_hfi_priv(core); struct device *dev = core->dev; - struct hfi_sys_get_property_pkt version_pkt; + struct hfi_sys_get_version_pkt version_pkt; struct hfi_sys_init_pkt pkt; int ret; From patchwork Tue May 7 16:27:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657456 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 CA34B16F8E9 for ; Tue, 7 May 2024 16:27:24 +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=1715099246; cv=none; b=hLSrTIFgKBa5lC65kE0MDB2IXwm2ClamgmKG4f9+zxbDwdwshN8NQwuilk00CFF0ondmcpzMFm5KKKc3u4jImZwJCukDPZZlmL/IoTlNR1MyKNSix1277x8Q5d3RJf64zDkDy19b2Q0mUKvzD3BasANZ4lszYg0V8K/Y3hQwhKQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099246; c=relaxed/simple; bh=elaKiW1ZWISf7j4z+HRijCG6vyiv0mxL1YyGQ0pIffU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gBMh3hwkpjl9U+6V+qxpwQQo9MsGs/4Od1tcp8DNjfIQ1nFPa08RmfJYDOwo38IuPVUKl6xUjy1XrzX5fTh2pWe04Oat8cFZknt+e0w+DbrqzmKWMBAW+DuxpywFO3G9qRIByqS2vhOJvI4tM4Da/HikcrWZU2ONzERVys6Z6wQ= 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=gbeaYeYD; 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="gbeaYeYD" Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-43a317135a5so23474471cf.0 for ; Tue, 07 May 2024 09:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099244; x=1715704044; darn=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=gbeaYeYD9SQGdJpgHvvKL0W9LWYoJZzA8/TW22Ucyy0QUvFRuNNcAZAc/w316vBWKJ Hr7AbCmkz0Dl0NqwMX//cMS0amRkxd3D9GdxWBGOowoTMAeGCV/KKKHmo+DzghH880+i A85ysOKgGpxD8vuaDcPq0NpDRmBSMX+x0GpqQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099244; x=1715704044; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LytlgeivFEVadVFPCSFVFsEkz0aZMS5bY0SwfM06VYA=; b=Z7CULzAKBvCxoriDjRBL7hSO7DEd8VgToiBZmsrvrLaZR/y+zVyyTK0S4cXIcc/E0W d0TGDlmKoZfPnNo/tknZLghzAFc0qwTCeAEeTwkCxvsxHb/yleFL9Tqb1sXPTNK3l6jJ msq3XdyW91bvk1SFMlJbLFwBjQlyygXINSf/orD78BNV47Heh4Ns0pttDKoNKLWvdtKA sT0LARw6qU52dPdzrXixFJxwJuSu1cpeLpSxqzgmby/Vdy2yxBk1RAIiwEsxB2MYtxg8 kZkelr4bsLZTePmoJ7cQKDOfSREeQXKNFlGGYp1AtEQL0cQuwEoGknhPaTZNpplZSqco r2VQ== X-Gm-Message-State: AOJu0Yw3sQ5KZCbHBX/l/D0nILqIsPahoaXpB1w/eCmEW0BYa5fFWExk 3ArJ1Qo6kKEg1E0BHg3sXR2HpWiLnddYv8Lj8XlG81a8ybsz2+19m1/poJnZzg== X-Google-Smtp-Source: AGHT+IH3mMeaAQ3dPkDbtiyOlqK0t/M43w6OxFHdMVW2XCWSC0GBNoCeALnYs1IDQynVDH2ifLt8lg== X-Received: by 2002:ac8:7d0a:0:b0:43b:173e:ce1b with SMTP id d75a77b69052e-43d8f7cec66mr50519711cf.32.1715099243729; Tue, 07 May 2024 09:27:23 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:23 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:22 +0000 Subject: [PATCH v2 17/18] media: venus: Refactor hfi_session_fill_buffer_pkt 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-v2-17-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 The single data array data[1] is only used to save the extradata_size. Replace it with a single element field. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:175:5-9: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_cmds.c | 2 +- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index c5123f2e76fe..35423e211ddd 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -331,7 +331,7 @@ int pkt_session_ftb(struct hfi_session_fill_buffer_pkt *pkt, void *cookie, pkt->alloc_len = out_frame->alloc_len; pkt->filled_len = out_frame->filled_len; pkt->offset = out_frame->offset; - pkt->data[0] = out_frame->extradata_size; + pkt->extradata_size = out_frame->extradata_size; return 0; } diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index cd7902743f62..0ccc4102ac3d 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -172,7 +172,7 @@ struct hfi_session_fill_buffer_pkt { u32 output_tag; u32 packet_buffer; u32 extradata_buffer; - u32 data[1]; + u32 extradata_size; }; struct hfi_session_flush_pkt { From patchwork Tue May 7 16:27:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657457 Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (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 D445117108F for ; Tue, 7 May 2024 16:27:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099247; cv=none; b=rGvtM5RDcDGSDaminJHjlGA+O+ETEL24cc46jh8O8lPpnsYwo+dPOy8mvNtF8LKgZcA0e1PphRm7duZFCsG/93m94KKxV+sqGSXmn7VPHSOCuelc51upZRq8KBUCAby4a+Vk3oy6r0zwZoljUFOknnoj5mP6R7gkBp7ecWUDBQU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715099247; c=relaxed/simple; bh=xx+wxFNs3ZuqK7Hxds/mLdbM5HIFghI8UQG5DaBamLQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D6FwvxWYF61XDaeKAVP1Exwq+Ha0RKEVflZXGUQahvhZ9COncD7cYNKorkiSP3oYcsgUlR+uV7XGref/RWJGPUDXDtWCm0qsfx1D6e2DWLnF4OvWf/H76map7h/UDMIufeTlqW3FeXjdW9s/G1z13vkR2vHhSSDm8M575yRXOoc= 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=kijo11kH; arc=none smtp.client-ip=209.85.160.179 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="kijo11kH" Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-43d4a2d0a0bso16204521cf.3 for ; Tue, 07 May 2024 09:27:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099245; x=1715704045; 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=kijo11kHp2VAvCMSD4iUw/+pq4P4CA+f7MIsCw0/FUSb+XujX+hkKeCu264OA5aDBA 5wdUM8cO+wONlCxMUKFSKDh721ktw7XSngbs7+Rd90021jKDJMZvbRBUegNR6CIVvnz2 Rkgqrs9ZYugnUb5sh1vbaYj7t8FOMVc1EvYRk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099245; x=1715704045; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=24yjDTHuOCF+C8SbX9O7bVVIA87jnk99ezK2b/3Gma4=; b=sVx0y+KQwlg2Zcf9e+Iqq0BgMkJE/HAr3w8/C3Oz4wHYxfHUcXnwEFdRV5R+RXMmVG hN0yJ11u7eCeBCINnHQvklS1NCw+rCNOvyFAHiALBhcUGu+0f7+4EH/hNpHr3KX3o8NM Bv3IkBnEGCffKsZ/l3RaF7JuVhAliUQyIYjP3bdCdIihU/Dag2z4eepbONqZyVGia2TV FoPOjxgM8wLHwOw/4+JQuEUDumO2hu3s9oLeJSDYtnsTRX3VuoZq2JPoFmVyh4aJKQ+x RPhum2zPUp5sbw3pQU8SpONUPHeiq14cZuwJpuTv+huMpLEObgeTult773LA4trF9pSu xjFw== X-Gm-Message-State: AOJu0YzTS/zBCweIZoq7aH6fCJwXfFnwaCKnmjeMcV2PIR61KCgu9Rs6 3Rn3KhOZVAUJbsBgHDW8CU+6cRFNWjLbeADFuLd9ECP++7/eTuiZt7KfDA0nAw== X-Google-Smtp-Source: AGHT+IFXk9TiPGkyPd47b/0bfL7TWw3sW2kfDIDAt+NnUsqL7Hhdu3EhERFFZlCigfyFh6dM5Cuiow== X-Received: by 2002:ac8:7e8b:0:b0:439:dfc7:aca4 with SMTP id d75a77b69052e-43dbf868fd7mr1746031cf.63.1715099244908; Tue, 07 May 2024 09:27:24 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:24 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:23 +0000 Subject: [PATCH v2 18/18] media: venus: Refactor hfi_buffer_alloc_mode_supported 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-v2-18-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 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 {