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: 799289 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 --- 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: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: 799288 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: 799287 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: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: 799286 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: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: 799285 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: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: 799284 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: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: 799283 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 --- 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: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: 799282 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 --- 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: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: 799281 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 {