From patchwork Mon May 27 21:08:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675784 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 9418A155C88 for ; Mon, 27 May 2024 21:08:56 +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=1716844138; cv=none; b=QcdNtUnHCEVWUfQx1NrBJZIOR6qrtqQkBpi4kL4PsCoLyTAqvnwAfI6Q5F0QG37kFwf5gz4+s3A4vKbHKrlnaz8/vg3b2OoozIgDZ9UgutezC0DlgRer1X4/rgOFmVZP2j018yl1LBHXcfDJyp7aocE/ZOhpx2s01Fc44czLWr8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844138; c=relaxed/simple; bh=JSygS4gzMJ/tHT/j3LMxdo2fBykWODOKPWAhI9tH2kY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qKyqT12BzxSybaZPu5bLAH+tL85zHab2KayvxbSUPx2pDcE6y6FoBrYc7KkJ4FRJMtX5CTSl1V9i1R7wtzKGQhytl1N4AiBYBT7MIS4gMMncr4Hu1zb7loe34RqduLumVfVIOAOefjyIJPTUpZIWrLL/+qTffm3jzpBNnH7sPBw= 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=dzsnouHG; 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="dzsnouHG" Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-43fb094da40so28066251cf.0 for ; Mon, 27 May 2024 14:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844135; x=1717448935; 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=Nd4v7ke+Cy0nQV6qfaxBYuXvHeijlfFLOED6efio0lk=; b=dzsnouHG3jS54O7qwP2Equ3HYnxbcKBuse7ievqjO8sdON7g4hEZfDS8GgVTRQKLIw 1kBszvjBzZea/pYD2Lbt+6s9FBIfcS+BN9ZMgWq2SLMu5WgOqPrH2MQA187J28XkNyjb SNhlnq8+PnSDl6B2hHnDQeEH50KUW7zuLlD4s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844135; x=1717448935; 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=Nd4v7ke+Cy0nQV6qfaxBYuXvHeijlfFLOED6efio0lk=; b=CFWUkdYIlwPflYpuYgDTIfA7mYYJWfZkwVPBV8u5bf7HVqzs3HWTT3xunnlHYbRYCL dpwXIfczZe5k2tkxJitpDli7FHr/XAZ4ifSJ4WuYScJJ5KaRiKjoVqVB2rVzs+kRHF8r TYYtn9hqbEWoljdy/HEhz2ajzwekgfwm3l4XogdlN3IbOEkHR/R0/aIa6Vy9BeG/8xpV AcBP8Kln0QW4H6YnXz5PWcln1B5fDvRXuHJCSX9ZPFrX9+ZH6HgRCYebZ2edgmsHVMkY HKUYZkT+CXFNMy3pa4LgUqE7NNgglA5QTiBuWPopNKG2lFoi9W/UaGmYg59PCucNo+ug HZhw== X-Forwarded-Encrypted: i=1; AJvYcCVMwbJYTeW0M6AhyJZwXIO5O2k7BV8dByp1WYvpjJrcc+QGhZfwnwKqprurqvaQ/1HlGyf0mg+NOO0zQeq0+RPB98W3qC2za0AeGRPz8g== X-Gm-Message-State: AOJu0YxEn1z4rBELnuphrTqnSRdsO/qnuTqThf6MdS790eESEAm2rCqa lbNTfub/N44kBd8ZPqJOR6j00ZnsZqbfdDFWKONZZ8d4FsoC7z0CC0Bt38aT1w== X-Google-Smtp-Source: AGHT+IFrp5m4vKJTJulTHuvhixEpNuF0CZjI5X9x0U2J+O2dhe08H2Gd8tgo/a4lMVfyPDSv08IJGw== X-Received: by 2002:a05:6214:2b9c:b0:6ab:9a03:ff96 with SMTP id 6a1803df08f44-6ab9cfbe9d3mr169298836d6.7.1716844135480; Mon, 27 May 2024 14:08:55 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.08.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:08:54 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:08:51 +0000 Subject: [PATCH v3 01/18] media: allegro: nal-hevc: Replace array[1] with arrray[N] Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-1-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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 Structures that have a single element array as the last field can be mistaken as a "flex array". We could replace all the single element arrays in the structure with single element fields, but this driver prefers to follow the ITU-T H.265 specification, which defines it as an array. If we introduce a new define N_HRD_PARAMETERS, we make clear our intentions. 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 Reviewed-by: Michael Tretter --- drivers/media/platform/allegro-dvt/nal-hevc.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/allegro-dvt/nal-hevc.h b/drivers/media/platform/allegro-dvt/nal-hevc.h index eb46f12aae80..361e2f55c254 100644 --- a/drivers/media/platform/allegro-dvt/nal-hevc.h +++ b/drivers/media/platform/allegro-dvt/nal-hevc.h @@ -96,10 +96,11 @@ struct nal_hevc_vps { unsigned int extension_data_flag; }; +#define N_HRD_PARAMS 1 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[N_HRD_PARAMS]; + unsigned int cpb_size_value_minus1[N_HRD_PARAMS]; + unsigned int cbr_flag[N_HRD_PARAMS]; }; struct nal_hevc_hrd_parameters { From patchwork Mon May 27 21:08:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675785 Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (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 A4F09155C88 for ; Mon, 27 May 2024 21:08:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844140; cv=none; b=KUxU96XA/gLaff1ycd1d1C34LVJ0XzPAjTknMLDg7CJXw8gfHBivPolC0X00FGZWnr0pzCF1V9I857FqQcb9fyVc43nBPwbOVcROsPSDE6O/FlJCYiyaq2eB6+Kp8v+HaoHbxCXgzoSTNeP0J08BhN8cmf2SDHMHV1voeyEckb8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844140; c=relaxed/simple; bh=l4ha/0a+V3zQpjJj+OdaNyFeTKQdUeyLJ3IwjP6bE0M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hW7IMtYn9mTAxW7XUlOgDqihZvUmCoMWWzz08nBLFUGTTjvP/aFuNYdhP/QgRwLhxno3lmXXAOndEBCX1gAWymlC42qH4irgpoRffeIO6CfRbE7CAkZ2hun2BhbmHmeQhcTBJk6bVL1d1vAVhbuAoukN08muaUMK6VPqOIAD4l0= 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=RV7PK34Z; arc=none smtp.client-ip=209.85.167.182 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="RV7PK34Z" Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-3c9cc681e4fso113989b6e.0 for ; Mon, 27 May 2024 14:08:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844138; x=1717448938; 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=Y5FDS0KOQ47jasj32zxHr7JlmfKM7TOOvG63h142TVQ=; b=RV7PK34Zn42jnI/yj40PvajTa6lh7ousj6GsYOOGUnfBpYHt4umMWs036iQ39Iud2r DycUOKooXbE9sGAlPkg5ZI4oMg0b7RSj/E55bKmYjGQONnR4p7zPWNBmdAM8YDYP2Wf2 d02FOT8r6PL/1lT1jgs9OGWDnB+meFLSFpJbg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844138; x=1717448938; 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=Y5FDS0KOQ47jasj32zxHr7JlmfKM7TOOvG63h142TVQ=; b=vWvKvWGXh4f5z5+KpOrrmeI4gnrPG8gRcKlTIO3u8ZXYacrHZSWSTcywNQriiyZkap MVFxVlVMY3fZu6GlpYHITUQIZ8G+cD3qpr82jn2Lvss04cinw5nUXqUEIY0fbXjl8CZL ev1bd5ZHHc2zIMsc6smZV6glHYTF84b9mQ3RVvcICSOC9Y8qe7skDNlnquIbooO550n3 NEAJG2VSsLpHrbvd/4yGN8+kgmwl4on7X60+Z80fQ+5RGeqSkQfoZJg50ee9TXfySeJh 8z+XNsZ6E30CD2xVPxmtvBSNlTeEpvplFgeMI2H/lCIEcAIoNyDLJEae5z3Vy0zz4H4y sj+A== X-Forwarded-Encrypted: i=1; AJvYcCXiM/4+pLHR50SH6B0hQ7VRa+tqyNghaNP4bcBGBjE4rMo7qJGtgrF5n+B5PhADF5B2iz8Brsuf5R4ugzMHT3CCj9JfeXoT4A4EqGWNyw== X-Gm-Message-State: AOJu0YxVQv1zMCM5QjLlPo1TvDqHlMju0uj/IA8IXh7bAdlXu4w40NmE YDpBp0dbfM1R2UyV5G37a5R1ehNRLEA6jxg7EAP4aDCUFpgX+WGotmH57+HcEA== X-Google-Smtp-Source: AGHT+IGS4IcyWoHtoHLxYqVJXwNRWKOLERShKBdO4wfCuEj/TaqRAsEdR15fcRh4okWrTQcoQrX82A== X-Received: by 2002:a05:6808:1507:b0:3c9:949c:cc02 with SMTP id 5614622812f47-3d1a707df19mr15970807b6e.42.1716844136147; Mon, 27 May 2024 14:08:56 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.08.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:08:55 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:08:52 +0000 Subject: [PATCH v3 02/18] media: xilinx: Refactor struct xvip_dma Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-2-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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 Mon May 27 21:08:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675786 Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (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 EAFC916132E for ; Mon, 27 May 2024 21:08:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844140; cv=none; b=Nd+v+If8dbr71e3Lj6pRT5iy2sKJiHIUO8fPjadm7dDQ6BRkbbxJ850PNVgCmOh1sBKpQ74BbtYNgVknxXZJ1heP1uhsxHUoFNOpGthubQaJWcWv84/jTwoA7SxUJN1lUcqw0GqHdc+NjNYtRTGc2/JmM5U7i+uzB4D3fnEj+fg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844140; c=relaxed/simple; bh=z13zyxqEexMyebGHgKu+yI97Ps1x4zxNfwmfII/1oPg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Nup5rPUAL3rTQtDZBxS6wtstNxks6v8sMtjl+tZTOJeWsvSfvnhU59T/SuNrSxICa8IndZG+VLdJBUOAi4o29A9Nzxf1hUKvVVveyVH6Od8UPf7KagzMzGuVHoH4MMBjKc2IgdK9IWT4l1y+SCuoWURDEJDKJjbenF8hdyrh6Yg= 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=cg/+MpnY; arc=none smtp.client-ip=209.85.219.52 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="cg/+MpnY" Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-6ad8344825cso395606d6.0 for ; Mon, 27 May 2024 14:08:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844137; x=1717448937; 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=fNIsU+/qEYhURt556sfo4PlTlUVRyNCactQuGIIVr1E=; b=cg/+MpnYLjY26r7OLdNggcPKZCMQLc+lm5KVy0NLWBX/gDQAgUs/IdSfAAQFB24RCe L+kneearIqwg9Ch+OH/FTCCvbrit1HWDMj5bpE1kQPhieF48EXO4+i5MXhYgUNtZoXdS 8dlFmLdSjiOLZ32a6IPmvOwWwm4WgM03rt0Xo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844137; x=1717448937; 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=fNIsU+/qEYhURt556sfo4PlTlUVRyNCactQuGIIVr1E=; b=mgd/yX2OpJx/J2IYjehqtGk1yWAtlxd8rccvfWRiehuRkLdrTi8K29GvZ+KI22OasV mRiuGbRs6PQl7h8Wn0MS513BiZUXXvqzeGv/a3wCAJVyml71r5zTizQB2iXWLEuaVhvn HCKtYHnE5QQY+bQgVchQ98b841bFFXg/P7l2RUnneKCg5pvvGYx+TirAyNl323RidtCy uFavMm+wIT57kaImY9tyuA1cnHVOvmy17iXqS5snu4CEVSrTewXiGScLvSi1oHE/6QUG nQQYsa2MilHcFZBxJvq7xsExSLHJiPWaYFM0XRzq01GbjA4IQ9B3A6r+3GFXHRo6M8wY ks2w== X-Forwarded-Encrypted: i=1; AJvYcCWA4dDiczNPAwXfxUpo3gf9yHzQcKNRqLhwXdKORjP4vZxjXKoiQ+a/rH2qifm8Dnns+Sba1CBKKzhhIHVOYkNLd3Y62S0PZraECz8b6w== X-Gm-Message-State: AOJu0YwlBx4QvnAs/52wWaey1cFGSaJa/CTUtcipEGfoQRcG4gpnUCwe ehNiFm8qTuDBB32Ec98c5GJzUI5KsMRDqCzdRuKoupzWAMUF4hwIuL9pcsX6cw== X-Google-Smtp-Source: AGHT+IG/WggJVCTkvsROl4Irbm8iKAUgklmicuyvY5nd4ATgkyrWLwVVrbvJHXRzSt3NN35976vKqA== X-Received: by 2002:a05:6214:4a85:b0:6ab:9428:385f with SMTP id 6a1803df08f44-6abcd0dc953mr122329976d6.31.1716844136868; Mon, 27 May 2024 14:08:56 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.08.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:08:56 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:08:53 +0000 Subject: [PATCH v3 03/18] media: dvb-frontend/mxl5xx: Refactor struct MBIN_FILE_T Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-3-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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 Mon May 27 21:08:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675788 Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) (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 CA7901667FB for ; Mon, 27 May 2024 21:08:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844143; cv=none; b=VeJO//xQbD12YnMzmT1ND9/3Upw3s5Q3SAvv79WZXGzwB+WVExMSU0H50ZNBTpt/F9olXpYIGao7KnR2CTAvBcLcIBtWtNqh9Rqn/U+58AUWqlOV2s9tb9p2wIntRbpXZmW2bd67uedqhLo3l1p2l9mDfMmNwBBcA/gN2arxSFE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844143; c=relaxed/simple; bh=VzyZzQu2iLKQpCL82ezkV3DfXk0qxb8vZ6CNoQ/jYj0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=klDwkzL+jaKhyd97NonPbOGNCpyTIyMWYoXoB79nHZ4DwJVyYXHhxn8Q2Jguxp71pFiUyrj8zxiq+EsA+m1LnJPY73IST6A23pm0EqghMs/rA1p1NsBE4jVnjG481UI4fVJJQGwSzQh8ASQhiEvkQBygv993K5jNZYDgTzjl5OY= 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=UCcT4bbe; arc=none smtp.client-ip=209.85.219.44 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="UCcT4bbe" Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-6ad74a836d7so470306d6.0 for ; Mon, 27 May 2024 14:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844139; x=1717448939; 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=MFWoExP/wH3m7hjvZ2JqRkdunbepixaqBCDXaOKvVh4=; b=UCcT4bbebR9QE9ZfiHPdbXCh5Y764jzR2T4NqxWFZ9ntEP6XGOfu2n/thpmx6tM+cB gt42wxjh3Jg030R6fLmEi6Jq67kWH8KrnohzmJsT1L2xEjl4iY9kztrLx7Q/AylYmOXN R8qqh09RYKZle+cZNuM0KslAjKQUK478agkX0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844139; x=1717448939; 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=MFWoExP/wH3m7hjvZ2JqRkdunbepixaqBCDXaOKvVh4=; b=oXUOMaDgihnuwycy5tPvnW7HUjpLwRbrKeDr4ya9oJAbdDtryyaUTMYL3yIISwiWZW cbJUXkpakid4LlcDj7FUMu35h/QzFT8JR3gtbESdIxS0QWaDOwdbaI6FGjUrbW3Mp1Ln of89bajJdrB+OK52VAaRW55fc6eTsvIkzmHwHewyA6M3jIX3RkieLA1t/B6/QJAUVTiX Dqj6TlwPCfJvFeCV7D6RDKGVCi88WS7YPc47Ym6hwEdnj1+3m8paUn//KFShk7Cie/5h kGVibXlhueq4Abg1uoMB6sp7uPwNEa0LzFf/knbPZqbb54eJGc6Sd4Fa9356ulwYC8kQ HTwA== X-Forwarded-Encrypted: i=1; AJvYcCXRB6Q3naz7OWWsHTRNz4qhAPyo0r+XO6v2E8VwXfgK59gorBxr4fgFGw/LBbPX+oBTBSPDlfYcBAXpyMZF6w218NZy/hZkM/DNm+7/Jg== X-Gm-Message-State: AOJu0YxCCUOrI9Mzsz1fphSPUEg3jLmS6QcdUZ40LVJDB0KO0VdD8Tze AbXH9wbL1hgVbJQ6zsUy1ycv/oLqvFsFleo6QNklQnX2LdFOFc04e+q8a6uJaQ== X-Google-Smtp-Source: AGHT+IFivOXXvR8CUjqaAYwugV85CB4ajDPAOeknJmut8X/c8q8/lFGzrGSFxvIJPA/iWbuRhKRNlg== X-Received: by 2002:a05:6214:3d87:b0:6ab:898b:42e7 with SMTP id 6a1803df08f44-6abcda62be8mr118486476d6.65.1716844138851; Mon, 27 May 2024 14:08:58 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.08.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:08:58 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:08:54 +0000 Subject: [PATCH v3 04/18] media: dvb-frontend/mxl5xx: Use flex array for MBIN_SEGMENT_T Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-4-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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 Mon May 27 21:08:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675787 Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.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 BA0E8161904 for ; Mon, 27 May 2024 21:09:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844142; cv=none; b=WpJQqsnboN4Y3u5qY7RrdwRr4leq7JrPFs/YOm5dm8jAodunrQb02tM3Udwp1P2f7Y5JGk7vS8iHuTRaQd9JTLFCnrzuYFOHqS34lLCYj/VdgVlCRnhOegkizyB72WFArtd99H+XDOZJRKF/maTb/te39yBiYKf9d366tHcxBps= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844142; c=relaxed/simple; bh=NkAGUYk+AlN//KOIaRCz0WPanqcOARjklyEqM7RBKzg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TIP0sC5F3hnt3ctoQOUO8B+GZenEGfNGxS5+pvl/CBhkZ/IMepFNJeYmsVx8dXJGiYNo6vj9ThieS91iQHdd2V+8jAIgeiMmMTOrHi7x2Vk5kaRs1k7IT4fGWk8oh/Y9yYEHcke1q+VcK7qYqdYTnZfm/fGFcsLH1kbddEKgSO4= 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=mBdV5Q0O; arc=none smtp.client-ip=209.85.167.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="mBdV5Q0O" Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-3c9b94951cfso117291b6e.3 for ; Mon, 27 May 2024 14:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844140; x=1717448940; 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=mBvUNOy5oqoGffRnBGlOX8VjvQupq+TiHn+tNWkPE3c=; b=mBdV5Q0OpthKSjt4bNervpeNhLMkxzZCj7zF5mtiUDdGm8zVY+Jtxy+9iri/GvUXk+ 08XEHGexV47XhMhwh8U5bozIHvmMIQEau4T7xUyYJqT1H/iepkqc3XkZCVRWwyNVlOEC RCOo1pmkj6zpF9oUgeO3H5JYuoEl9LM+HWvqQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844140; x=1717448940; 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=mBvUNOy5oqoGffRnBGlOX8VjvQupq+TiHn+tNWkPE3c=; b=UlYXvUUAygauGFlsAnuugXYvbIEVbhcSBnsXatsNHxjHL+Jkd8cE0YH/WUxZBOfYTS AFz2xUZqU1sB9ozyjgPFUoHPz235YtfUTXTHOehz8bCK0FvewognoJsr6kn+1kxaleeX NcfgS8N9u3xNrWCTBilqkK99ODFbKm6v5CanGGhDuI0sF/USj3+oc09Piikyv4IRZIIY PkDXnlvTUwYxBT2bgv7GWr6mkuBgqvktYjmHXRNFFzR2X06+viJhBsfSF1oF12zYjcTL 4heHK+fmvj9PzBGk90uHUVEZbnFXEmEgnUG/bKi1maUUuZe1RbieURDvqYEyDzA/eHFP ko6w== X-Forwarded-Encrypted: i=1; AJvYcCU51nH4mmUTGCRaXPEEKrviC1QjWyOoHtGc0QnFpf1R/1Hw+ID9b8WFDPxgxKEa4KkxJNffE97kOk4umni1HvmBKbhaLvgx5b4r23NyKQ== X-Gm-Message-State: AOJu0YzZjibXapn+VCGRFMVqi7401Rt4NqvzTeHDR6c1Y20sFLdEVFiT cGGL1ophvHcgcaJ4Dv3zEWkf5F4n/GiYD6DG3o/5fcJUMYSkXHlUYmkEE5SJAx8PxlybZnSFkf0 = X-Google-Smtp-Source: AGHT+IE7nm8EGv+xMLxhkV58cp2fsWk6T4ZsQ57GlnbqEOEZkcL5w4Fub0qLyq/Mtx0z8nTh8LZHcQ== X-Received: by 2002:aca:1003:0:b0:3c9:924c:8310 with SMTP id 5614622812f47-3d1a1e83258mr10375382b6e.0.1716844139979; Mon, 27 May 2024 14:08:59 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.08.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:08:59 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:08:55 +0000 Subject: [PATCH v3 05/18] media: pci: cx18: Use flex arrays for struct cx18_scb Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-5-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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 Mon May 27 21:08:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675789 Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (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 BA4A8168C15 for ; Mon, 27 May 2024 21:09:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844143; cv=none; b=YTNVX0hefCBbTq6sbENqbeWRKhcXNT2z/GiCw5GdBndwsBJ7D9fzH5XMNK59ZCaDLlAauXksewRDAbfUgp6aalqR2LgBBGSKFiAhEQvD9u0oG8bkJ9AZhmAMFOYAcWBKs23zeAqAiTFRzag5NzXuVie+/1xm6d9lbJn3Ob1G2AU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844143; c=relaxed/simple; bh=tZqX6JK7jkHsbyvqklmYMlf9uW/lwEDCI8QNWvC7mcI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NMPPSx5yT34ncJ3j5HqDQr9DJ/D9aEkx4IuxynIpnWebyQiT6sunmB+8cz52q6CCmIUXKzV09psfFJzgAJ2ATeRUJT+s44GbzsX5r/Lmd90TzUfEUpcApc35P54cNY81E0kgLYYnpPiQTVj8xtB9QXT06CM1T/tDu/rJhtu+Ot4= 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=Y5dxmb8z; arc=none smtp.client-ip=209.85.219.43 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="Y5dxmb8z" Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-6ab9d00f727so743136d6.1 for ; Mon, 27 May 2024 14:09:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844141; x=1717448941; 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=JxyMD7+SOcIzrSiBs+HrUXuQ7E3uLSGINL6mw8MkAf4=; b=Y5dxmb8zWtG6sA5x/Gd3ME7YwVRFquek1t251hKvOzWq82EuEWYnJLQlp9JoqrqhAs ej/6XPAtlSkuOnvCLCoPSSeVXPrzYttCqcepsYnjQoZ5ml6noU8ChF88Hexnj9gxRwy9 bGx7MmU/kC/ok3Sk+hhX5GTPcAd8qGsT05h3I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844141; x=1717448941; 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=JxyMD7+SOcIzrSiBs+HrUXuQ7E3uLSGINL6mw8MkAf4=; b=KCaiRclEFA1P3mMLqNbkGkYydi46ANO7syfLWgMRIh8k/HY2MrkvPmRRg81+LbA/gI PwzDoAynUiQMwvwWBq+ejzsay3xsEwMoPGTiNHojINxHz+QLXPW5ybA3uHM9CGuHp0cf FXm6ormHx32aQqgkTwEvGVth88hNVyF6AnycF1zyM0Jx4GNnlVv+Fw7BBEg8y26sVj2h gdt/OmO7mWB7qMDCDkKSGGcQl8wm577nSSdr557NVwe9HeKNRDnNIpOuX+hwfWvRBxmf lENJSWdX/OoXntfsqNqZpLKCG5u5Pd9dPngG63Jq/eMzoTsueww+ySNhR3dVXnFlmTRF /2KQ== X-Forwarded-Encrypted: i=1; AJvYcCV8YtDMhTFf3yAY2POHiY+1AdO5IBDWlXSnJ8jcG707kNfNfAe3TIiLWZ3Rbr1ZDqxb93GSCU4WVoU+ZRBvzivWbOybVAEf17EvswXKMg== X-Gm-Message-State: AOJu0YxQJiWmKMbUsIVH4t2+Uu0gOTw6Lb9JvyEb+dHlUp5vDoVvZ7qZ jjsBwr3upL19ThAPWBjaqVXSAr3wSkv/1LjoVGic3VZj533V/TJuLQFjLo5uPQ== X-Google-Smtp-Source: AGHT+IHE71X9+mt3p9eZinGz4YAfmZNgkJZyXT70W1JDZtffA6gSeDLWsm8n9IcJH7Rxix/i8dP0xg== X-Received: by 2002:a05:6214:4687:b0:6ad:8e56:cb37 with SMTP id 6a1803df08f44-6ad8e56d3camr11195106d6.55.1716844140657; Mon, 27 May 2024 14:09:00 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.09.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:00 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:08:56 +0000 Subject: [PATCH v3 06/18] media: siano: Refactor struct sms_msg_data Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-6-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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 Mon May 27 21:08:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675790 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DBEA161305 for ; Mon, 27 May 2024 21:09:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844144; cv=none; b=is/SgsaqtBD7oZImCDOIPkxkwWWu1ZBpZf25Hms/i5dW9K/R9SCxqnn9wARpJs2SPSsT4IgdlSLt3GJi9PIWTRvk9m5msoe0Ckklj13zrwChmdj1BO3rkja4Fl2b/EtDYuGVf3yqN3NOnyrqlaXMukT9cJJs4xtFyt/xxSz+P3E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844144; c=relaxed/simple; bh=00nzIkoHTNIKc3OYcYRUmI3ETcNlAeSphWbClDXv8F4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Z3CZzSnWN1cnP2TCOI3C0lKE6gagrV9sCuOl2JIcfXW4sOPrqL3jtK6h/1dbLyPN3hppQ/1/e5+tEkFgtxegN+/mIqsLyMQ3rCqidtsoHJyqrm8nObiMbV3vNUJXCnrtgry6YFWH7YZEWUnix/0AyGD5Im3L1qePfuZXjrYNiRA= 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=PXkP8kUF; arc=none smtp.client-ip=209.85.219.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="PXkP8kUF" Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-6ab9d9c34faso663736d6.3 for ; Mon, 27 May 2024 14:09:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844141; x=1717448941; 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=xuxfMIsewXqkBzK5BeYTD0bqNkQisbi89qotRNy4YBs=; b=PXkP8kUFahC6n2hMVqlULQwdbOBEJ2EvztX7xBhCCAgYqQQSb3cNNZ1Jx9ggfzaH15 aFE1B7RwrBQUTQ+QhS+DsRomXrSS6IUiAEGc8lYj0VvQ8HUTngoTf39VDlzxjh7nEOu7 G5A+M9O/BodlpValA7HUKiuM/ooDLW1bX76qE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844141; x=1717448941; 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=xuxfMIsewXqkBzK5BeYTD0bqNkQisbi89qotRNy4YBs=; b=XlykFep57fWBGhx84d3p0xKzN0qj+g788Uhbmrnl/cccDawSrNzpnnpDqQ8UHfvHvn li83BlGImn65RTHdrkq5UDjkTX0ZrA141Te30tyG/kQnTo2dweX16saBsmZpfVVh8FQ/ lMojLW65PflFskSwf3lWZAkb71qANjZrJsGNHWTli5BBf37PnKG1I+4+JYQVZ+QPBrho 4jA7CONMUGWgJnGwRj50FJBzUa9AYbVE+ONoZHVogW4aRi8dLPn+ceBTRDYF2eK3Mwi8 PadzexBGma9A897WO3gA5cTkMr4NX4IPBImOlWOHT9e9W8mxZeH/EQHt6W+jZyuibJ5M pk0A== X-Forwarded-Encrypted: i=1; AJvYcCUlS+R+PnHoZjKvSJxwRpLURGmDEL1qyC8GpFclCnXX4SZnfH+MUYJlayJIBjia489y3nzSP4zXtVE6Pi59QnxUyVbWeMmxocZllY7mjg== X-Gm-Message-State: AOJu0Yw4Gb9t0+9Nsz956Zzc6wpvWPvLKllcVNG/MbCTeXez3Mm9BAVt CX0cZS2EqQvtTu6e7tOx963qBRI6D7U0M1TKSHyW0jD6ARttwGJTMumUvclkag== X-Google-Smtp-Source: AGHT+IGqdInSLU92W7+DtYzv0+k6nwEHlNXV5KrK57NXQ1324WfJB7q1ATelwAen4Mc0bFmHLxIsJw== X-Received: by 2002:a05:6214:3bc5:b0:6ad:73c0:eb22 with SMTP id 6a1803df08f44-6ad73c0ec3emr79133716d6.12.1716844141308; Mon, 27 May 2024 14:09:01 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.09.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:01 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:08:57 +0000 Subject: [PATCH v3 07/18] media: siano: Remove unused structures Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-7-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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 Mon May 27 21:08:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675791 Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBE31169AC4 for ; Mon, 27 May 2024 21:09:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844145; cv=none; b=EUYf71z+FKQdTOAITqDg+L1+IPIwUFUjZ+VOThouxE+FOy7xGDBxzceVf2hgfPYyc2EOS5q/j9QlZrZqUzrni/w+yUd2JOeo+aCeRJLTEBYk2liiMXgv9hd/9t8XkRPmJUpReKqX7vvWDSGEDsOSzx7kTl+UWAYlCRMNY2XKpmA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844145; c=relaxed/simple; bh=AtfV+7qKa8OYd7+oqo1EiuFIlY8JnCQ5vfZJ2LNqz98=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jrwnZNRqtD9HVU2DWClDqckCGRNX4yl92jBGIp1LrGXlvJDOI6vDCcYx5FQhzfD1Nk3aSMPvXyT9ixIpDAkVSgTICczFm1IkhZyRaQEsgIrFMVBHi9bJfYaB/5YaBVv1VHE+3IU3RTwoW0KHwFqRWVVhwhi9Tu95YLdbdGzGbOo= 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=fBlJkwZh; arc=none smtp.client-ip=209.85.219.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fBlJkwZh" Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-6ab9e0a4135so24780076d6.1 for ; Mon, 27 May 2024 14:09:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844143; x=1717448943; 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=entYDpzpynGnajXkQLwb6P9rzIVA7SLTRgQ0ZRMWf+M=; b=fBlJkwZh03cfC5EuqOptoCFI/qOBKHLf57iMcVRf5YIlgO9EpotNdgRxXXIafpjPT1 Bz24nCxWikNlyaaih1ioFP4PakP1OSr6kJefHsV40QlrBhtjZAsqr2q1MJ45I2l6KP6t 6TcwNi5vQdwm2kuOPT3Wkq31WLrahr0DrBVqY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844143; x=1717448943; 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=entYDpzpynGnajXkQLwb6P9rzIVA7SLTRgQ0ZRMWf+M=; b=mfhMORx/MNSuutLjqGX78PxpdqyJbYG3qcy8AbNGkzwkVqM2V/ULBhuiogyZ8xcGMM MIxiE/RGQLio2jZuoQUikzsL2beqwGDhnLlOVNnlj18wpKLky53XoJnJ/0oQhfNVySDd oUtCZ94Mu/bXq/DeaM5pWkC7xpMPbN1ZA6sCJit5KHcb6OHwRBhp28rfyFjBSgQZ45oy I0qEQSGzpuVMoc8VMqqcma3I1Sv/g51nStI/Uw9Gs6OSdKODyC9usGBb2hjY803atOh4 dBtKc0NV0gP9/VN5FOkEvpd3/u6/kwi3N7Ds0lUTfge+ZE9HRDolBuEdMw4ssqLK9UXw aMCw== X-Forwarded-Encrypted: i=1; AJvYcCWRIx8U9rgPR9dduV1D9hv23OYXVmNCRshDWumdp+U3Zbxnv0sst1JhPOK5DnEpSkY+GyMCOAXG1/xJwcr5MKUZXT3WYS5CU7lXWwpKig== X-Gm-Message-State: AOJu0YxKzrcmnq5RjU4B013HYJmm3KTqDBTkYnl0UZzQECT+H4tw6mCX NBtLYHJFQuqQWbTnayfg/Hd7azYbuFeQ9YV2ASdjGy6NOGgvZ8YSH6HA93Csdg== X-Google-Smtp-Source: AGHT+IGRTkEFJzLLbC9/MtoTsg0EW+dVQWuLn/GRcDLGaCVnhgLZ5sKm7tGGTDdrZIg9lepBsZ8a+w== X-Received: by 2002:a05:6214:2b0b:b0:6ad:7070:4e1c with SMTP id 6a1803df08f44-6ad707059e8mr106586636d6.19.1716844142698; Mon, 27 May 2024 14:09:02 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.09.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:01 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:08:58 +0000 Subject: [PATCH v3 08/18] media: siano: Use flex arrays for sms_firmware Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-8-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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 Mon May 27 21:08:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675792 Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E4587169AEB for ; Mon, 27 May 2024 21:09:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844146; cv=none; b=APr6bmmUn9kWZFyDc00l2l0eHxYzFAxAqEZ4iYRyfif3uGzj1bzcf44D8sI7XLmspH7ObBXwSV9LC1hGLEc1leGTOfK+oIHDFJ40PmDdEJwiXI+kPLsppSE8EVzXroTNRpaZ2K7l8qYPagLhqWOrmxIlf5MNDBRA6bY0LWKUBW4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844146; c=relaxed/simple; bh=TehMSPndYn5zNuRXiN5fWXHbh1zWRS0H+mtTX5YpTPo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JhtLI0sHkAfwCiPgSySp5luNidG7/efMumtttwJXv3ihvPdvA/c79Bmf74LGVPXrFYoAPAs0JXQ4py2dJN1Z8GylT61Pnb1/WsXFjo8f9dZNo06MMh4xa4ymRSJkTAzN23y4fMk86V/fdQQhXaBJQLQD1GpVFgSePSbRECXSntQ= 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=TzvefGUW; arc=none smtp.client-ip=209.85.219.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="TzvefGUW" Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-6ad7a2f8715so1747706d6.1 for ; Mon, 27 May 2024 14:09:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844144; x=1717448944; 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=t/EjBmZHxaJRt0CbKeU/+Cjdu5Pw2D+vzE12T3l+4k8=; b=TzvefGUWMEGBxBh9Ln1A1m9FyHyLWbJoQCh3iowSnTH8svFZeAJIUBhDwM6qEd4cy/ JUpAGk2hKMIHYMlH09+nYfrMskz6TveCPJdEmuoBoITihxJl4G0N37PR5XfF7mN8FyIX ry3bKzidl/0L0xGN5PTEzzjXsm1xa2Tc2tL9E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844144; x=1717448944; 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=t/EjBmZHxaJRt0CbKeU/+Cjdu5Pw2D+vzE12T3l+4k8=; b=IDfpsh+JLJY2tyFXic66blN/+Zs0SOxu3frcHQTsYqOtMFWm77D6D7PItusbgflsHQ ISGwYynZIScaZEiKDH/eSkgFMJjBES4dfpAexM1p1Dl5Fu9zra/RmoF0EwLC+cGHNrLC wJQxq/Uw/f+5MfQ4G+U4gIcPqNdR2JMi4LIglCaymy4LRUWWQ3iQBipTXlnYezFOrF29 FtCXbM5jXR4LvFwcE5t6YbwVC9ZUgGwabR10KzFRU+vCadVrx7iD29pHIlrHvizrlJY8 62b6r7asp6NAW7g99J5BUyyQVImo7kOWty7DstnbPfW+PcrjGnDP0GdaF1R2S6ShoWwu TIiw== X-Forwarded-Encrypted: i=1; AJvYcCXOMhAqUioslfWP6k9bCVg60bqs/OxRepktno4HgL8a21FCkpY/XTZlu8xkz/3mR2CyAj7x2Q/YdFSDkHJ5hiTLYLg7qFUuWar6t180nA== X-Gm-Message-State: AOJu0Yxkm7z9sbEm9jzq6X1AmuDFZCCgaQmB3F6fFvMl/kkex6JL79Ag s/6BnqMucrm0olwuGvseUSme7k+BgB0z9Zjgz7+fxUfdGgErm8qd/8flqYKqbw== X-Google-Smtp-Source: AGHT+IG2K8hd0FQkP48oUZeiOqZNwtNw1JHKu/tmb2MpC+KMnyEg2aTduLYws/cq2PTyS4CWff3zyg== X-Received: by 2002:a05:6214:4013:b0:6a0:9607:a441 with SMTP id 6a1803df08f44-6ab8f5d6074mr247545966d6.28.1716844143803; Mon, 27 May 2024 14:09:03 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.09.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:03 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:08:59 +0000 Subject: [PATCH v3 09/18] media: venus: Remove unused structs Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-9-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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 Mon May 27 21:09:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675793 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3143D16A37F for ; Mon, 27 May 2024 21:09:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844147; cv=none; b=Lcg3+g2ITSnfbDcE+5vNL6379RONAHAkSCKz3oit8tI+bdXwY1sEZV1J5IYlkORIyNRxtGHhpXiUhuZipRmBm4Icu67pX0Ebi6TvOjzqVC+0WhIjt2e9eIgr3q/cJBlCt1M0fGFHR8IndEmeJT82eXeBq/us7BgwDGZ9Op8xOXE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844147; c=relaxed/simple; bh=GfWDLk1ryOZK/reOhUzf6575mRAlpuhUtQvw/mzD/JU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ur+i/W0i/Qj1fODOUVgRO8zR8h+5mj5kngoWhn6TTBUWYS00JwKHLxpWu9uJ0zQXu9Vam00NACKwToaCSH9xyuvPU+mKk8N/5uR4xcuXOxVbhWONK8tfrZXRRI8mlN/D1J5Jl/q88XoW2SVCEFFPVDcMvSf//ZPV7RU5xEfta6I= 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=FuPPnW1q; arc=none smtp.client-ip=209.85.219.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="FuPPnW1q" Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-6ab9d01cbc4so702516d6.1 for ; Mon, 27 May 2024 14:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844145; x=1717448945; 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=XMFMYDIwbtVXl28Ek+P0OgpFhtX85UfGfaQmbV83XSE=; b=FuPPnW1q3CpFaLTKWY+eYBc3McMHDz0a07FfsK5d9oIcKbl3c0U31kb4zbRYRatuqz MSYJGA0QcpI44QO74cwVx/WEEjYWAFVuEQ5sA3QGa51wW4uFlfauWBAcbI+bK5Qb1UNl tZ12Knt+JdknPe6txx0hBpPwfsQgmWvoZe4Ho= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844145; x=1717448945; 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=XMFMYDIwbtVXl28Ek+P0OgpFhtX85UfGfaQmbV83XSE=; b=UZsdI4snHzoA9oIl4EPXBAUBRjgHcxEhhErQvANbsdVfS9ivM57WjQ0AYzrAlfpwUc PhBCOC5Jv0V1n2o7AjaFcHMqxYAvXEiPmGJPe6hlchwxgQxPhW/iMUNeNzBuF2X0gMzU auhjU5aPTLZ4ljlvklljGHcNyUi58RUefqZacfVHHm1Tk33u+l5eKuE/ow4NjLt+SwWq dJHJUwtZ5GiN80QqhO+o5IWA9n0bPLTrsyvWK1ONs/eOH+xBJ8vvaySfimgltNEdUSap csvoKuVc59nw5t7+ZeVJXGaLNizXpZCz8raAHT7eeXIHABuOujekZUQoTL+c6Sn4rBbd wWMA== X-Forwarded-Encrypted: i=1; AJvYcCVze/GtIIFj3EGsgfppSEEwA7k43pPUszQYGrlPZTcIPVIQkX9VupBCW0Kglm5aCSvhktr0ZDPcxIXKK4aPOyjypySs0zHYSwsCPbkvzg== X-Gm-Message-State: AOJu0YxnSzFckku1Q4++tPMdeosUWpirE7aC1tU185M47Tinbj2lD4sO HwcdyEZP2SvPUZ0PmAEwstOXiJO8R2TUv4nyxZZFrzVEchHykMc0bEkLeADOGw== X-Google-Smtp-Source: AGHT+IHr7Fi3dcDDpjR1lbECW4wDGr2Fb676K/vWSJzr1ujDmAptpzsDNg4YXuiHGhx/L4ZyFxLR+w== X-Received: by 2002:a05:6214:3b89:b0:6ad:716e:e13d with SMTP id 6a1803df08f44-6ad716ee163mr71569556d6.60.1716844145035; Mon, 27 May 2024 14:09:05 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.09.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:04 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:09:00 +0000 Subject: [PATCH v3 10/18] media: venus: Use flex array for hfi_session_release_buffer_pkt Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-10-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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 Acked-by: Vikash Garodia --- 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 Mon May 27 21:09:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675794 Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE87916A38D for ; Mon, 27 May 2024 21:09:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844148; cv=none; b=uHDXrVQedm+56aaszWdXX/tGSPz8dbeRZ/OejWvcSDgji/u/ESA7+SGI4DXpbhQmMJSB4rr2hOzOqq0hSV9Q7T7HdwEwTPWygLsuy7Vde2ZT+YHM58+JEIBw0zC4FQbo72R90bKz18uEfinwc5moLi/9zbKJQY2iA/ZSM8EAi5w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844148; c=relaxed/simple; bh=Lq1y0c2FBMWDMcJqNw9gMzRU69b3LiN8MPGPGDiaNGA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nRZa/rgrfeuMKb7b0mfTLPUUaM1dxt39Crh5eozd9TLv/7T1xCrw+uAl576UUpklGIwz3LNszYJGGadIhq9posI725Dm2Z9+tyIcFl6lFq6toRggrYSwgtwjmCN4/s4l8xvoNdDhr98f0se7HgHxFwXsqhcStquZ0/QwvHDIq9w= 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=ldcn5YN+; arc=none smtp.client-ip=209.85.167.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ldcn5YN+" Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-3d1bf72f819so79198b6e.3 for ; Mon, 27 May 2024 14:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844146; x=1717448946; 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=umQqb6RnOEqhwSbkLr5UqyeS93yk9NUaTbaKND2fVbg=; b=ldcn5YN+T+padx88LZhTPymZ9qD94G8fcGOkueat89XsPBcyCT03mNbyfJ7Sk8nie7 8UKz+3sSdTQ7jfjK6n0Eovf+S9AiBxZYXNe6r/WoX5OIv83wWkXRwJh3DxNSpbRigCME 71/Rmk1SSYf5a9THJnACFYw2K6MmvYZXXZ+VQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844146; x=1717448946; 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=umQqb6RnOEqhwSbkLr5UqyeS93yk9NUaTbaKND2fVbg=; b=qpe6920NBhTY24WB6SCkuNi+IjKaj8wbXI+xi3hG7dm4TjLc0y5AdOvW2SGvObrhnI /sfqY1jtUep1iuqRpWK9wcY1ATb+y6imPWX3dfvvc93gTYpjW3+JgFEorbthcn6grUJh hEZMVJPzzFmkJmHtDO+cQYV1Dx9b6qPgxEzq3xiSc+hX9sQMT1WMfRUMj0Kqzj3f+PfD HEERSniXmCnKhrb94nSLmrZdFVZJbdRax1ZDPWh1MwNZvw+aBa0LkkM9GKbulC/jbg4O dTjRQqHjnpHf/RY6Lq5dPwcvb9T+bdtpebNIGtyIZWp2fbbtWV/xjKi7iagjXeoUdqb1 g4Jg== X-Forwarded-Encrypted: i=1; AJvYcCWjT2uXzsliibUAbYS0QoB9Puj6yJbE0dH3U4FsIj04ZhJNcswCb/YN/CDRXgBj/x4FYHr0mrp5bN9/gFHP+gFMzP7xCZmUCGXgcBwyVw== X-Gm-Message-State: AOJu0Yx3IsKWEejBw8EagJVf2gvcfc+pVKxMNPnfd5mQpbpSsfy2Q6AL oUBVJtktWvw3u1sGQyIO1yR+QhAqYhkFH3lAhdhwL3wtYVdR5xC5F6LaKKqbfQ== X-Google-Smtp-Source: AGHT+IExxy1NVsKPC20NN8GUcPBEpa+B5Qdfpnr1hCHN8PSGnu8BXMpCsdi04L8WrZaTqFEAL+NTSQ== X-Received: by 2002:a05:6808:1a0b:b0:3c9:714d:cc7f with SMTP id 5614622812f47-3d1a745c6c7mr12813221b6e.36.1716844145955; Mon, 27 May 2024 14:09:05 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:05 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:09:01 +0000 Subject: [PATCH v3 11/18] media: venus: Refactor struct hfi_uncompressed_plane_info Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-11-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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 Acked-by: Vikash Garodia --- 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 Mon May 27 21:09:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675795 Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.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 E47DC16ABF2 for ; Mon, 27 May 2024 21:09:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844149; cv=none; b=SPxGHBT7YYkTaVHKxbEDMgNypTJyuPb1+OC7EY7d5fVdY/GeyBw7PMvSYzTv7IzgkU4SjE+hcE8jPGc69JKVye7KTUv/e8yjrhs9S1twKfav3K25v9neaZDVF+3aH8VBL2pUXPEYNkiVBJ0TCubdUfyBkfKB6UiJ/nnyhs/RCBo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844149; c=relaxed/simple; bh=SkYzkaG0dYFUzqixrUpSplhPbKC3wytiTj/w+GTRMzE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=i1ZDyy5x7iW2dbt77kwQg0ZdL2zhSwuwq5t0rrpEv9253n+j8MRcSezJOJgMxkIwenmfiKrATZgki61XOp/xScED7eAppiIPvTBT9ss0aTeHV7IfoEx7iiZkbTKy46Z3kQokN8QDCt5jC7F1/BKdkB67IOBnFesQCmRx3tzPMio= 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=dhfcfbng; arc=none smtp.client-ip=209.85.167.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="dhfcfbng" Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-3d19dfb3dceso103410b6e.1 for ; Mon, 27 May 2024 14:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844147; x=1717448947; 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=wbbB0QGbRD56aYsaD+Y+ZEPd95SUig7FuxMvDlZcWEM=; b=dhfcfbngqy3w7ZU6o0dA7/r0jv2M6iVSPLaa+2fDViiuo2A8b+eeSWEX3hVJMLjnLV cCZ7AyecobAJdsIspop+ywAs/NgrJo7xowUm1QJwYpFNEIrRBBqbrnH6OwyPkLpyQfpu 9vm3+RVjW7n1z1vJmjf2qIxWaVWPwKBNeumgM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844147; x=1717448947; 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=wbbB0QGbRD56aYsaD+Y+ZEPd95SUig7FuxMvDlZcWEM=; b=s3lDcwEssWL+72fh2uSB5t41WkE/kDbhlATcul3WkiECEeVME75GCjpghcoDN0f1Ui b/YHRN8sSMmVIqYqS9bfbPWazfwCJ0mMUiorhPQFSsh+3DhDrWssBlAu9O4ow4oD4rf5 2BcI5JRNik0FbzTh+rsQHnQLTThb3tCQs44FBZRHc1Jx/0z3lFD5pqr1j8rf/qhqgMWO EUCjrmFgUcDNcHlLAGnBjDCx7Gg9v9ZfM7uF6WVFpZJ9cLh/ructbl2KFnkXsNdRdU2Y cnBVzmXKmkYRd2BbhhKsP3YgU6YG8+tTBO05dz3PlbG+Pw1RqIZrM2a76MF4BqLSMgBV Uspg== X-Forwarded-Encrypted: i=1; AJvYcCU2p8j1bmN0CT5Xst3Fp2oEGkETljVIj4hjffHz1giWzV54pfDvJu40KVlYSARLnWGxBnTzyRPAyNBFwmAHd7aSjsriiTjrhYiTYUjF9w== X-Gm-Message-State: AOJu0Yy2KSV3K1UijD/BTNDsrLyxFqPDtlyeMfAnziBz8SHjvYKl7j+l VAwn67rTXwtiHgU4uxScvuSDb10VPHv+XhvETm3I6+b7ODQalRGDlwu9uEmcJQ== X-Google-Smtp-Source: AGHT+IEnIyO0WIHMxuiEtYRurphYM/ASsB5F423fmVs+Mw1AhNj6jPPmJvmyuQNG+kiC5cStpK/OGg== X-Received: by 2002:a54:449a:0:b0:3c9:7a7b:a7cd with SMTP id 5614622812f47-3d1a91908d4mr10056024b6e.51.1716844147133; Mon, 27 May 2024 14:09:07 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.09.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:06 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:09:02 +0000 Subject: [PATCH v3 12/18] media: venus: Refactor struct hfi_session_get_property_pkt Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-12-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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) Reviewed-by: Bryan O'Donoghue Signed-off-by: Ricardo Ribalda Acked-by: Vikash Garodia --- drivers/media/platform/qcom/venus/hfi_cmds.c | 4 ++-- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 3418d2dd9371..75f4a3d3e748 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -402,7 +402,7 @@ static int pkt_session_get_property_1x(struct hfi_session_get_property_pkt *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->data = ptype; return 0; } @@ -1110,7 +1110,7 @@ pkt_session_get_property_3xx(struct hfi_session_get_property_pkt *pkt, 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..f5708fdfb197 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -191,7 +191,7 @@ struct hfi_session_resume_pkt { struct hfi_session_get_property_pkt { struct hfi_session_hdr_pkt shdr; u32 num_properties; - u32 data[1]; + u32 data; }; struct hfi_session_release_buffer_pkt { From patchwork Mon May 27 21:09:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675796 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) (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 7D03616B75D for ; Mon, 27 May 2024 21:09:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844151; cv=none; b=f6xNUOLIJQXmAQvsDoO3Ql7E15qJE7wucNpdCNioqieic53DGOaIphKa1jSW1l+Zg9vuVyjZ4U2tqyrsWukKHrb30kLGLR751KllF3CXvCtNYk+hq+ImZYVLo/BTPWw1OUfbuIkQaYn0WMdx8RGcv1J8r9yK50tB0N0wP9PjRyw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844151; c=relaxed/simple; bh=YTzf7p9jPjImSwT7T/FubIWDNPXlqDUQZ9SE9jMD+/s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jX38k3DanLktaLh5w7C0nf2udy+RZ9J7Nj4VeT7BaOoaLYs4zKdLZrkPniPTxK4yT3H12mrEHmUoaa/v5LTF/tpfwLpUWY3BZE4xfcazzic22hYVi/sCCqdOEjHbrLm4eLxiN1Aa4YQCvAASnTmo31NOmyzrYKo0xwQN1KHeP/8= 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=SIgGiWAm; arc=none smtp.client-ip=209.85.219.49 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="SIgGiWAm" Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-6ab8e0c42d3so571196d6.3 for ; Mon, 27 May 2024 14:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844148; x=1717448948; 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=5cEAIpCHBHS4CpppuQZOsAxg9IlPyhk1N0Yb+SULR3M=; b=SIgGiWAm6Ptk7/DNq0J8FqDLOmuHfZf4Ak/X0ClCQe5RTnjb3l+PkeCf/Vsf6vJQoY xjhSIJs7utvCgigjQlVJzIEIKMU/pGJdfwEbuMjOVGpCU2zB0CeAIyJRNgTp8ihl3Z3b KWOZN7PYfBzXdlMXaqvF6Ej4PIepCxYrr9Dys= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844148; x=1717448948; 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=5cEAIpCHBHS4CpppuQZOsAxg9IlPyhk1N0Yb+SULR3M=; b=nELjcahSsbGeSA5zFYOrS1Bdn+WTKfuJhkqW1Ppm93UiGN4SxY7YaDcVo8+r1Tb3YS G3HChlcJQj2yZb6vdMzU0/yfTWCApv0CMz5qJgq1IOmRe2cKyITFbnBY/W73Vi12mH3U ygEwtlJoJW6mV/YsXVZC8z0MoTdrxCjFllJ1F5wD/zm8LVm1nhgnAOZL5l9BFZfJQqT+ Ss7hTpKo43kE2l0gRUeagcUwB42E+CrQLuz/q4xy6XbQN23XfTi6lB0lYNLn2WC8Y0wz JWqApst5WupLVMmlCdqTlCD5rnBtXNTlvxv4vMaalzHi57TsqwPOOgIhHw7s7/3NOps2 KYkQ== X-Forwarded-Encrypted: i=1; AJvYcCXZcbEEnVAqtYZGMhO8b1Fad6w+fN8ysp3Ub9CVLvSJTx33eH9olMsrlQRPi4z5pp3g/V5nVh6SOGzTVjcPf9Q0TnJtyrmkQfXPk036SA== X-Gm-Message-State: AOJu0YzDhOunH3Vo25Ck1rxo+GbSMu3NHSqpREpfizswTC4mhWf1Y/OR QFvV1SWWObuFbyms00JO4GUsHflnkbDTpL/zSUGXgcLp+E+nbMITl1F/Mdt6Cg== X-Google-Smtp-Source: AGHT+IGAYysdbshm47o1LkG9bleprTOKR64YuuW5s31mQTt68Az23X2+n4bKsIArHsfPK4uZOPlyMw== X-Received: by 2002:a05:6214:9d0:b0:6ac:710:3ea2 with SMTP id 6a1803df08f44-6ac07103fc7mr82965526d6.6.1716844148230; Mon, 27 May 2024 14:09:08 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.09.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:07 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:09:03 +0000 Subject: [PATCH v3 13/18] media: venus: Refactor struct hfi_uncompressed_format_supported Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-13-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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) Reviewed-by: Bryan O'Donoghue Signed-off-by: Ricardo Ribalda Acked-by: Vikash Garodia --- 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 Mon May 27 21:09:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675797 Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.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 5485016C686 for ; Mon, 27 May 2024 21:09:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844151; cv=none; b=BkLctirObXE1JizEXxc40wLIfFPzUa6m6eJ1XFN9OTZkm/cSQJauMDbAcrV2JHWBzAB3lwb50dfndZuZ43DmTTYv2K2cdjZOObFktMtc7ow5xchkAhJiG+9UxRsTY4MnhmXLLMQ/p2NIkGtkn11TgOrGFjixCcDFicDEWNDhYVs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844151; c=relaxed/simple; bh=jr5Nsb7XakeGaEZUFmbzxct7Ebv9EpVBYLQkxsmhvjQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VaVpCHRBijG4kVqNEb/xf+dHBSOE/ruj0sjTIKl8MqtJS4iS6sTBCV1R9/gvp9Yop6tiFrHW01er2hHi8ab1Rivx7HPjaGuLmJHR5PH6BDkNX+LAOkH3YPYwQkFWRxPQpU4qP0pe1pB74KnQ4sHmxuS4GrsfErmXqAvK9KWJjCk= 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=ELktiF5J; arc=none smtp.client-ip=209.85.167.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="ELktiF5J" Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-3c9b94951d5so90139b6e.3 for ; Mon, 27 May 2024 14:09:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844149; x=1717448949; 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=l8AF3gTAgrZfiyrwKiI8Z/hJLEimNwmB5PPC7y7Y27M=; b=ELktiF5Jg2iojDgIVz6QZf44vieZv6wDBCj1Kv9M1bA4j0Cv0uidZ2SaaAJqDO0mtL MTbUni4NRR3CNEOolVeKWhKsBGEWtRWzbK/mBnXnsgrnYIq21YSCRaO8VQ9NTFN1bCZt b9wWVX/aelDL37r0tqIzVUUdVuxlWGKB4ke2w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844149; x=1717448949; 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=l8AF3gTAgrZfiyrwKiI8Z/hJLEimNwmB5PPC7y7Y27M=; b=VYaKRnYehQju2zpAjcJvrBIHOK7Wwk3T3jilueNRScQGssvojlTduodFlmHJ6xFoGy eWy74sqHcy5UY+LN/tAyfC32ouo6bYS1G61hVFxaD2kDZsKZocYdQDqh+0X/2ztlFot7 eS2nqvdy31hvgwWXaJY3uCaGQASvFfCL7q4d2UbtNvO7431qVMpJLGfbs1egiFlNmtj9 /PnNzcm+Uas28g3EErLO7OBjgwTtLtgZPTnzZlAyXQ1eCP2ceLRbipusNsYT79M8el1f LzGKiZ28qEFDPVCZgv8IyqZ0lZAgEn9s4s+KDQf0cFBb7seHiO0iMM539gLAZozCYLlt HSjA== X-Forwarded-Encrypted: i=1; AJvYcCXFecl2diRvuIb+7Jc2kixlj+u9aQ5OJPlEbdEXP4A6+8kwZNRfEB4bx3YQuPFV1wp24N7Gn+1+aFAesiSMmZ8nQlJnuy+xQ5PNsg6LjQ== X-Gm-Message-State: AOJu0Yz8fWyaJJ00FztughbMyLuF6TbhCsWs/yVLQkvpPIJPhlZgmjky TqqfRWr9/qU98RMVOHFCKGQLmiZRZrUqVjihJQfb9oG1b5IEXRYz1fbF4UsToQ== X-Google-Smtp-Source: AGHT+IEeQdpu/L/LUu/zi1optJjNBsHcnP8vBr9A9vq3MCBulPPEkbqSZPPYk7ouE579lx7Q7UyqIg== X-Received: by 2002:a05:6808:384f:b0:3c8:4214:fe65 with SMTP id 5614622812f47-3d1a6019bf0mr15173614b6e.7.1716844149278; Mon, 27 May 2024 14:09:09 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.09.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:08 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:09:04 +0000 Subject: [PATCH v3 14/18] media: venus: Refactor hfi_session_empty_buffer_uncompressed_plane0_pkt Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-14-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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 Acked-by: Vikash Garodia --- 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 f5708fdfb197..8768ee052adc 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 data; }; struct hfi_session_fill_buffer_pkt { From patchwork Mon May 27 21:09:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675798 Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80E7F16C844 for ; Mon, 27 May 2024 21:09:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844153; cv=none; b=Wys5yVrTQKZm700mjKV3VLIVKVCbHKivkeXBLp8WGSlvNEosfUElLHJOgPVgOxpwn3eHB8wLhq8xzD9rmtGnrdwOLzGjkZQE3GiHAv94OySmiEc2KYRo+J/AiRC5TmO2qwvT17ZbQMo7JQDbLeUQwlQTyRhX3VKStaOLUaPKl3w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844153; c=relaxed/simple; bh=hodq+gCLyqsJ1R1uHGMq0ldSTiTA2zY9HKvfL0U27m4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ksjs080eRWNLOvn42dwKymj62oVVYHj8DxhfyZqhDXOm63o8wUWqiE0/1WcoKQQovnGawc+/1C2hxM2rPOdJT0dtUWuapRRzSSqsXR5y7JPLb62wMObXkvneB8pcXcjCLD0q4+nj1ETUwwS19tOUDQZg4EMwGOnKAtaAmDt3ZNM= 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=Et8YXUpY; arc=none smtp.client-ip=209.85.210.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Et8YXUpY" Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-6f12ed79fdfso124452a34.0 for ; Mon, 27 May 2024 14:09:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844150; x=1717448950; 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=3BUOU53Y/Qs7SwrH1hNBNdnMNU1q19wfN3LEF6XYAR0=; b=Et8YXUpYRkC+fJnYcrzpCWm5+JBCN4thulctQtyzT1jOAQiiJdcYjjUVXeZ2pk/CUP 5q8n04dbSTCtnp+9S8w7qq6SRUGak6xRJoX1DnhyQoPs0CNnC4qI7d0g0rJchXGditpE KztVGhqBvXNPOteEN3fYneOR7FrH4O5WcdVas= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844150; x=1717448950; 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=3BUOU53Y/Qs7SwrH1hNBNdnMNU1q19wfN3LEF6XYAR0=; b=GCuSB8OyIreuw/Thc8QHTfTcBuK/HAmZ6idn7LK6hctphLLRfg9jEhwMnockwXlAg/ ENya2FYLU6yeVjIXbVP7EPTvXMsI3UaFUxmo08fu6L1I1FjsOWYfIohKhithetogrjxV EoZMEu6LPFxzxjltoQ9p9w3d3TZNsVllWJq1rymtXpVNemjXrDzngOClBzPfYdn+y+cN k3TNOYIV+x34abi0tr9fasEX7Sx4Kqg0c12V/9v/uDzY7MzEJddlIm99liX3oKRWIOjc 67xIgH6UiS8wGdKSSLg+TOzF0UAVmNFUhLTtwIHkF36O4amm/LQnlImsJICy6HV5A55/ jTxA== X-Forwarded-Encrypted: i=1; AJvYcCVeMac+Achj+dGYKETGqgaNWj9mxbx5SdPfkr4lQ7tv/5rZNi7aSBYKtLD5ER4B/vNAyjdKyEFkLjuWGiiWTO3qHtl844Zl2FBiIqyeCg== X-Gm-Message-State: AOJu0YzxKjs14m84N5An1C1Ibzd56mjVkD/md7PYVW4qBgR2zESDfje7 BOzew6gJ22scwbA17wFtnuXrkzDArF1aNk7hu/Qgd5IOkajIFWivSswQSHS2OQ== X-Google-Smtp-Source: AGHT+IGpU7e2bDXtLKHzBuQGg8VU63q3btltKxhtl1G2R0LWEM8uDkQDnfIvjE/wdw2CIfox8IrWQw== X-Received: by 2002:a05:6808:3d0:b0:3c9:639b:f821 with SMTP id 5614622812f47-3d1a7b30743mr10023918b6e.49.1716844150503; Mon, 27 May 2024 14:09:10 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.09.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:09 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:09:05 +0000 Subject: [PATCH v3 15/18] media: venus: Refactor hfi_session_empty_buffer_compressed_pkt Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-15-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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 Acked-by: Vikash Garodia --- 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 8768ee052adc..2c56ae303989 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 data; }; struct hfi_session_empty_buffer_uncompressed_plane0_pkt { From patchwork Mon May 27 21:09: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: 13675799 Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.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 6138D16C870 for ; Mon, 27 May 2024 21:09:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844153; cv=none; b=f/bmeKMCJ9Wo6QqexQXt2r9w8+RLaiU4ohurD7hOyL4ptyUYJSdSrKc/XmL72ryMLa4NHaI/xsk93TvsrpkZk7atZmtWUTNLPSGawbxB8FoH7aXyLqTV+/tQ3RKuHMfgR7ZcBMgqAcee9iAVesa0925X5VKwucqEWmGRF2mWnuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844153; c=relaxed/simple; bh=18CJ7PQ1lB0gUrD6RfVGnPJXBvr7tkb9/ypQsAIKU1A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IGopjykCqaWjCobQaLBaIf1t8ocWI5w0q1AJvBlLDjggRPT6lgqj0KmS8vhC2qnr5j96YzdMRuBg7EY6y1RAjqnlCN3VQ+98nOcp/ooAzNTzRP1YAfZowcI9EpNSSZ8zoO3Pny/5EGvGMWki0Gv5WBcGYiYBT0v0athwOcsE2/U= 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=YmT+Kdmn; arc=none smtp.client-ip=209.85.167.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="YmT+Kdmn" Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-3d1bf479c62so124421b6e.1 for ; Mon, 27 May 2024 14:09:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844151; x=1717448951; 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=fsCOjnsdlcylSWUzXLRi2p9pLgCPEuJ2hVxyk0b0ycA=; b=YmT+KdmnTQLLAQZHGC+OuPtSeRLET6O7wwjdDAJm0akq+km0kzwcU6KiXZDABW43O7 GgxhLessKLQP+7AlatVbN1aQj6GkBex0rTf904/OBmYaGMT4dj1BFkRF6fmlET6RRp3O sXduBIflcaHrTEaUg/9pk4Uesbd34ybtrTeRY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844151; x=1717448951; 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=fsCOjnsdlcylSWUzXLRi2p9pLgCPEuJ2hVxyk0b0ycA=; b=MCg2dcf/M9QczwfFi1HHfkDb0F8K5h2RSerKZ0ZM2lXMZH0PMqHf0RRyuTglOqixgk LDA7P7N0YAdD9b+5P9v7oTBaJZTxK3ebNpc9KpDiAy46H9toPT4Uc/jUDc0QKLJJSItO 8ALFPv5Q6G4SX9prcFwfHBAzh6IfetXEG9T1+rumdVlYX+zV2FhQW+swus+UAVpredlg hrvmwmGAoeRlPE8wmHg6iha1UhqnDYigHSTXBF1m60dCTHgX/tff/2DcFLyEVmCH5jxy TCsKJg43mDDl8b0FhzEimY0xngAOWXAHrzgbkhzcAL5LVjcScPZKKb1R/IKGrFeUF+AH NytQ== X-Forwarded-Encrypted: i=1; AJvYcCVkz3TkUUwtx3ZVpWKyvH2z5dmyKUi9lo4mYd63NL6BCMBrQEEZCRg67DOZ4XO8V9gAqJQy+9NZgHxfeBnUdZN1ypx3uuzM7EqW4xmgnw== X-Gm-Message-State: AOJu0Yz+zO/Xga+EXrUW4svseozsb0JSYE1XZC8Do0I6tUwsjc+1Mdpd 7tZTd4VCCegGyDFOWk2sdMjjtfCc3eB2qPKihQIpdtNeFP6f9RuBR3mhGG0XWw== X-Google-Smtp-Source: AGHT+IHc+u88l3NZeB3gMeItKSAdfjYaqVULR7KLH5vjoOvzDl4hgtgcjoAzsjlvxjTkKAMqrKZ/5Q== X-Received: by 2002:a05:6808:1788:b0:3c9:c509:c17 with SMTP id 5614622812f47-3d1a4fb41d3mr15134430b6e.11.1716844151531; Mon, 27 May 2024 14:09:11 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.09.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:11 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:09:06 +0000 Subject: [PATCH v3 16/18] media: venus: Refactor hfi_sys_get_property_pkt Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-16-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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 length element array with an element. 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 Acked-by: Vikash Garodia --- 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 75f4a3d3e748..0a4de8ca1df5 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -156,7 +156,7 @@ void pkt_sys_image_version(struct hfi_sys_get_property_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->data = 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 2c56ae303989..f91bc9087643 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -74,7 +74,7 @@ struct hfi_sys_set_property_pkt { struct hfi_sys_get_property_pkt { struct hfi_pkt_hdr hdr; u32 num_properties; - u32 data[1]; + u32 data; }; struct hfi_sys_ping_pkt { From patchwork Mon May 27 21:09: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: 13675801 Received: from mail-yw1-f182.google.com (mail-yw1-f182.google.com [209.85.128.182]) (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 BE6451649DA for ; Mon, 27 May 2024 21:09:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844156; cv=none; b=ET8Pl1LNWVFPLYpX3Hyv8p4w0DLJ5wp1Dh4EYvavrwgs0Uk2zNt92EzhpeREHrSItBgFqqAW+FdI71Ru+B+6XjpX2WbSMh+BhRRd9PIhrnz58PYvTOdmIKQ4tcC8TxYhZergisn5tDGBptiCvNvQWD8mCD9tyTiVJHl+5f1T7/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844156; c=relaxed/simple; bh=4i7VPHSnsqzbI0HW0QkAUX5lIBSz3TuveGC+pMCiIHg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WyGhQDEr+D1Bc4IqRtEbpqZR5fzLXHKrV7hHWTNtWeXB+57z/EOlBZPRUTDxl9+oJ3KH0xkS4c8wkj1fONnoxtONvGk3lMUfWKU1uEJBo6VO39zkXp1UE0sD4MmttTNo0cn0TVB1EJlCj7NUbtPbO0Kr2U3cQXiHTFhErswMbP4= 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=gZOcqluz; arc=none smtp.client-ip=209.85.128.182 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="gZOcqluz" Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-62a08091c2bso1621767b3.0 for ; Mon, 27 May 2024 14:09:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844153; x=1717448953; 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=l3fZDWwdSfr806tKPwKAlFoXNkHe5euNILjrUm/nl8g=; b=gZOcqluz3b2KD6mADEjHMQGWJcW0YwGnUQsgxkPEoAUkPptRkgwicBvhh5OdGeH8Jp 7whmhiK5sIBJLG03keF7/qDv4mz3H6HddJpqqvcFbcz3NjVKda17EJLMcB0n4OPDKbiG KRnk6nb5GDJLxQV3yf3EYHX/YPKmOjpuC9hUQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844153; x=1717448953; 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=l3fZDWwdSfr806tKPwKAlFoXNkHe5euNILjrUm/nl8g=; b=FPhPiYqUvP127NVC4Vp4SEnMkpdhtZvgoK1kRJbzgOiP0IAeVGPdo5FyqwYeDQw6tq T3mhBC8KtJzONEOJyleUsZgfdaVNwo0mJzHLzymA1+Xec3zWarjuadhLepXXsG+1RXUx E39EaDbco3/2hRCiraUWFzMY+IsZz2v6/I8gy8X5dhdxK0/UFUfQ2clWC8WfkyWYPhe1 przEsLLHSwM/YwtJ9wnCRyOdIHQ/OuXOx9qoNO74bpmpo0Ppy62i0mcNs6u7DarUIiap 1Ux71F0+8j1he3G0BSZ79WNvbBYLSygLp04Aoyob3fGAMdsjfmC4qgrjdHZDvGB/cm8t umfg== X-Forwarded-Encrypted: i=1; AJvYcCWkA9RiR5KMbNJDUxicGCYKxCLt8vGNZoYXrPRZ/+YVVjFtBYU46VHu2e7Ry84UT4/xeNNssXIVnYUzM49amWZnzT8r3xrVeRihCZMK1w== X-Gm-Message-State: AOJu0Yy/Rn9p6bNq5NmzPf++a1mNfSd7hflE7faWJEwihsqFUzfc8f2x YGOXSPpkpTBX5yCCFGxfEv3JIgmfmjduTkvYPJC/1XwsRYG/BCq0jq67XXfcSQ== X-Google-Smtp-Source: AGHT+IE7yvawDvvPTW8z16+danN5kIYa/qq3kf2XRt5s2NEtmjukpOxQYCxbSk6UfuH55Or4GMU6Cg== X-Received: by 2002:a81:a105:0:b0:61b:3484:316b with SMTP id 00721157ae682-62a08da0820mr90061817b3.14.1716844152764; Mon, 27 May 2024 14:09:12 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.09.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:11 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:09:07 +0000 Subject: [PATCH v3 17/18] media: venus: Refactor hfi_session_fill_buffer_pkt Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-17-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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) Reviewed-by: Bryan O'Donoghue Signed-off-by: Ricardo Ribalda Acked-by: Vikash Garodia --- 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 0a4de8ca1df5..3ae063094e3e 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->data = 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 f91bc9087643..daba45720ddc 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 data; }; struct hfi_session_flush_pkt { From patchwork Mon May 27 21:09: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: 13675800 Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D234B16D4CD for ; Mon, 27 May 2024 21:09:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844156; cv=none; b=u6A+iwf3j58/hVlwNg0OrZbl+gxI0POg/4Pqi7tfJ3HQwwW8w9qMLLgzRR7OPPFgXBu0veCKgtEttG1R0dSJw8NjilW0pGQwyJ1Kfbrio/aTtN+nAaJMYeAeTf7HEVPmOdKjGm5uNCLTdfdhKYkZrZoyWrErRBRZAbElUuA2q+Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844156; c=relaxed/simple; bh=vq5XPbrneys7sUYRmsmLUBdJqp5KlWLzYqdDrrKd+uo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qIflGKe6TnStizEFAjyIgNF7RYBAw9JUabOKepZbUrvYck2ExoGDAcAcs/GmlPLOozx3SvN3fy/KzREAWQorQdxEeoxyN3LAiED8AHK5X/HjteC5/0QdH5/byT42ejhSTyqoOKRlLaIWgD97w9OuEsLNQhRgbsdDAT4QNu4c+Dg= 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=MbJskAPc; arc=none smtp.client-ip=209.85.167.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="MbJskAPc" Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-3d19e57c80fso116639b6e.1 for ; Mon, 27 May 2024 14:09:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844154; x=1717448954; 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=wezSjtqVEo6M70U5aktCNd9/8NZeYOZUNM9cGTCe/BY=; b=MbJskAPcSrvjOAy0DviqwXBsFX3oEGs3LqpCaCu5mfZEwQ27ILECF1dEjWwxt4G2hV dGjDi0u3uzAePispGYRrfmmDaZEEeMAQEL6nixoVr0jbtdutbgAybTKezMCyTum8w6u3 VDzyXS6gQolJ3f3okliB5PRqIewCT4VXPnqdU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844154; x=1717448954; 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=wezSjtqVEo6M70U5aktCNd9/8NZeYOZUNM9cGTCe/BY=; b=kje8eBcZLSvNNrD92cTcbb+gXuVPGF/q9UFXxrtJOzwR/DhKOVsNl4rrDM4yyQIBbm 6hEIrywe4ec5VaRjTr3i+n8gOstgNeiMzkL/2VmBZjpDWiPTwvTbsgDrCk/ygPVuktoo 2YwihirPL1WzfMGHCB/0A8/0N2mEV+EzQWpC2wNqUrUitg7HTc4b6XIpL8Dq2vT+kX5s iIqyOciaCsi707BVk+BXnxSWwIon2FXGM8F6Fan8vRkyJxy+ebCAmQa9Af7Hgdmln6R2 6cIeGlovuK5cvxatqe2LMLQlpcjNECkW6f7oNJTHkr1nUV3f9tlcXjUr4pZ9nDchG0W8 yhrQ== X-Forwarded-Encrypted: i=1; AJvYcCUmohTdKN9gQZVEp06Rf9CF7Tkw3DxMDbgmrCiRaMS6PlBAki6qH8QgHBejRY6DVrEHkXeU9XWMRsiWjWYQHbKltAIUnOco5KBH5D3UyQ== X-Gm-Message-State: AOJu0YxNQ2AqfIxgJ3Kn1nUPVnrGmbTOItmc5XvZdu+6cc/lbfNWI4to Q/4wdZDjq3ZeqmMF5mba/L+wWPJmM/btYiOrn1BvdkUPDuJTo01LZqVIdWFf3g== X-Google-Smtp-Source: AGHT+IHZsdfjWuFgWCiJb4AmRAsbbEEenzn0gNbNiTM1mFHuclImhi2FXMMkXzq7m9/5FIbemAWbig== X-Received: by 2002:a05:6808:199c:b0:3c9:c7a0:94f7 with SMTP id 5614622812f47-3d1a50ad2aamr13149063b6e.1.1716844154031; Mon, 27 May 2024 14:09:14 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:13 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:09:08 +0000 Subject: [PATCH v3 18/18] media: venus: Refactor hfi_buffer_alloc_mode_supported Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-18-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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 Acked-by: Vikash Garodia --- 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 {