From patchwork Tue Aug 13 12:31:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13761956 Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.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 EB8E7199397 for ; Tue, 13 Aug 2024 12:31:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552290; cv=none; b=Amx79bhvU21yPUnDkBytOuYM4ZqJvWKj7ExTx4GFKLy0J3/MBEggAsTomzxQ+qUZAquwQ7w9TqzcU8VvbG4RYQXIVu8W0KD5UMxteeKJ1woE0O5mAa1iuY2XKFlCgqcyF6fpAWvJ/xZA3Lxoj4E9O1grNI/KcVxL7AJQYC6mpwA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552290; c=relaxed/simple; bh=2hjYCqULrObPbnZbgHzv3uAJ+2uRB9aIgS9bUw6j1Ak=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lIZDUzk83Uxe5S8t7AuHvf7gwrJbM7L4w6J9A0ojSRIEihuceLfX6fU9/X+jrW6P4xdFhawdZzNvgUO9eBZPb/4AsMzvWgXG2WCv8HgbzS9YvXAfm3akoyLkDkRRrMRk6FI4VHEJ16Fsmc93FR9aSkjmwCqgcL6gp0DqcCfucjY= 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=eQ9EUiEo; arc=none smtp.client-ip=209.85.210.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="eQ9EUiEo" Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-70949118d26so4080349a34.0 for ; Tue, 13 Aug 2024 05:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723552287; x=1724157087; 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=T26HDWEax3Ht99GbJ/5oCiq/G1VLMfwUsOvAjWX6wxI=; b=eQ9EUiEoqF3JNSQxYYIv66MNO57vkb+5MRLgZSN4y4G1SLVjTrsHwVyoQYoJ8dyg12 5eFOKO+bEu4yPkWbCmjhcI1gaQem3uekT/5Pq0ZX58qUBDMCRIvBIn+keFdXIUmmMQG4 eBinKE0Yahqbp8bUI9IhD9u66dRG2u2z6/1yM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723552287; x=1724157087; 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=T26HDWEax3Ht99GbJ/5oCiq/G1VLMfwUsOvAjWX6wxI=; b=rCAcBij4xktSAFU51LqNodyqkB9tuGHGJ+YU9JgED8riVdhDL2jiOl2ZH11kq67Aes mcmaODGBO+zDP5RicQ8GJbMtZhN1t6uhumEDZ5OXfjkxrDMhNffnapHj+MvW+zyT92sY AJSotm6MHGBHev1dljF1c+O7oTo5b1ACFqN896xWzPfcuW0cdWYlC/ZylGUB+xgWYoRm 5oAW2dav9Jx42f3nNZgDw6xqJfdmFzzvbijlr+XLxzWjqMBUuybw+gGT+A13m+8wutUV PyF6tIsbNzWM5QZxs9wWKPudNrI+jtug109nrUpTQI+MPg0JskwF4ZZBQOfE+M8NbwBy EUkg== X-Forwarded-Encrypted: i=1; AJvYcCVuodOho+284c69EY5FO0kgGarRjFzlFgEDx4CX0vZR4FQSVviLPM8EHg47n1YnHWfpv6ACHhyrbvKJrjf0qIlvyV5LUmv3A79YMlc= X-Gm-Message-State: AOJu0Yx8CDuobkDxF3VErlS5uMbRjQeo/WnuJ8o6RYEOCwA5Wi0T5uON EshpIIkgE2JKfJOa4h1sQTXz/GVjj6qvbg6M2e7jAJ8TkK//vpLVNIxwDqQeRQ== X-Google-Smtp-Source: AGHT+IEt8IEr4mOSgyEydVS86tXDc+nflK2P9LtnkTrXNE23dIpoewktVCky3idoeTnXKhksyaliGw== X-Received: by 2002:a05:6358:4287:b0:1a5:dca5:a902 with SMTP id e5c5f4694b2df-1b19d2d037amr358929755d.17.1723552287107; Tue, 13 Aug 2024 05:31:27 -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-7a4c7d66093sm337126685a.12.2024.08.13.05.31.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 05:31:26 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 13 Aug 2024 12:31:21 +0000 Subject: [PATCH v6 01/10] media: venus: Use flex array for hfi_session_release_buffer_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240813-cocci-flexarray-v6-1-de903fd8d988@chromium.org> References: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> In-Reply-To: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@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 20acd412ee7b..42825f07939d 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -227,7 +227,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 Aug 13 12:31:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13761957 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C0BA186E33 for ; Tue, 13 Aug 2024 12:31:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552290; cv=none; b=ULNa6LBoHHw6OFTTQTAh15cey5lBMGn/U/ulguhecsizP5lwY2e9J0U/EBBTJOHFChaNQLGyJf2MUAp2xpPqMDmT2WB+wtlYsUwVr4aM0PwJl76jziFClJy+7yjH3+z1siTtnwDTSDF83hqurbG90IMPdUdVN2HT4jy/mVMl9NM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552290; c=relaxed/simple; bh=jhEUxn/pes1s4feDivojryv2JX3XefUWasZTSaw7ezk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dlY2dfSfB3Gx9Cad04ZSp3jdYgTUYDVTzzAaVPS2hX1C3V5ojFuU0Dywxv86bv0a45O0AFDeqH622p4+uBYV3Js4GocaeEFLsTkXFv1BhWmx3pFHCPdU7OJkrtSksOi4TaeONSHH9Ye6wXrZN/Bw+lju8dEUFZJgADPWtPzvlW4= 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=BcYGVssX; arc=none smtp.client-ip=209.85.222.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="BcYGVssX" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-7a3375015f8so378244885a.1 for ; Tue, 13 Aug 2024 05:31:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723552288; x=1724157088; 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=kIXlD3Ol1LtfkD9H1UrkUWGH9uBnFxqi4VyzSloENMQ=; b=BcYGVssXRm6etUVCMvxxXrRbwwLiXtbPeHpTPHJWaPNuvma1TarNsFEv/X2KjlEhFP WXfhgTVD6UtXJmPX6+VoWHL7OsTufmBXvraPCsoNYIm2nyBniNhg+f8Mpm/6Wmq8zw1Y nCEusZPDmIjW4Sq/foIol6TUkhg1sGLbGucnY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723552288; x=1724157088; 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=kIXlD3Ol1LtfkD9H1UrkUWGH9uBnFxqi4VyzSloENMQ=; b=QV8VUFIXn6bX/kVQYExVheIXWSuD5V+HsLu3X4nU7jl3esQdF2cluSESADAIO9vEwm 7id99AgJils6nT6TqDq44daJw+j4A4lbfrsHuEyQGuVIhMmcxIwS0yoPo7osIQVg4eCc fPFzWLiKm3VubpWvyqBKcbwkdkXPtVX/M7Wmy4ZGDwUuiWv01Bjad1Hr21TplLw8CMvJ 7h+X/9brhidRFpDlhNkf7QcSIafCv1XHEmc5PQU+LtJJuCEngMzPWsaBb90MCYTthLSf PRcej9BQcgaTiqZQfMWnKxXx9M//UPQhmlfZqK7n8VCPC0jlnDNu8hxactqaVilgVSiZ XQyg== X-Forwarded-Encrypted: i=1; AJvYcCWfSuAnP//8dI6pTgSJCm+mtrJgxZ/zPgZSWChBtYxvBkS4RYlKSy3rJHviCLnUvuCrbUI8s7MNI19LdVEYCYOjvjkM9pTEPP0mT68= X-Gm-Message-State: AOJu0Yy83Wa/fAYa5gUqONZDfs66lFguoBiLFqMus4MFymLmXi2M9P6F GM4Y/jrds8SB7RFgwt9hQA5ySiL4bHZrq9PM8XJc2/KkCAFgFgcw0bUwZho8/g== X-Google-Smtp-Source: AGHT+IE2xmMkDbsMy07f7CYEHgKUTqwYARJxNMOEOo1+wr1sMyllp6Sk+ESICy3o68XiwLOXgbyOlw== X-Received: by 2002:a05:620a:40d0:b0:7a2:275:4841 with SMTP id af79cd13be357-7a4e15ab32bmr328777585a.34.1723552288115; Tue, 13 Aug 2024 05:31:28 -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-7a4c7d66093sm337126685a.12.2024.08.13.05.31.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 05:31:27 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 13 Aug 2024 12:31:22 +0000 Subject: [PATCH v6 02/10] media: venus: Refactor struct hfi_uncompressed_plane_info Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240813-cocci-flexarray-v6-2-de903fd8d988@chromium.org> References: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> In-Reply-To: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 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) Reviewed-by: Bryan O'Donoghue 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 e4c05d62cfc7..5e91f3f6984d 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1005,7 +1005,7 @@ struct hfi_uncompressed_plane_constraints { struct hfi_uncompressed_plane_info { u32 format; u32 num_planes; - struct hfi_uncompressed_plane_constraints plane_constraints[1]; + struct hfi_uncompressed_plane_constraints plane_constraints; }; struct hfi_uncompressed_format_supported { From patchwork Tue Aug 13 12:31:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13761959 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 7F610199EAC for ; Tue, 13 Aug 2024 12:31:30 +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=1723552293; cv=none; b=QYNCYC/mtV4HbMj4ZbJfs7xTcLBZkZDt7AK7l70QcaJbF/hMGeRVWZ5G3uYVY4g3st9DMgG/oaggxG15rsNmzoHPwhmEEO8d22GZl5DOKU+zVb+7SzhjRKPQwTlnT1wa2k+DLSxkeJdmrUBGpkzYaV4QfpylXCCki8ncscgcpVc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552293; c=relaxed/simple; bh=ZL1NQsUr+liQywEoPKyXYweeFBwJ9jb0tSJpH+9ycBc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=he5jeQw9TzbAHumhqqbF8IF8+hIJr7D6yWSLu2tK/wkE7wdFy89TpyhMTaGT7PMsayB8oBlu6inxdJFdc5Z2F5Z8PbdX7r/o7Zc7rt5Ev9JERbG3vO/tZqO+UgPln/XPTBmazvUzfbzVC8XsUGzFtHb/0CWhSD9L7treMeOIGLw= 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=QMn15TvD; 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="QMn15TvD" Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-6b95b710e2cso34936226d6.2 for ; Tue, 13 Aug 2024 05:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723552289; x=1724157089; 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=SPUEi7uFjzY/rlu/HW/qtzhNgJ8EHrsVhU1gvPc5vvQ=; b=QMn15TvDv7mlw3QTOAGW/Y5rko3pr7VharwKEr86efGIgyVGIOIi++LbfDZTDGW2IX hYsKDB/xGqqZ48QJRuxU3dhXT3iBbSM6zNyYL/P/LGlxHkYh6elIGHo8EIEH+zPDnCZR 6KKC5Z24qfC5SuEqTDuPkcjKlljfWQidAdaxw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723552289; x=1724157089; 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=SPUEi7uFjzY/rlu/HW/qtzhNgJ8EHrsVhU1gvPc5vvQ=; b=iKv2C5x7R0v1LtYaZBwAgaBK1CxJ9qb3ZSkGn2nwEHkuOF/tqMcyYg3TGQZo3tQgXF nDbDe/eEyjruhncDf3KVAaAuIZpbHxVjdNDk3AWyOjdFH5E6X0n1J4+LS7qayF86VejA 0JF79pBTKlqKuQ+pFvEHHX3TLg4b+1piht7PTS28K5dsQzVfitWYSxZyDFvV/dFxpN1G Yas6AE4Xjz9s+JV8ldhS5KHxYiELQb3NFf4ZfbQUCgE3spDDyROKXcUhKUXDqf3sE2YW yCk7sUGTvL7bkxfanX9o+qTozsWuV18cjXVPX86l4e6NQ9hWKVKL9o7C/e5KzL+vTAV3 m+Ew== X-Forwarded-Encrypted: i=1; AJvYcCVh7KCp28r6EfVsqNHKtaEFaBHzJIwV3WMkkJ9LVloJdpkxIS3Nqlf4HUytsyHOvZHXoYfuuKqpwrGOoDPKI6Y5u+Pf2lQE/p/1KwQ= X-Gm-Message-State: AOJu0Yz5v9KTYMqpK39SBSKsljlR8RGbLZ7eymy7drrZvX11Csd2zwIo K2yGBSRA6NL280vD0Flw4YK2+VOuSrTbeINVyhmeXCeI+FGMEKKDy+GG6FaGCg== X-Google-Smtp-Source: AGHT+IHWcYMugnNAohBPlXl4Q5k2szXJLte2T2nQmFxv7LgGGp8+7SOgzgt3nTX3WjhN51/yObzS/g== X-Received: by 2002:a05:620a:3193:b0:7a1:d022:a3ae with SMTP id af79cd13be357-7a4e15b9c43mr381001685a.56.1723552289433; Tue, 13 Aug 2024 05:31:29 -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-7a4c7d66093sm337126685a.12.2024.08.13.05.31.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 05:31:28 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 13 Aug 2024 12:31:23 +0000 Subject: [PATCH v6 03/10] media: venus: Refactor struct hfi_session_get_property_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240813-cocci-flexarray-v6-3-de903fd8d988@chromium.org> References: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> In-Reply-To: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@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 42825f07939d..b158fcd00dd6 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -217,7 +217,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 Aug 13 12:31:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13761958 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EA7619B3D7 for ; Tue, 13 Aug 2024 12:31:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552293; cv=none; b=bvEWHKJfNf2D3t0a7p7LKJP9ok8VxGsV9vtZa/oqspDWCRhwWZ98Wm+oPhiMGBXl3STY+6FK37WVTG1M+mJeKPbMH43WOvyfQzRkCKGvoqwr34W73ZOH97BXJfkwklbW8O1UlzbfnBkuDtq4nerl9U0TW/so3vGoC6nrmRktuUs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552293; c=relaxed/simple; bh=ApVSPxuYMUN4H8lzD4Upg+Z+gSvcQcwbvpLfoIq2hbE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NnyLZUxnVpLrqu5kbZ+zItWNpPIzMC2GERe4CnSmS8udZf0ERGT67byCMND9NYtQMY1/5M5cgjO60jmKo/svJ4WsL883XQMPPU1qXeuFbcqFiLcc2oRl2gzGVTkT5b7UN33PECs+leZNNFsj5dZbGuBwD0mjKkJeLfcZy+G4bIM= 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=SokGhc/P; arc=none smtp.client-ip=209.85.222.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="SokGhc/P" Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-7a1da036d35so342935785a.0 for ; Tue, 13 Aug 2024 05:31:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723552290; x=1724157090; 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=cM75UgAWxu+REaaiYKxkbph00GT0OvjjuSsc322MsKo=; b=SokGhc/PmhWT/xmp4ulSQiLWsZttx4NqY4ECHZNAmK8LDrAEstEq46JWcEXzcc/oTV geaenCuvHw7M69kPnFtLvg6yz0OGiczUWcwHssVWVSvN9upLjQvnG0cMeKAwD9Mi9sAU PzYv8TzTMmE/gG6kGhq6eNshFFk3pg/f9FEFI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723552290; x=1724157090; 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=cM75UgAWxu+REaaiYKxkbph00GT0OvjjuSsc322MsKo=; b=qKGup6+ewT+JN6KdR39QbUiWk91baP9XLWTYzZ07AsjsqDP77vt/0x6s8v3VfGxHQ0 yVRuX1unaEkEUFbIciqzP3iraMHTTeszpqpRMY0Zbj7Vb1N9zIg8JShV/wuqt+X4yKp7 TT6QFK+ytTYXCQWmzi2Y6mGinYoAa8pNu7dNSEsGhSHh8r6YTGhl50gEVQbYwcB4cGUO Fuspyjv8D6+FVAuu71yOZr3raceYVqTK+5xK/OgnHXBfszc1FKE2oBL5Dl0sLMEGRmvP mRZIawy9r5bfV3RXMZ6YahNOvxlMHwpktxQE6UcbZaSTSX9VCiYaj+bxaP8P4NJLr/x+ YGXg== X-Forwarded-Encrypted: i=1; AJvYcCVLLN2aa32X9z+H0aGDOgYIxeCjb4h51MM1JiC/c3nSPeMdrZ0IwKuosrDbADkSa422k4bOm6jbqg887eYAPywN+puts4hj03dPXfY= X-Gm-Message-State: AOJu0Yy9inNACIWKIwvnPEwXQQq/Lggmgk47zWXHJ4/G4Q7MDa/FihY6 UX/TuYUflpY3Ksj51sMzrdUrVHvvN3lV2Oe1fx9TuPRz6gYYNiAWxWEkkYchFQ== X-Google-Smtp-Source: AGHT+IGqUsckyjgQSDiOTZ2qQ5fmPaXoSD45meFlBIHRhS+FYbD9MyabumWybzKK7Lio3WuJ2DBAQA== X-Received: by 2002:a05:620a:371d:b0:79f:1783:4ba5 with SMTP id af79cd13be357-7a4e15102f8mr337731385a.12.1723552290179; Tue, 13 Aug 2024 05:31:30 -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-7a4c7d66093sm337126685a.12.2024.08.13.05.31.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 05:31:29 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 13 Aug 2024 12:31:24 +0000 Subject: [PATCH v6 04/10] media: venus: Refactor struct hfi_uncompressed_format_supported Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240813-cocci-flexarray-v6-4-de903fd8d988@chromium.org> References: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> In-Reply-To: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 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 Acked-by: Vikash Garodia 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 5e91f3f6984d..3edefa4edeb9 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1011,7 +1011,7 @@ struct hfi_uncompressed_plane_info { struct hfi_uncompressed_format_supported { u32 buffer_type; u32 format_entries; - struct hfi_uncompressed_plane_info plane_info[1]; + struct hfi_uncompressed_plane_info plane_info; }; struct hfi_uncompressed_plane_actual { diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c index c43839539d4d..3df241dc3a11 100644 --- a/drivers/media/platform/qcom/venus/hfi_parser.c +++ b/drivers/media/platform/qcom/venus/hfi_parser.c @@ -157,7 +157,7 @@ static void parse_raw_formats(struct venus_core *core, u32 codecs, u32 domain, void *data) { struct hfi_uncompressed_format_supported *fmt = data; - struct hfi_uncompressed_plane_info *pinfo = fmt->plane_info; + struct hfi_uncompressed_plane_info *pinfo = &fmt->plane_info; struct hfi_uncompressed_plane_constraints *constr; struct raw_formats rawfmts[MAX_FMT_ENTRIES] = {}; u32 entries = fmt->format_entries; From patchwork Tue Aug 13 12:31:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13761960 Received: from mail-ua1-f52.google.com (mail-ua1-f52.google.com [209.85.222.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 A2DB619CCE6 for ; Tue, 13 Aug 2024 12:31:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552295; cv=none; b=rvbPfj1+pREWlOBW4X4Ymzacu1asqoJaqX0wj0pwSLLO6MCA88rNBegPUvDQIJ5mMJAVZen6JS/3xReEVaslLghQAIxUU+Vr8tV/NkuRlOaJlQnDKXHCrq/NRIrcJbm9PyHg7kaoCuLojtiuIPtMX2TKV3LDF0vuRHiywQWTVtw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552295; c=relaxed/simple; bh=pg9ToY3eZZPX52hwA+vpBAJrwr/I05JuqPkuqgNqkes=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=H8t3CJanAeEg8L3ajvhxHL25b+Iq/dlMwEsbhzFrGlwklkgcXGf7TaH1ZSvI+l+LyqqstzSEKQfM6LxoHS1p+r19apKhpXDGjlHyaNSxHGg3509XMVYg2f+17aP9NnNo2ePKvnNTT7HQ+AqrjAuNz4/j5oWvBBZnNfvDbg6k2jQ= 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=gPowbZqF; arc=none smtp.client-ip=209.85.222.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="gPowbZqF" Received: by mail-ua1-f52.google.com with SMTP id a1e0cc1a2514c-820f047c4e4so1846567241.0 for ; Tue, 13 Aug 2024 05:31:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723552291; x=1724157091; 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=PD7uAa+iA+SJ/l3ATpDCq2SdEEBJK/PvJJHcjFH/M0o=; b=gPowbZqFUylKRiyV2nH7DSRqKYL6BFDUh9T9YVYglwSFuunFrAh2C36kZCUa++p75D eYVUXrkFu71DRvN3fouKLwqLBgjcqUU+4UB4JYBKZvNFglVUsKVTe+9NgoXHgxbD7wQt oAf+VmN/E9BKBIHqn+W96ZFaOmFuhhNynRDvo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723552291; x=1724157091; 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=PD7uAa+iA+SJ/l3ATpDCq2SdEEBJK/PvJJHcjFH/M0o=; b=ndBwTB3+m/lL0iGYTTxF+o2Rcg0ERe9D5pWAtZYVc8UWuEFmQUc48e9cRiaXfr6IQl WluA/15z9wN9QPngdL2+3+eSCStQpBDmu06A7eYJj+3VzF5NNUEqYByPb0EoELn7SEia b7lLGo+cOH/mNtDZBbfmSY257M2f/9LbTtwFyyX0Muhk8t+sj7/2odGjNajR9+bydkc+ VAq7c0rnZmBnRq7adTivr1Ha64aBGrFpSChZm3KmSVXdHGIhxCknAM1lMeNQz+OKj+/p xceUCOxkTBSUoMDsuxUG+NU0U4GLqUZaB92X+T4zBYSgtQ/WC5bgaamdzYoEUuLlD64w 4gtw== X-Forwarded-Encrypted: i=1; AJvYcCXq3ycA7npsz3RG2kxSTnKizsu/JeMRC0jzY+NWsCVAllYuv3GNjPHMnYgECrjiB1IN3ObZoGRyEtzE9YxgQwY1pyEDSSX5nln7VPY= X-Gm-Message-State: AOJu0Yz8qIn9VWCda6aAoOeMgCP19UYEEd4a1+VbwU3KM3DxzNw8lhoY D0yEjPCaaX6cEaOqSHJCWQLiXLW56GkhZQAsNt72hIDGIyZSY14k5Vm59Qz5cw== X-Google-Smtp-Source: AGHT+IFVb/FCO4zojDS37rQuslFijZLZCXUsY63IfMRU3vxtSFRIIMGWvVO1eWkt+coPhL2FV4eZdw== X-Received: by 2002:a05:6102:370d:b0:494:10af:2bc8 with SMTP id ada2fe7eead31-49743ae9e3bmr3816743137.24.1723552291444; Tue, 13 Aug 2024 05:31:31 -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-7a4c7d66093sm337126685a.12.2024.08.13.05.31.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 05:31:30 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 13 Aug 2024 12:31:25 +0000 Subject: [PATCH v6 05/10] media: venus: Refactor hfi_session_empty_buffer_uncompressed_plane0_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240813-cocci-flexarray-v6-5-de903fd8d988@chromium.org> References: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> In-Reply-To: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@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 b158fcd00dd6..01f5463e0fa2 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -168,7 +168,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_empty_buffer_uncompressed_plane1_pkt { From patchwork Tue Aug 13 12:31:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13761961 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF81419CD16 for ; Tue, 13 Aug 2024 12:31:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552295; cv=none; b=FrDABjnsXEq0EHLlxd90z8l87j3xizLF8QuQ1RWk647xtlGfoY7cTyJ+xG+BOVGUNlsg4RM8RIuVvXscBtYvrofu+rzuYhEawqX2wHVy/zoghvSYyQA7Wv1ZYVGACtqBUPgtctIxfgGnHOUVle/TAfzFjI3E8eoWW8/QFlwo5gI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552295; c=relaxed/simple; bh=p3jpIeza54CehiKa4tgs3b0fLFLZmsQXlmR/9zDU8zE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nPjIe7D0f5MMw0VkVfAcE6cx1fg/jwpupmOexzp+BKtKkwqsLcGtWwssAU1J948C/FExc8EJKeRCqSaOJZ+iaacg6zyHK2Xyt59SaCBx3AvQx1w50cGyzoD1kCuCE6ieaw/uMeo98XQwBWL7xfNZy0sImufCKNn7/0VeySUYkmQ= 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=UHfeUwe2; arc=none smtp.client-ip=209.85.222.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="UHfeUwe2" Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-7a20c529c77so347825585a.1 for ; Tue, 13 Aug 2024 05:31:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723552292; x=1724157092; 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=1m0qOojs5u3nnBaeP4R5XScsxR2jha5TQMuQ4WnxziM=; b=UHfeUwe2A2dMtDJPuyPrPTVy4Bu6anYz8LQqWZgLekZ7s2Nr4WcUj3ZqaywwMSt89/ bF0EENvdn0G8F09DoGdUD3PdX1516wUONSmXYc3k7q++9Midn9Cc1NN3ruV/qtM3VyGB iwID7N/cZG6L13OFUUBaUQOJJwzJyKUvV87Os= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723552292; x=1724157092; 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=1m0qOojs5u3nnBaeP4R5XScsxR2jha5TQMuQ4WnxziM=; b=gqsrAVY4Z/GsKLoc0840IFvs86ebAHJm+nvJQLM5D2kPYoHHoWFvGAYQUoSdAbAN9m 76Jx6Ifi/L1zaY3IOqZIvYqhwDcn8L6wEzPRXwb3tWsBvA0rGXIqPj13a1egLlGL80gN y6TnPVFZc0Xez3zlouwVme2wfJCoaA/GfOKJA49N6gdDM6Bn4HKvYV+5lDLEaqt5ByZq WLEx8HzYyt4HQ+/+FeN9CpcnsgJp7DirbnnQIhJtH/0Vm6QUICo/+BzipQqxZsWOiG67 wK/uu+jaGxK/KGFl7CKMLsBUpB8xMgYaP0gnPPuZJnmbWaKMlkrcT3Q3t68Cwa2Pt1w0 YzZA== X-Forwarded-Encrypted: i=1; AJvYcCUuyJa2v8sAbDQXePgVVnZY9Uj1MZqA5TZA33vPgKGizo863SvBjNP5b4Xmuzit4x3KS1DP+gJhvl1WsuQIwPqzP2Htkn1wmPOHY/Q= X-Gm-Message-State: AOJu0Yzlp3Xr8nG1dNUtoolmlWj2h1U8V1HxWz3QMqLnCcogYmhvKN4R 0X7y5jroa4pwA1OGbO0hd6XwH1sJ1onCGlsn7bcBkGqmN55qM/b1YQgpbhSmRQ== X-Google-Smtp-Source: AGHT+IENk8SpFwKWQLaKLf4cUuMptIr4tn+mOT99jzPw9kpr9RZ5Z+jGj/wE6VKPl37qKt0dMKu46w== X-Received: by 2002:a05:620a:2450:b0:79d:5b21:804a with SMTP id af79cd13be357-7a4e1500decmr422156385a.14.1723552292603; Tue, 13 Aug 2024 05:31:32 -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-7a4c7d66093sm337126685a.12.2024.08.13.05.31.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 05:31:31 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 13 Aug 2024 12:31:26 +0000 Subject: [PATCH v6 06/10] media: venus: Refactor hfi_session_empty_buffer_compressed_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240813-cocci-flexarray-v6-6-de903fd8d988@chromium.org> References: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> In-Reply-To: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@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 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) 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 01f5463e0fa2..de0bf2399505 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -151,7 +151,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 Tue Aug 13 12:31:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13761962 Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.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 78EAC199EB4 for ; Tue, 13 Aug 2024 12:31:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552296; cv=none; b=fGoLiyYYEp7CMnimkcqiHm/4uljukV50BGLDejps2dCE1E56r+GWRwq7GTZ5npZIY/rp+EfbXH7e4NU9fxCvjaKbOnNQnbCBu9WkzykYlLdqp01DvUl0Rs6+sy5V/Z9UgUz5JPcVh6hoi2uibRXf3L0ZqCy5LZlXXxm/sMP8aHA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552296; c=relaxed/simple; bh=XHYQDkjDMyOGGgCU6Mjf54/QzhOW3tNUgMmebpG++2I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E6vjlRlTlJ161gBZmC8l80Amok5B1AhSV6zzzh5L8Sr9+HSLb+2rrKwY1iLM3MXdAmQtAO+wn5ZW1cvX6n1W74oTw8dFS8Qpi6NnTKYOdd/DtvE+gttPSIfzoz7H4m4OpmbUGUVlfRSfG2INvbRQT2UQirO0yRtmbbLoo6zUA6E= 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=Jq50SsSY; arc=none smtp.client-ip=209.85.210.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="Jq50SsSY" Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-70943713472so2156335a34.2 for ; Tue, 13 Aug 2024 05:31:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723552293; x=1724157093; 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=SmP2dlTbOpENrA/D3hKhfvN/jpkEsPn3dnXsTIK3Biw=; b=Jq50SsSY8fa1/W9DkR/dV5z1KQFHvz+1g65BkRr2PJYs82rMVI+RsCoDghiKBXDfiq Chb6QzfUTi6Jgi3AkLGRISnXeA4Ho4tyNKNdGrj8YYfFjrWqEfYEKEkCo0J2uOG0a24f AMtOqX7ZG1eYU60hBuOiz63JsiO0OlS3wWr9k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723552293; x=1724157093; 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=SmP2dlTbOpENrA/D3hKhfvN/jpkEsPn3dnXsTIK3Biw=; b=vvDgT+mjptpHi14zNoyiq7iaOHlNxNQkngVxAbgmHp0s2oIjvI8FQxeVybB/JrgO3N LdFIOtD236wzkKXzCMeX4sOYQOeOejJzSvybtAB3zkU0N1YlYiWCgsGwqHK0Hi3vPvFd abMELvMvO2AP1KsOP7TqXsBXjjF2+mmNB5EHUxFlc9OyxXxDmd4yLz+7fRRwe0AgK2XP 0xwnDKqmT2HDg3qvEoKtjNzYcQnzsMVsFYSHhd9IJNaVuSuKDYT3wEx4m5qy170s3Pis i7qnDIXoawlaWvMn7SvKKxqUGNz4WvEx0EUL35b/KNERWzzpNR3DVi/+Goldl9vIAk2U NbQA== X-Forwarded-Encrypted: i=1; AJvYcCVQyWPbVWziMrTOhMXb0zlmqPhma24UOJBGHFsVRofWh9B82Hw+nXmk1IL29j8FX0NNZsoRp8U1eWkYztPLln+9zO7bpXmSfJ+0LWQ= X-Gm-Message-State: AOJu0YybqT1I5XeBD3cRbMEqWR78eOha2HHm69Twjqavi3E+VRrVB/LO /rcneQJcQGU5lTM9n8OF0e8aBVVthkDC+dTGsdZWoRbziobiK7OUCTTxsW4z1g== X-Google-Smtp-Source: AGHT+IFUP1qwWY0UlEZOY+1Y9HfO9zE5pmTE6knRdTsVmzNpByhzpAcfuYpMMEA+syDSvg8RTIVLSQ== X-Received: by 2002:a05:6359:5a8d:b0:1aa:d5c8:ec94 with SMTP id e5c5f4694b2df-1b19d2f4aecmr435584955d.26.1723552293448; Tue, 13 Aug 2024 05:31:33 -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-7a4c7d66093sm337126685a.12.2024.08.13.05.31.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 05:31:32 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 13 Aug 2024 12:31:27 +0000 Subject: [PATCH v6 07/10] media: venus: Refactor hfi_sys_get_property_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240813-cocci-flexarray-v6-7-de903fd8d988@chromium.org> References: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> In-Reply-To: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@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 de0bf2399505..615ac8d156a5 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_set_buffers_pkt { From patchwork Tue Aug 13 12:31:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13761963 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 CB06119D09F for ; Tue, 13 Aug 2024 12:31:35 +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=1723552297; cv=none; b=ca1oyLHbI65/6IloSp7m+jph+ee+nnMIobTHOPoGLBt00mnDsLzuXLkR21dkXDCrYYkQxQ+70NU0UR86BAHCf2yl7l7GAd2vTBIZb+gDsApjJre815Pm4bL5jwjeUWxJfkEi2bQdiq4jklZ02Mt+TSoWTBK1cCujD0jhIZWem9s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552297; c=relaxed/simple; bh=KWjKLHgDnVqj5qogv7pkiKcxHSFjMmLdRbW4n/wiXWQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NcOGFBGjsEIZivILAFVPs3UWSi1rsPHa2y5cpmOCG42iXOYgqCPN1jey3mvgYzWJ95ggtB7gIHdnUqHvVW/Q6qF3qod0DyWx9EFBSJWp61T6/rcO5hUKNs4zvQ6m5AVTOZQQ+sg58etkpqss3tMg1VK/0HkUS38h8pE/LCgDIMw= 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=Q8wI0bX5; 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="Q8wI0bX5" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-7a1df0a9281so342916685a.1 for ; Tue, 13 Aug 2024 05:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723552295; x=1724157095; 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=gCqo6e1jk+3zjFaKrik7m1Dhac+Vev7BPrVsdbvmhKg=; b=Q8wI0bX5l+W0rWrd3rq70xPMWjCBOlA/3lk2hyDcEa4JLF1d2BO2DO6qegmbdPH2Tt AedDy5JAdRU8RaQLOJq6bRTGqXzgnWO+Q39w7w1pBxsABfyHU+yozJ5MEmOFxnHBrsVe kgvH4jhSB+PrF0Ujvj7AfmhAX2QFK3bHkcXPU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723552295; x=1724157095; 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=gCqo6e1jk+3zjFaKrik7m1Dhac+Vev7BPrVsdbvmhKg=; b=EHFKQRi/R65fSp5SQh0VRZJyyoHnTDALQsuI7jyuim3GrXJkTIrt8OIcJY/TH8iuXm TaY0DEIqe0tDZJKY+fnveZCR87e8UB2W4NLIGSidCHfbw+a9+zUtsl0vWfgB4x3fPej5 NJFTYxbIvtYp426KkGLKzxpSafz+WG1xFsQ5mpKi0v96uQNEtJyDGoTVis53qq00TDZe 1jMs2OhPFnw+DCokttXA8g/43nABKbDB5eWNyzNixVx6M2MlVAJEh7gT5yveJw7WJkbK ri/Xrx6FYKE+BlBbMw3sBJ/vKHwPUfJVsaD0H25XAmZZYmqIiUh1E6BpUNBKrV7Z/kUb Xh0g== X-Forwarded-Encrypted: i=1; AJvYcCVN9mPvXaH+qwpy9qAmcIxZaGw2VOAK2v7Fzo0XGFl54f1GFu70QW1XW+14teJm0EGSIAPaSjhBDlcVNqkWEcqb2Mc8LmYYJ0hotK8= X-Gm-Message-State: AOJu0Ywb2t2PAp8NdTOi+FP0JML0zAOELPYusy76TWCavciJt0aPyZJ0 aQ1YHB8kdWtYWNQsSb6qsFszMFtPOyi1wqfV+fZrSjPCSxIYHkQRuJBsKRea2hqD2eLoZwC0u58 = X-Google-Smtp-Source: AGHT+IFSZcI2vQpbzSHhDMPF2LKB1Vu/we5Q43H8Pa5hdUliwBEvSfJGRA02XPjhL1KbnCoICuSCOA== X-Received: by 2002:a05:620a:2943:b0:79f:18e5:f730 with SMTP id af79cd13be357-7a4e152c430mr331382385a.28.1723552294730; Tue, 13 Aug 2024 05:31:34 -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-7a4c7d66093sm337126685a.12.2024.08.13.05.31.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 05:31:33 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 13 Aug 2024 12:31:28 +0000 Subject: [PATCH v6 08/10] media: venus: Refactor hfi_session_fill_buffer_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240813-cocci-flexarray-v6-8-de903fd8d988@chromium.org> References: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> In-Reply-To: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 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 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 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 615ac8d156a5..63b93a34f609 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -198,7 +198,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 Tue Aug 13 12:31:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13761964 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4BCC19D8B4 for ; Tue, 13 Aug 2024 12:31:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552298; cv=none; b=f/OBl9hKYm9XPkrTkwTOsgi0bdQFv5ixxyssLP1vNEf8S3Se2B8NIja2WpfIHlbC7rb8Yzs8ceVkBj5ND+Dow5LBstmExmQsxF6omRM0aO9j3F3eTURGoMb8Wy9+8gbZJPwKUvOO7f9At9p/JPj4R7mvWyF+ALnuYaSfixuBc6w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552298; c=relaxed/simple; bh=2G5axLdjt8/znqK8sczk5VikDq1NXPTZO4Dwxvg8Dbw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Kc8MD92s3qneyGSBvJa2M3WHknXEGGfOnDrOZeZbdfIW0T2ZiKkwQuEmwEQSw6Sfxes9wm4kHWGGpPP525odvvvOGVKlRFHqaXKcFXDjV/xwbuDOFZWj9O6fFZAqWIGqnq+9iGC7wdaIDcKkbFBEgC18m0zej5f8t4Vu09lebT0= 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=CiYd1YOO; arc=none smtp.client-ip=209.85.222.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="CiYd1YOO" Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-7a20b8fa6dcso329891285a.3 for ; Tue, 13 Aug 2024 05:31:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723552296; x=1724157096; 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=0W5qW56HRdoH3DHUCwvvl2OkM1BfHpuAL0bk81ubPZo=; b=CiYd1YOO9tQ7fdL9U+iSBgtiixe0dx9zX+7eN2VCvqxWYCO6b4kSq1ZLnlXktkXF2h 786IJB6u4mqduFlFeK6CvWf7p6VM80+oQk1QR6d5SK7eQX2jIkE++24hKh+8xNuJDJSF ol8TF3Cf/MILeef9BoNjg2Eduf4UhvUv77QTk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723552296; x=1724157096; 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=0W5qW56HRdoH3DHUCwvvl2OkM1BfHpuAL0bk81ubPZo=; b=ANcFtWwbpRphF5v/gTBBiObHnykaWjYOYdSB57SsJsNl/ZSAffm4VsstgOqmvAjldq soFLOgarDlti/VpKlicQFITNi7QmbWAdKbmWvahA4os7S3PwzWkoChBHM/7MczBUZwYW K21mEHajFStcTsTF63IHY6+80gfLxzfQ7DLty7XofDT7fsVo4ITAce4KUFEzRAY6nVb2 vvHvrvJW9Lm5J+wHVB272YIC/dAJMyT2U6hFWw3UWF+amuocuV8oSvx2vKCIq0gj2gUI OPl6GZuXkbrouwSTDztZ3Rm3tBbt5DApyl6Rrgn9DX8uXjKzVjDDZKHMipVYMW0G5gbt t7FQ== X-Forwarded-Encrypted: i=1; AJvYcCXrmWWFzv4Yz3f0qZmU6gGCT6myI0FObQvyIZY9Z3gls9E5yvtk2JswA+w1bfd07ikGccoYl++kUs76zdeykqqolw4+1nzOiod3Hg8= X-Gm-Message-State: AOJu0Yx91oDxFKEbhmT6oDTz+PJ1rvGC9U+N+eNcC8oC2yvWUJ3biRqI rt4FMEv/rfVKA0m3C2y0Fh32EkPQjiDAzJoJUR6C+cmcW8mbh9bx8/+Id2+f3w== X-Google-Smtp-Source: AGHT+IEpFFQrr7nGY9feezV5QErFzlaHGDASr5/SqGvMjPOvkfIPG/a5NQ6X8RFSpTboNcExdfbKhQ== X-Received: by 2002:a05:620a:2456:b0:7a2:ce2:5ae2 with SMTP id af79cd13be357-7a4e152cb17mr405801285a.17.1723552295658; Tue, 13 Aug 2024 05:31:35 -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-7a4c7d66093sm337126685a.12.2024.08.13.05.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 05:31:35 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 13 Aug 2024 12:31:29 +0000 Subject: [PATCH v6 09/10] media: venus: Refactor hfi_buffer_alloc_mode_supported Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240813-cocci-flexarray-v6-9-de903fd8d988@chromium.org> References: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> In-Reply-To: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@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 3edefa4edeb9..755aabcd8048 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1264,7 +1264,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_mb_error_map { From patchwork Tue Aug 13 12:31:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13761965 Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) (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 990BD19DF50 for ; Tue, 13 Aug 2024 12:31:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552299; cv=none; b=hEiSnrTk4IerqjFtasTEU4tqPJranpJ5jR/dBt+gT/vSxLq3FvYthY2NNstl5b8sWnBzcwwsQbld4OqU3E1JT5c48ADToq9JbQRLSl2a9iKqpFCnNYs9o+nMXIVNe1Q3UQkR29jkZ/dHM8G0uhIFQe0TP/Wm52Z2LHcqWGwP2G4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723552299; c=relaxed/simple; bh=+CaEvMFtp6+vW8dd+4vdYR7UCy2/V+0eTuF+Ay8On5w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=U4geYZqU9sbrjg2S3HVDxr0863yCCYrWDwQpQD9B1+JrhgWOkMRCItiwnFCjQfRQ8WsvFnOULXOrJjfwiZQru1WlyrbbVdlmO9rwHp+iV/He/lX/tHY2jtg3+smR369QHYxARpYGG2tIla2SSJaUb6O7+qjiqm9w56uJ9GrsCXo= 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=advjup4V; arc=none smtp.client-ip=209.85.210.41 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="advjup4V" Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-7095bfd6346so2892122a34.0 for ; Tue, 13 Aug 2024 05:31:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723552297; x=1724157097; 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=GH6hs7TBxxS/YEw6+1SJGhyHiJvtnJuQXXY87tDn62g=; b=advjup4VBND4CuAVj8l9GuqzmubjR+lgB6UfV/S5B0v5UudhjHRGF7s6n0wQUa8we0 OaOjX4GMaqAZb07kFx1EhJF82JQmo1M6WhEzKfu2EMqrn9GMmJqfx2/5yow0b7qct6L5 Od5IOWWUHXWK0AjLTaC55JGDUjuN1bDo3Q5tQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723552297; x=1724157097; 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=GH6hs7TBxxS/YEw6+1SJGhyHiJvtnJuQXXY87tDn62g=; b=YETZPjp1iBDKrNQVY7/+te7KCCIZk/tU6r6i2HWOVkIZkKNV/GbthLmYocoZfJmqSA jmZ2fte1qQBZBRgg25UTlvxQ6xVm9g4jtW0Zxdn2wPhgh73XGPdRhB8k+POa/aTduy7p Y3Qii0+c9TcSKs52d15A1SvW0ijR+TnVcaWCNiCEVyXF8fHXnnrFF3Z18QNMsrZzbhOr Ud8fIfLJVa0vS3nYhwZAJRePFS+kstJmzBeWTDGA5i6iI1BnVokzzfUIsMwTeeN970+b RoYxOC2+f59EVuF69TLoopw4aet4GockhWiczHrG4CvjjOWAvNe6XTATnaXHp45L4h3A Y4qA== X-Forwarded-Encrypted: i=1; AJvYcCVnehWmY3fBafwGha4/UJ39T85DlsMluq3Sp4mOhbKN1K85TU0oBAJXDDmyFZy8WRRr4lr2UzDHS4AIZAR3h9wJ2PNdMN2VfzO5Y+g= X-Gm-Message-State: AOJu0Yw7XPKgMk1VnXVigDuAFAFnwsaqA8myXjtYbQdNSYzMywmwCHrp i/+AOzgO6kVG/ME+S6066Whmtl0svY+WKJnzOLsM8aiRdb2mXNcTctxp/tBi3g== X-Google-Smtp-Source: AGHT+IHogC7GOQUcmfObrPNW1iILSP+KxRxv47DDOynRgsgLm33kY19LjuOqUoeUX6BYwlxMP62DDA== X-Received: by 2002:a05:6358:7e47:b0:1ac:66ef:a369 with SMTP id e5c5f4694b2df-1b19d2eb1e2mr402285655d.21.1723552296539; Tue, 13 Aug 2024 05:31:36 -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-7a4c7d66093sm337126685a.12.2024.08.13.05.31.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 05:31:35 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 13 Aug 2024 12:31:30 +0000 Subject: [PATCH v6 10/10] media: venus: Convert one-element-arrays to flex-arrays Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240813-cocci-flexarray-v6-10-de903fd8d988@chromium.org> References: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> In-Reply-To: <20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 This structures are not used, and have a single element array at the end of 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 | 6 +++--- drivers/media/platform/qcom/venus/hfi_helper.h | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 63b93a34f609..1cd1b5e2d056 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -82,7 +82,7 @@ struct hfi_sys_set_buffers_pkt { u32 buffer_type; u32 buffer_size; u32 num_buffers; - u32 buffer_addr[1]; + u32 buffer_addr[]; }; struct hfi_sys_ping_pkt { @@ -177,7 +177,7 @@ struct hfi_session_empty_buffer_uncompressed_plane1_pkt { u32 filled_len; u32 offset; u32 packet_buffer2; - u32 data[1]; + u32 data; }; struct hfi_session_empty_buffer_uncompressed_plane2_pkt { @@ -186,7 +186,7 @@ struct hfi_session_empty_buffer_uncompressed_plane2_pkt { u32 filled_len; u32 offset; u32 packet_buffer3; - u32 data[1]; + u32 data; }; struct hfi_session_fill_buffer_pkt { diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index 755aabcd8048..f44059f19505 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -761,7 +761,7 @@ struct hfi_multi_stream_3x { struct hfi_multi_view_format { u32 views; - u32 view_order[1]; + u32 view_order[]; }; #define HFI_MULTI_SLICE_OFF 0x1 @@ -1038,7 +1038,7 @@ struct hfi_codec_supported { struct hfi_properties_supported { u32 num_properties; - u32 properties[1]; + u32 properties[]; }; struct hfi_max_sessions_supported { @@ -1085,12 +1085,12 @@ struct hfi_resource_ocmem_requirement { struct hfi_resource_ocmem_requirement_info { u32 num_entries; - struct hfi_resource_ocmem_requirement requirements[1]; + struct hfi_resource_ocmem_requirement requirements[]; }; struct hfi_property_sys_image_version_info_type { u32 string_size; - u8 str_image_version[1]; + u8 str_image_version[]; }; struct hfi_codec_mask_supported { @@ -1141,7 +1141,7 @@ struct hfi_extradata_header { u32 port_index; u32 type; u32 data_size; - u8 data[1]; + u8 data[]; }; struct hfi_batch_info { @@ -1236,7 +1236,7 @@ static inline void hfi_bufreq_set_count_min_host(struct hfi_buffer_requirements struct hfi_data_payload { u32 size; - u8 data[1]; + u8 data[]; }; struct hfi_enable_picture { @@ -1269,7 +1269,7 @@ struct hfi_buffer_alloc_mode_supported { struct hfi_mb_error_map { u32 error_map_size; - u8 error_map[1]; + u8 error_map[]; }; struct hfi_metadata_pass_through {