From patchwork Tue Jun 18 13:37:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 805334 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 06ACA167DAD for ; Tue, 18 Jun 2024 13:37:52 +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=1718717875; cv=none; b=JmSLQ/iu6LDG+X5TkXLGhH2Xb3laMjWSo1sF5BGNj0jXm6ekJjS7QKOneHtIzdcllORTIebZ8LqG3oSD2VSGcRl3TGhXop7nAfbieBTvBZTgBRBLiMewIkj63wbjxQPXyQ7vmog+5YKH9ATbXRKyKnd04d1bzI7zPgjS+Wyx0Lg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717875; c=relaxed/simple; bh=vg4N3vHUM1NcfIbzq9vLahhTUasyDZ1bYNx+7yaEx7k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JgYJvv5KEmM+JyK9o8NXUJaEMnyVDEtAPkpFTYzifXPn4VOGIJMNvYA7MHxnLRwrwZ8wqf7AR2llxJ5YotYwYo/ZOIloLPMs/3d6T2k2OQ+lZQmnCi9Rj8W7J921DXSHKqs1EucfxYjjdgy3jU8gZnbxCD35IUd9VWn5QkwIm2E= 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=LVvpOfA/; 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="LVvpOfA/" Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-3d4430b8591so728190b6e.2 for ; Tue, 18 Jun 2024 06:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718717872; x=1719322672; 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=iBlrdaaQBMTsb4IyivLP+IImA8pYTXHtea9bJPgetqc=; b=LVvpOfA/p38b9lHM8K/FCUwLLBHVbdmWK/2m1cwXvO21gnad89zy58f7ksG62Jd/o1 WI7WQVMyp4+2l1B8IIqauw/AYOAnZbb2ys3o4PhPYIP6QPtIwUbeqbs6kpdQC4UA67C/ XDZYCkddpxPHrZ9WjKkdWJcjWcF9YAVSqzmHM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718717872; x=1719322672; 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=iBlrdaaQBMTsb4IyivLP+IImA8pYTXHtea9bJPgetqc=; b=r4vhPxX8Wwh0aRM9/1KwiJ8ScwwvoTspD7a4e6Aq6dTSS2H6/v9BsCyMLH3+hKjEe9 MPvpwuI0C14KOcEaD6xFpAchC/ikKykqD8kZASbeTCaAIQYOa3WPiRSYHDAH6ThO7WW5 gTQJzxrOuc6fRR41ewW0A+F57M9iegDNlnUxK1KtRgmfutXSutKr8Lyz3j1GIXHKvZ67 ccBa8SLicMsIFeNyNyNHe+g2Ke0Os97kW0cozqqBMD/fQyIxqcQwgRqO917fvLAHk8ZG GclCRtORR22IshKbT5YGHaeqAobHMeL5ByFTKBJtZwWVi5mtGH9P9Bbl+uTVKoMV6IeW pyag== X-Forwarded-Encrypted: i=1; AJvYcCW/CvJQimWjT5z3HJJ4UZ7d+iFxQ0lsSS5eFPHz3OYE8vE5CX8cQLwlCCpECQiN2i1hv4hIhrZslvTzUAGyLMA1ArFYa2OS5i51xtijQg== X-Gm-Message-State: AOJu0YxP0Bgtu7Dy9Qd6fzo23V1IL4GS70qPB2DSogi4oycFJvAByASA KQTVthhP9tc7vi5SfOFeZBwPt5XaYxta+4s79tsshoHUXxoDZgXauEny5MWb2A== X-Google-Smtp-Source: AGHT+IGAbmA+QOT2T92r/tmWOvvfxvs5SSBY51LP38a381c8Nq7cxwS5jqWGmNHK7iqs+JxA0IQXeA== X-Received: by 2002:a05:6808:128b:b0:3d2:2b1d:7bd9 with SMTP id 5614622812f47-3d24e9085e7mr15725342b6e.33.1718717872024; Tue, 18 Jun 2024 06:37:52 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798abc06e93sm521666385a.82.2024.06.18.06.37.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 06:37:51 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 18 Jun 2024 13:37:45 +0000 Subject: [PATCH v5 02/10] 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: <20240618-cocci-flexarray-v5-2-6a8294942f48@chromium.org> References: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> In-Reply-To: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> To: Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 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) Reviewed-by: Bryan O'Donoghue Acked-by: Vikash Garodia Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 41f765eac4d9..6dff949c4402 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -201,7 +201,7 @@ struct hfi_session_release_buffer_pkt { u32 extradata_size; u32 response_req; u32 num_buffers; - u32 buffer_info[1]; + u32 buffer_info[]; }; struct hfi_session_release_resources_pkt { From patchwork Tue Jun 18 13:37:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 805333 Received: from mail-ua1-f54.google.com (mail-ua1-f54.google.com [209.85.222.54]) (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 2071916B385 for ; Tue, 18 Jun 2024 13:37:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717877; cv=none; b=G4Mv2fRN83ZRYaSDAQmxrDIcTRzDrwCE4uCoJ20B24CDkbbcKPT4Viu7yl2XANmvNCPcJ4gGfo9m+cYG4qNcxm7SsiUKbAPbvI4k1wPSY2axgijKGJMb7pkf1h1M2ODtdMpD5smAHyR1rpedyp6dJ469FaG9D3DxtMGGy+rPaTc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717877; c=relaxed/simple; bh=Kx34urW1bu83x+FpRH2PjWtCHfI81fNXdP9esvIj2lg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NF338OHjeISWKy6xRXyVcwscuJYXUsFHothut4hjqkfFggSDzs9bEICQqAmzQ4+5K4FK8FBqNupcM+mdoQSYmnzima2+fnaUPAc2jnOoYocOgEsj04lmASp+oYdKStLwerW9ZJthokbRUUScZGK9QPuvyCzwaoERJ1JEIba92YY= 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=ED+Mf5PM; arc=none smtp.client-ip=209.85.222.54 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="ED+Mf5PM" Received: by mail-ua1-f54.google.com with SMTP id a1e0cc1a2514c-80acfd81899so1428276241.1 for ; Tue, 18 Jun 2024 06:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718717875; x=1719322675; 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=uSxpnRMMBh3XAQOKvAUYOjxDrEUAAE5bMiw0Qh3Ul94=; b=ED+Mf5PMUM9of7URCeAn7RNQyecPKy1WZT9ZXXKfINjlYKnJS4TTjPujbIoucX9y9v rIkowdH+aHrbVgCph+ZcuOjYR8l6lU8OIhUB0z1AGCe1G3zqPXcP+oeIdo8n8pOHUUJ1 5lmFQ6fRFXcnZEKnN2BqIsojaiULo27kjpej8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718717875; x=1719322675; 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=uSxpnRMMBh3XAQOKvAUYOjxDrEUAAE5bMiw0Qh3Ul94=; b=uwZon5Dmj7WTChegCXwi53uMbqO5MznEzRyn6OkmfMIGEIF0d7W7GM0lVpdF5z23qw d2Ueumag6pzpWCjQvmUQJuTyNPimEC3AnuA855h4Zb9y2uymbUkI5aITIDLHIeBOtXo2 ZRktaP7yHhhYIRVuPABq+1bI35ok1cLP88fHs6BheMyJJNn7n3zsxRhLdUlJ22KmiQ8l BAk6f5iPY1KprzVKaL+fmXwmn8wkuVofYpslLY0doX+5MsH2jfE3VHvXM3z3OcY5jUua nxdJCo3UD0hF4ybO1Eei+25MeiJ4G987cFLKfQhurgYa0JCNbsxrxTMm4JxAs7YtyHm9 2h5w== X-Forwarded-Encrypted: i=1; AJvYcCUJmmhGSLhxvqPBiPMCPpjsM9QbULKpNj97ApZVtKNzHYiibtKf5ATamPIUAWm2OrzS95+VkA+iCtk8PdJWXYdyax8Xve96TQlm9/wKww== X-Gm-Message-State: AOJu0Yw1fSwHrmNzwKV/N1hxTxdK5g02tS1m+lj6GmjaA15hqWcsdRFT J2lbu+dpLtRWvfSN0jSEkNfN4qojwfbE/mulnkMWMd4mbOUlbsQp1u30ZqMlvw== X-Google-Smtp-Source: AGHT+IHAODVjmf2y7hxDr47vyEGKr+vtIgOCrnudAO3YuibggEVox0Hp/ospxqFRpHhKmeRWGN0DcQ== X-Received: by 2002:a05:6122:c97:b0:4d3:cff6:79f0 with SMTP id 71dfb90a1353d-4ee3e9808e5mr12164963e0c.4.1718717874707; Tue, 18 Jun 2024 06:37:54 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798abc06e93sm521666385a.82.2024.06.18.06.37.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 06:37:54 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 18 Jun 2024 13:37:47 +0000 Subject: [PATCH v5 04/10] 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: <20240618-cocci-flexarray-v5-4-6a8294942f48@chromium.org> References: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> In-Reply-To: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> To: Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 The struct hfi_session_get_property_pkt is always used to fetch 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 Acked-by: Vikash Garodia Signed-off-by: Ricardo Ribalda --- 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 Tue Jun 18 13:37:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 805332 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AF0616B3B8 for ; Tue, 18 Jun 2024 13:37:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717879; cv=none; b=GQB4gE/GUC+XH/wHC36CpUrgLbaLfQjA9ReOolmIA0Ia9OTlaOcOMJUSNUsKQ3YISfOV7u1AtaKfS95Ap7tZ99g/B7lpHND5cqhBXm7MNpmuIbAh8vRpDub1b+4Jm63fmRZj7E1ele8Qa3kLB/Fi5vUzegqceu0aV+Wgq1f9lY4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717879; c=relaxed/simple; bh=iELnSY5gu3MPwTWIlT31gap3UcK/8g4Z6s90Q+ubKso=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=inzA2JKK/MEcILW4JhTzzLOYIEwA8Ocx0ofauaDlKOmsimXwVq/RgcUGzuxMY9VsJyT8B/RcBU4AX/M4gusCDdgqusP9guXTND/XrdGCpDhehJwFSUL3MAqFmjCDeigemxEsg1s0AcULVT3Pq2VUZ0OvSri6TTvXUcKh/ynnkvU= 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=SFXobsN7; arc=none smtp.client-ip=209.85.222.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="SFXobsN7" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-797fb0b4832so269354785a.0 for ; Tue, 18 Jun 2024 06:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718717876; x=1719322676; 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=MW9bvh2bp76Of1yyIbqQelf17GV+Jkv7epwXCqKgstg=; b=SFXobsN7Y6qcPfXteidGdyqryJ6i8m4cGzKjTwpBzq723v/hKxWvLJVMJXsvJ/NfY/ Rks9t35kGa4vZhavMRJK7XsX2Unhz6aiZigj1eoiowFBgs4t44czVOlB+IFfZslA1CtK 7VHHA+tKaSB68PEB5xEUwFVN8nNkYmd9PlAUI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718717876; x=1719322676; 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=MW9bvh2bp76Of1yyIbqQelf17GV+Jkv7epwXCqKgstg=; b=TnFsxnT+ZJHWdVVWDOTj7MewNmTPof23kzXVfUOh2vBmyF0a9Ygt4IBPsq3F0GERL6 rlCjJ4iIbZOSBoaMnF4r0KU+WrmRh0mw7Tfi+0xjBQASgYUxjwqHU6UnheY8gZSODyFa bG0uyqBmBx7YiNcUIGwBoMKfZx/8VoQbU33Z2wHHMzkKwYkv/rcUhjKRGHP1Pk4CcG5h Wi406qFW3tJY535dBzW+k4P3jX67+u1TLGZXkvHV+UnOevaUsuf9atoe8Gq2t+e5LtCG 0HCutM/VlIGyKmBeJrEpaS64IWslTstG0MwK68BbyJG90mjLok+t/cxvYy4Hc+Zhw4A9 dS9A== X-Forwarded-Encrypted: i=1; AJvYcCUlhTsa2P4aD2BZ/jWX29WQyGRT2up6K4RehL7D8zI660uecD0qc/gQy6hSKtffNldd8Cb7Ewob5gJodzBtAlBFG1iZqxMfO3WfyijXew== X-Gm-Message-State: AOJu0Yznp3Ll25t1c4Znm57GhJkmaPQ4SnEskUMv4+R7Qr1J6t/CyjOI rNwZIRTm1u5vhdsw1fcChvzsW+ceaLmsTejVV6ZEvFOi/h/CoLNZ5RC+socIhg== X-Google-Smtp-Source: AGHT+IHUPkEjN1Rk4xvtyWc0bLx9LlZNTQuD6SlnDrxbm7CEFP8MpAyoWDysNL5JPs/xrPrkaHldpg== X-Received: by 2002:a05:620a:2586:b0:797:5765:b844 with SMTP id af79cd13be357-798d242f63bmr1493021685a.37.1718717876400; Tue, 18 Jun 2024 06:37:56 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798abc06e93sm521666385a.82.2024.06.18.06.37.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 06:37:55 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 18 Jun 2024 13:37:49 +0000 Subject: [PATCH v5 06/10] 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: <20240618-cocci-flexarray-v5-6-6a8294942f48@chromium.org> References: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> In-Reply-To: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> To: Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 The single element array data[1] is never used. Replace it with 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) Acked-by: Vikash Garodia Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 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 Tue Jun 18 13:37: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: 805331 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.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 0368416CD32 for ; Tue, 18 Jun 2024 13:37:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717880; cv=none; b=sCul+fsnIOPkatM2cjEAOa6iArlgLchVE44Sz8aqrBOweMb1F1Du0uZSiYg/dEeyQnP6LrwQIcpRaO2iw8SWjIb0YmqQQHQF4mPn9MmDN1iGNSi9mRdaVm1vp4FQwYktYIt7t0wbun/UGNMUF3dJWnA/szJ6ayjMy2zqqK5+qMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717880; c=relaxed/simple; bh=LrbREgccmp+ApJP/aOqmOoRz76Y1lEsELda3PHy44H0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DvYGotiFuxhASzj8uloiw2grcKizOnvyTIzJffTO5Dy+PmEPtFcO0DuzhF+F4oufP+mTIgm5X7JPkwPNDw2ojGtiND+v+XUvKkNbNZmmNOQVo284cX3IsD+EtPVI5I394iQvh0M80of5WR7cr9MxlBPPVyfYxZQb8V6pJDCaGXk= 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=Vhcezod9; arc=none smtp.client-ip=209.85.222.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="Vhcezod9" Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-7955841fddaso443956085a.1 for ; Tue, 18 Jun 2024 06:37:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718717878; x=1719322678; 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=yg6dOdrePmQkedMibhUOvsYt1qJByOG1v6bUXQRrIc0=; b=Vhcezod9bTjHhu5dqi2/RMzSrpi/ALRIrD13HlMTNDime5k71fOYHpXqTA0EAzSTOF ibk6ZrbAFsxebknblBSyrY8gFdd8P+sBG7eAkQEU1IySvLTS8osLtrxzors5DvQwtf3o 3XUgD72NIfh8x5K1dQ4L+Br3iGldTXf0z4HmI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718717878; x=1719322678; 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=yg6dOdrePmQkedMibhUOvsYt1qJByOG1v6bUXQRrIc0=; b=a6cWmPJsxs6mpx+2RLg0ZJJDosCUZfBIjqS5daebWsSt1I1di9tZj1zTDzkbqqYt5f h/oKBYPH6PqQV4LVoIvRawAE1fWZH21o24cISJLK4/meV0v6/nAsPxL3JMBkE1n59KRg pEtABfgqO7TRAm+e8kuCiSYeTqHq8c/KviOkL1BvbxPdcYu6IEoRCaWjrS9A/QWXsU7j xL/iUQd+dYaeU6K5wddU8YTPbXGP3g5pfNk8oZ1BYr2JWunG2Ur4RyQQuJijJ22U4YuK 5PgVcy/ImRphqsIs1Cl+jwnI0pGin2PrFh/3prHggtPYbpRaaHRdEiic3SfxZOQs/6Pp tR0g== X-Forwarded-Encrypted: i=1; AJvYcCV7CHApfrD9CwBQJ0+oVwLhxLSQ9aGdn4rEw4ROOGSZP0vbxvHvnwCTC3ERVtSGd8Uj+OFcWJ031PLtODFTUEBNLg9XW5M0An8f8hQaaQ== X-Gm-Message-State: AOJu0YzTvHkIQTGGcmhqePcAsnk/NLtF2LRddAzjvZxvStP4AfXTU4PV +Wq/nPN433TyuFfV8hdvpyYx5u7zPC5RlRhRWHjqenudATUXEdlQN1UPWLRNug== X-Google-Smtp-Source: AGHT+IGAgj3YnsFss9qEjXgsxLbOwfO0PDliSTE4TcCbevE5n9KjJc7F+p+/GujvK9mbnLR+t5wqXQ== X-Received: by 2002:a05:620a:4308:b0:798:5598:bdff with SMTP id af79cd13be357-79ba75e14e3mr450019785a.0.1718717878028; Tue, 18 Jun 2024 06:37:58 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798abc06e93sm521666385a.82.2024.06.18.06.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 06:37:57 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 18 Jun 2024 13:37:51 +0000 Subject: [PATCH v5 08/10] 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: <20240618-cocci-flexarray-v5-8-6a8294942f48@chromium.org> References: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> In-Reply-To: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> To: Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 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) Acked-by: Vikash Garodia Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_cmds.c | 2 +- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 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 Tue Jun 18 13:37: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: 805330 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 E382316EB50 for ; Tue, 18 Jun 2024 13:38: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=1718717882; cv=none; b=fCjx7XjLzRX/C74pVr3kb2n2pz8ur4oL/CJV0QepZ3wh94W+ePkZdtakRLmrdSilQ8Qy3RUJV3PDwComnyUp6mKoziScojlBz6NGZQ79ZMMvpmCwRaLE1QZ8CfsnF4Py0Iw1LuUFnHI/XF5wSrTvGg18KcUw9Cc81sTQDFJZMEA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717882; c=relaxed/simple; bh=n7rLzzBBfHOdiSuzszfNn/euo2ePzTmy1Jk7b4uNXQ0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=shk7/ffjzjNfuclSUngJCDKi1n38vdOwotrgCdc8PilFZb/hcbfmYx4xzV7j1Rl6R+XnrHNUTW0knowcscmNIHdJLD+U7xW/ZrujlF1e6LIlSt+4OnteJmfotmPYwlMZOQRRRBorZeT+t7TgRTl3ImMY9Gmg3I32M7+kVpA3jy0= 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=Mq2qWFNO; 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="Mq2qWFNO" Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-3d23db75f5cso3229407b6e.0 for ; Tue, 18 Jun 2024 06:38:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718717880; x=1719322680; 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=C/eq9KiqE9DhkH+J1pTk62wzUPV+ZFcAncSfE/zn07s=; b=Mq2qWFNOBV+XDeAiig97C0zvDRN7YUgzl+hkOr7jX2lwSGymaMVphRHukfuOOz4hOm 7YClKFW/3PC7hqu+w62Nm2x/19MXN1ZSVwccH1zxJBN1ExGPIDwT59VEPTzPAxInObJP XZ+J/6lbiBavT9y4A7fwHp+q0rnrXF3FbRx8s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718717880; x=1719322680; 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=C/eq9KiqE9DhkH+J1pTk62wzUPV+ZFcAncSfE/zn07s=; b=u4swmG7ZN0d0xnQsirUn/TWXLW1fqiF7ynaHi8lZnUXnq6TJATQVCsJaaTKuyFjqK9 cP4yWeosbRmxmte50AGY6krfCwxdx563Ulurukp3pS0mNQBfllDa8SoDWkPBZoImZW6w z65qrkfG1Dx5AG+nLArj1Tl2PEZBLdxa2Vb5mahKBqyybrxMhU3+uO+268BB0Hk6OE4L qZvppwufuqjBa/fe+r55bROVQ1s/wCVn6Mafqx/OJa4HYlQrEVL4SAMXEY1/7RwA2mCX DzvDdI14ObxnMxaPj9Pb4YIWF6k6v+8G78EyT7ujU/QVEZibXA5cvtR/DvTqjTUBjzOD IyOw== X-Forwarded-Encrypted: i=1; AJvYcCVAzV3bHAhRKYsBFaEu6uKQpxpu3rvogQwwd+gz2c6YaoRiWqN4ieTi30mx2bMrDihNSDVzHl6zpTWn6UOvOHfMDGoTfCHwgW6c+20yTA== X-Gm-Message-State: AOJu0Yy8xKe5XA37c94P9/PaGjWM1Ng+Qhk2xXbV1LeM665PK0+747Vk IvoDZJZgARyf0sbMHO1TzwQFbFb7/665CpojOtptL2tIcXpUfzGcyZBzqsqKRg== X-Google-Smtp-Source: AGHT+IHK+MUXA9aHTIKx+La/+tL6XuNAxNsBHd2w0eK2r23/Txk8tr8Eu/lANB+LjBHcJGZuZjo8hg== X-Received: by 2002:a05:6808:1520:b0:3d2:2356:d273 with SMTP id 5614622812f47-3d24e8a9973mr15936428b6e.6.1718717880067; Tue, 18 Jun 2024 06:38:00 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798abc06e93sm521666385a.82.2024.06.18.06.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 06:37:59 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 18 Jun 2024 13:37:53 +0000 Subject: [PATCH v5 10/10] 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: <20240618-cocci-flexarray-v5-10-6a8294942f48@chromium.org> References: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> In-Reply-To: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> To: Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 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) Acked-by: Vikash Garodia Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index 6202dcfc467a..242a3ba94555 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1223,7 +1223,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 {