From patchwork Tue May 7 13:18: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: 795408 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD614168B18 for ; Tue, 7 May 2024 13:18:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087913; cv=none; b=Wfe/Z83var45IZup3AymH44S/lHXo1BNggCy/YwGqUsj1/QA+A4LLp7oWPJpXu75sw7RjwpbhC5WDde+EPSGG38wL81Ndoj4V9Pb28pl3WnrZQKYM5EtX6P0fsmXg+zZ42EUYCCj6Y4rIxN4Ai951Q3/JyqSzni3vlXdYszUmf8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087913; c=relaxed/simple; bh=znTu4kcBZIJ40DAZAzE4ZarYw+mhmMYgFA8GYOICILk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CsyZDN9BpuJnxaDWuj49Gn4G4oCPG24eyxHz5P3XhxfyDHw2ABVWpDsYMMapSdYj6CLEcnHB4QxChQ84B6TI83HDdnq9pWuJruL6XzgMTOd4H8lM/aENveCoky6MBsMrIbEKsOluAuwh+F6LD23Q1Z3I+LbWloCiKiZI1o+lof4= 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=W/ysPZ06; arc=none smtp.client-ip=209.85.160.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="W/ysPZ06" Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-43d4c5f7b1bso17264111cf.1 for ; Tue, 07 May 2024 06:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087911; x=1715692711; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=XvJOy5lJ/u6e9yHF9m7H/WFxuEXKyxfgmG432+rwWPs=; b=W/ysPZ06IYFhtX/6M3QRbwwJGPzhk/CIsHei/AljHXL4JN8aGL6yhVBUYEbi36qpad IA0pgS3Ljw0RtcNaz4Hi1KvWOyOSn4YmxL1sh7QEVCl4lj+o8exRPeBIC6MNNs5LrQWV q4a8DJGW98T/nOESWGyHZFg1FXPO39PWk2Sj4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087911; x=1715692711; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XvJOy5lJ/u6e9yHF9m7H/WFxuEXKyxfgmG432+rwWPs=; b=HedGcZmSJfTgf6juvsF/y8tLK2t3T9cAA6PjPOhu+QOs9rWqhP9UTCVg/iv8CX8/CW 2sx/jVn+wPskywtEkeQPrDCxjts08KpFk5JroUNIafTKf2IYeAUmAdhOLX0rHwZjY5ya Z7ICV1IgcM1fzMb9rGUVODaz5pS5yD9wfexdhtRAfFX/GkBNesxC+fM9pcrcdKOEYZG5 jEfQFO3jOeRoB2OkRISSxhhnW10VPW3oxod3DfJU+tr8QnSBnDPj5W5SQK4xkkLGwqm2 Lyz+1RsCU7szXTFcN4dJ1Fw1quLR0gGfUYiav3fOhoGIaT2e7pio3zcFMMVeFmL7Sz+L oEZg== X-Gm-Message-State: AOJu0YzKJ7toW75UCw0UkRZDWQ1x6a40cF9Gx4vddY78el/CXNmMsrFL 9X/wrIrK9N/SPEW4nBTvM2/GWtf3V4OkpgNU45mwt8+XZML5u+qURF/QIfvzQw== X-Google-Smtp-Source: AGHT+IGm6pXwHMdL9pFaV0FwWg8eqwPdftA0BUaILiny2B4bPC36O7QRhpTkxvdwYUJMzUmDBO5Kmg== X-Received: by 2002:a05:6214:1253:b0:6a0:b3ec:902f with SMTP id r19-20020a056214125300b006a0b3ec902fmr19399470qvv.15.1715087910820; Tue, 07 May 2024 06:18:30 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:30 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:27 +0000 Subject: [PATCH 01/18] media: allegro: nal-hevc: Refactor nal_hevc_sub_layer_hrd_parameters Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-1-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 Replace all the single elements arrays with the element itself. Pahole shows the same padding and alignment for x86 and arm in both situations. This fixes this cocci warning: drivers/media/platform/allegro-dvt/nal-hevc.h:102:14-22: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/allegro-dvt/allegro-core.c | 6 +++--- drivers/media/platform/allegro-dvt/nal-hevc.c | 11 +++-------- drivers/media/platform/allegro-dvt/nal-hevc.h | 6 +++--- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/media/platform/allegro-dvt/allegro-core.c b/drivers/media/platform/allegro-dvt/allegro-core.c index da61f9beb6b4..369bd88cc0ae 100644 --- a/drivers/media/platform/allegro-dvt/allegro-core.c +++ b/drivers/media/platform/allegro-dvt/allegro-core.c @@ -1852,14 +1852,14 @@ static ssize_t allegro_hevc_write_sps(struct allegro_channel *channel, hrd->dpb_output_delay_length_minus1 = 30; hrd->bit_rate_scale = ffs(channel->bitrate_peak) - 6; - hrd->vcl_hrd[0].bit_rate_value_minus1[0] = + hrd->vcl_hrd[0].bit_rate_value_minus1 = (channel->bitrate_peak >> (6 + hrd->bit_rate_scale)) - 1; cpb_size = v4l2_ctrl_g_ctrl(channel->mpeg_video_cpb_size) * 1000; hrd->cpb_size_scale = ffs(cpb_size) - 4; - hrd->vcl_hrd[0].cpb_size_value_minus1[0] = (cpb_size >> (4 + hrd->cpb_size_scale)) - 1; + hrd->vcl_hrd[0].cpb_size_value_minus1 = (cpb_size >> (4 + hrd->cpb_size_scale)) - 1; - hrd->vcl_hrd[0].cbr_flag[0] = !v4l2_ctrl_g_ctrl(channel->mpeg_video_frame_rc_enable); + hrd->vcl_hrd[0].cbr_flag = !v4l2_ctrl_g_ctrl(channel->mpeg_video_frame_rc_enable); size = nal_hevc_write_sps(&dev->plat_dev->dev, dest, n, sps); diff --git a/drivers/media/platform/allegro-dvt/nal-hevc.c b/drivers/media/platform/allegro-dvt/nal-hevc.c index 9cdf2756e0a3..575089522df5 100644 --- a/drivers/media/platform/allegro-dvt/nal-hevc.c +++ b/drivers/media/platform/allegro-dvt/nal-hevc.c @@ -210,14 +210,9 @@ static void nal_hevc_rbsp_vps(struct rbsp *rbsp, struct nal_hevc_vps *vps) static void nal_hevc_rbsp_sub_layer_hrd_parameters(struct rbsp *rbsp, struct nal_hevc_sub_layer_hrd_parameters *hrd) { - unsigned int i; - unsigned int cpb_cnt = 1; - - for (i = 0; i < cpb_cnt; i++) { - rbsp_uev(rbsp, &hrd->bit_rate_value_minus1[i]); - rbsp_uev(rbsp, &hrd->cpb_size_value_minus1[i]); - rbsp_bit(rbsp, &hrd->cbr_flag[i]); - } + rbsp_uev(rbsp, &hrd->bit_rate_value_minus1); + rbsp_uev(rbsp, &hrd->cpb_size_value_minus1); + rbsp_bit(rbsp, &hrd->cbr_flag); } static void nal_hevc_rbsp_hrd_parameters(struct rbsp *rbsp, diff --git a/drivers/media/platform/allegro-dvt/nal-hevc.h b/drivers/media/platform/allegro-dvt/nal-hevc.h index eb46f12aae80..afa7a9d7d654 100644 --- a/drivers/media/platform/allegro-dvt/nal-hevc.h +++ b/drivers/media/platform/allegro-dvt/nal-hevc.h @@ -97,9 +97,9 @@ struct nal_hevc_vps { }; struct nal_hevc_sub_layer_hrd_parameters { - unsigned int bit_rate_value_minus1[1]; - unsigned int cpb_size_value_minus1[1]; - unsigned int cbr_flag[1]; + unsigned int bit_rate_value_minus1; + unsigned int cpb_size_value_minus1; + unsigned int cbr_flag; }; struct nal_hevc_hrd_parameters { From patchwork Tue May 7 13:18: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: 795406 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD9DF15ECCC for ; Tue, 7 May 2024 13:18:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087916; cv=none; b=eVwmdXJ2gxIJCCK6AoUz35i/InE3wnD06f1d2odCoTlG9zrpeqS+PU8gXmbBS3t6//x8DX7Sz3KGXrnYE543r5xwqaM0QAbMQshndrlGByV21TgxreK7bwlHc2DAdptVKBZ3Zv2k6GcbXX6JnSCUYWcWoz9cObEjLq9j543zkXc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087916; c=relaxed/simple; bh=OkrWWOrUN5GNEWioxP3gYdPUo0/0BfsqCVC0RCoziIM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=udm79pM/qPxVAxj/0GikG0pII/4r0gpBv4rQiB479noELa+z4xRxwYABY6bAfezrI64T4ar/p/UsxOPppvwXpv/VTMb+dhRmvaaBon9w6IXxxPoiCYf5hfVYVoTOG/RT+WMCxn3bjLkqRLBhU0Ym5x2TxzrgbCi+FvfxKPZWOK8= 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=bv7ZuYR1; arc=none smtp.client-ip=209.85.219.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="bv7ZuYR1" Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-69b7d2de292so14114596d6.2 for ; Tue, 07 May 2024 06:18:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087914; x=1715692714; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1/P1ujR64RjpeY3CCEbW1xPPMvUuqlT7weCmbLOLgyg=; b=bv7ZuYR1JSua4HN2zGrac6dR80LTnt3qfwi0LYYW10A4oCkGiy/9dj0lr5csx0dB6D pvlzvvBoE+0oi9e+NvhdD9hOkpm6ee2zH/O2Z6mYkRvD0/IXdVRgYf/BMt2TPxpheY4M pTXKYP+wd8A6lTiRyokt7qJNrZpmL3F7X+B1A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087914; x=1715692714; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1/P1ujR64RjpeY3CCEbW1xPPMvUuqlT7weCmbLOLgyg=; b=Y7WVRZ5EdkwxKUjzsq6E5q1YqbNSD2/P5ydAmd4/OnvqsqBeYZDxQA8Hd/CGokMrEu qEqHCLcrEhOepO8eX2e5WWQF2wiGMBb/ZVTkfYX/mcR3U4fAib819PeuB1NMxH+57L8E iVEjAiqAtgxxDNkOXu5fi1dRJaVl8lVfK3esmKiPb3SCQHwSGWsjDR5Dqz4bTaJZGxAr URi7UB1EPMoaXod01OXSAW1tkFwusQm/FuSSHfOwjmGVQfQl42cKEr2i0/eLPYGRxQnE VNx6zXR/py6U+CSf2gfCGVkDhyUhAD7KKFbqiwpnBtNnfBpaxH+mQIHnvLUHq4Bkpw/H 6z3Q== X-Gm-Message-State: AOJu0YwX0RiE423btdcFcJjJvdmhOcYW9pBfvbAUyq3fd1mqfjWY+YgZ kYDc19f1P6/8Jvs3E3y6TTCmLwR5FgC9g8cbnRI2sUOa31XESbrL6X5QpoTwzg== X-Google-Smtp-Source: AGHT+IEHmgR44JJkt0kGIzW7NOaECWfdPMcTxHBijYkMDjUQ//6R0gtSxgRSvy3DiBlPMd5HBstr/Q== X-Received: by 2002:ad4:576b:0:b0:6a0:6545:2306 with SMTP id r11-20020ad4576b000000b006a065452306mr15355570qvx.28.1715087913906; Tue, 07 May 2024 06:18:33 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:33 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:30 +0000 Subject: [PATCH 04/18] media: dvb-frontend/mxl5xx: Use flex array for MBIN_SEGMENT_T Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-4-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 Replace the older style one-element array with a flexible array member. There does not seem to be any allocation for this struct in the code, so no more code changes are required. The following cocci warning is fixed: drivers/media/dvb-frontends/mxl5xx_defs.h:182:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/dvb-frontends/mxl5xx_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/mxl5xx_defs.h b/drivers/media/dvb-frontends/mxl5xx_defs.h index 3c5d75ed8fea..512ec979f96f 100644 --- a/drivers/media/dvb-frontends/mxl5xx_defs.h +++ b/drivers/media/dvb-frontends/mxl5xx_defs.h @@ -179,7 +179,7 @@ struct MBIN_SEGMENT_HEADER_T { struct MBIN_SEGMENT_T { struct MBIN_SEGMENT_HEADER_T header; - u8 data[1]; + u8 data[]; }; enum MXL_CMD_TYPE_E { MXL_CMD_WRITE = 0, MXL_CMD_READ }; From patchwork Tue May 7 13:18:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 795404 Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8884816D308 for ; Tue, 7 May 2024 13:18:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087919; cv=none; b=HjRG1p9wnuqQzwMpcK7vqISfEJclrDr/9pVYm1OX1anR2QG20hJ3Bf5k9kOXQpNxR6sbPnmCkgLHvBzcHQmIw9057tN1b8ecyqPEkiHShH3TmUhx4p/NfjyaL40tUHsFSlFCrc1mJyGqLq+sU631zwG4yNVFQ+lduY27c5SrpUk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087919; c=relaxed/simple; bh=ENYjVBtJ4EPS9w/ftPm8y0fja8ouSlg/VUcwtfy4KyM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bFc+Pk//34pY0Tb5ThoIsX+Y/y1kJyf5t7svlNCtOhdfkIk5uDMo8gMx2w+dtKyt1hAeR4AfdcafLWiiSWmIIfznjNe8sdXNmzSmWk9lSUR6eNwTBfcqcg0MZpjOF6+BxbOTNpPiVE8Cu2q6xbEk8lCTYWVLZ00jkkiCpeiMIys= 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=KBC519u0; arc=none smtp.client-ip=209.85.167.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="KBC519u0" Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-3c963880aecso1112943b6e.3 for ; Tue, 07 May 2024 06:18:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087916; x=1715692716; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=bajBIKBKiGkzVrECr+DrCDdr2oyOzpQYYR0WAIoyaos=; b=KBC519u0YUZRmCX814fdQKpA9DlYSwz1bySNckmrtHfZxffY9CGzwwo3nEWshOn0lS 8v9an28RN3ZuLUZoNoPCjNSUaymk5IwXUr1AI4Qmfzc6ZauF9dmvpstHrufZVgY5PRuy ZmGawl0KywrAVsBanr0/J+DjkUIek1bN8rc0o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087916; x=1715692716; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bajBIKBKiGkzVrECr+DrCDdr2oyOzpQYYR0WAIoyaos=; b=fYR+uomcxPb7yehcHYqMLD1uxwaSLxSOFCpqXO8MfVrDp8QrTODqvYB0W1Wtz8/QeD uWrMaFNrwk/Yd8K3PPCvhuE4e0G6LBAMDQGndaYPyrmW8C6uFM/iZ5B2ElmZTY39OXb0 FcDDuMMjvZml0X7D+B7NJ2ICz65U4aTp6nwIts2hiKwDQo1SiGvRnqhPFphnCdeiMUd+ 2ZYrdiX+AlXf6gc9D9DPs32G+JORBd2rXXT0KYsY9bpnPh2NEIyDbeaASEp5ZRRtKXLk ld2yISLOp2L/DJpP0BqCscHPGRs3Wl5A2LghmHz4+ycYE2j7ev2YWY9fbyQIWDfhGthv XZqQ== X-Gm-Message-State: AOJu0YxDB77nLuDrWZC1ZG3LSXFwFc7/YcZb0ePljvs4QiVFcjObKVaI F77S12tghet8C7M8iv5wvRC/rhnWGUk8MNAGOTsERUWNwR3fbjAF7P61weA8O2G42J5AxcnlGUw 2mA== X-Google-Smtp-Source: AGHT+IEfgZc+3NqAZNZgDbuMWn1SodDQc1fgSaycXBKpVQJhCw/vqcobpSG60CD78oLq4SUhp6OVxQ== X-Received: by 2002:a54:4195:0:b0:3c9:6e70:cf99 with SMTP id 21-20020a544195000000b003c96e70cf99mr5053014oiy.57.1715087916576; Tue, 07 May 2024 06:18:36 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:35 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:33 +0000 Subject: [PATCH 07/18] media: siano: Remove unused structures Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-7-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 These structs are not used in the code, remove them. This fixes the following cocci warning: drivers/media/common/siano/smscoreapi.h:1049:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/common/siano/smscoreapi.h:1055:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/common/siano/smscoreapi.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/media/common/siano/smscoreapi.h b/drivers/media/common/siano/smscoreapi.h index 46dc74ac9318..bc61bc8b9ea9 100644 --- a/drivers/media/common/siano/smscoreapi.h +++ b/drivers/media/common/siano/smscoreapi.h @@ -1042,20 +1042,6 @@ struct sms_srvm_signal_status { u32 request_id; }; -struct sms_i2c_req { - u32 device_address; /* I2c device address */ - u32 write_count; /* number of bytes to write */ - u32 read_count; /* number of bytes to read */ - u8 Data[1]; -}; - -struct sms_i2c_res { - u32 status; /* non-zero value in case of failure */ - u32 read_count; /* number of bytes read */ - u8 Data[1]; -}; - - struct smscore_config_gpio { #define SMS_GPIO_DIRECTION_INPUT 0 #define SMS_GPIO_DIRECTION_OUTPUT 1 From patchwork Tue May 7 13:18:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 795403 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 574CE16D4C6 for ; Tue, 7 May 2024 13:18:38 +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=1715087921; cv=none; b=ausMOspgn3a/hL5lRqc3VxBvBOF2GFsnZmZj87fvLj5g6Itr7kWmAA/tUfhrNieCRWsJzOthwcZ32ugSDpEc33qwFYXjkVrwCEs9JPENdXGVX2U8cvD0KZdh47HLQaBUkF0l9fNnNJG3YIdb6UdIkH8s+l/4n1OMgt4kbiYbHA4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087921; c=relaxed/simple; bh=3FQmdzC7rLah5bHXqxL1pjRWMb/l2vnOq/dIwPsVxiM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HRN7KIqQ33dtRhpEDO6ZEMb9VSpvoYg5cEmcAYAeqwyfX4dvQzjO8+co9jVbINKn5Xtu2cFi4s6Ca1W2m1NnwO5q/Iq3shJeJ1HQMUeQArCXb/0MEViBWYsTkmbL/a160tE0hPNAj8BlWynsgihSYXKYKTAQj4b11MCPiUBtu8A= 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=JFt4TNkp; 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="JFt4TNkp" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-7928ec5308cso288067085a.1 for ; Tue, 07 May 2024 06:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087917; x=1715692717; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=JKfhOSoHE1VqyRhgB0xYInvnK6a8zz5LZUqmCULZe+M=; b=JFt4TNkpMT5jL5IFAYGuw28lBWwu84Ak+EoHQOC6AlPJzZQOXDDwp2LfLftQDkcI48 kePHAN4Bhd5TFp56PnCYmL0IjqhZvKlhNTePDpTlPyuZOgFXVPm3H+gBFvSW2TKQP2V5 t4vOxqEd9Db93cAxWnLWBikZe5wQjTQDdToXE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087917; x=1715692717; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JKfhOSoHE1VqyRhgB0xYInvnK6a8zz5LZUqmCULZe+M=; b=Ta5OWJfcRPY1y/n/0LEVopr2nR2uTZsJlbVe80Vkze9VETrzTnB58gcL2WksTNMZYL Ch2xykUOMZAPBqD9i7/JZ+hsKdVHy8M19zVtPWinkzKz9+V5OHNTD0IpR4qSg0MbIV+T NXfZmLoQDHJ3Aq03jZAWx3b7a7imGIDQhWZU/NE4qxJWieuuIz5W8mnfi/AfWDkZQOFp fCh7XECgdf0p/g94HhWs3YFSTkGL8GWsc4BcANrJ3w1/2GuPvHMrfYFe9ZDZKhZ/9BBA QANkHRXzql14I3D56RXu/0TU4BI0YQmqcZ3MHUpuyAe86mKNimC8lumNQ787a6JKTMdq y6tw== X-Gm-Message-State: AOJu0YyguDCYpx/wCocLAfjwsB7a2X4osW0MXzU6B3QCFj3//L7D+6d6 sbjFoD94HrMvNbdn1kFji/apUNFkXWoGO+A9U++cUc3ivusscDxlheI9c0Z/dg== X-Google-Smtp-Source: AGHT+IFKliypIzu0YjFcg14a69MBEAau+ZXpSAYRUE5dq1ueGc4ePsCBbZXpGGTph+KzlVWTljAkDg== X-Received: by 2002:a0c:e082:0:b0:6a0:f637:667 with SMTP id 6a1803df08f44-6a14600e407mr45875746d6.12.1715087917380; Tue, 07 May 2024 06:18:37 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:36 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:34 +0000 Subject: [PATCH 08/18] media: siano: Use flex arrays for sms_firmware Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-8-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 Replace old style single array member, with flex array. The struct is allocated, but it seems like there was an over allocation error: fw_buf = kmalloc(ALIGN(fw->size + sizeof(struct sms_firmware), SMS_ALLOC_ALIGNMENT), GFP_KERNEL | coredev->gfp_buf_flags); This change fixes this cocci warning: drivers/media/common/siano/smscoreapi.h:669:6-13: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/common/siano/smscoreapi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/common/siano/smscoreapi.h b/drivers/media/common/siano/smscoreapi.h index bc61bc8b9ea9..82d9f8a64d99 100644 --- a/drivers/media/common/siano/smscoreapi.h +++ b/drivers/media/common/siano/smscoreapi.h @@ -666,7 +666,7 @@ struct sms_firmware { u32 check_sum; u32 length; u32 start_address; - u8 payload[1]; + u8 payload[]; }; /* statistics information returned as response for From patchwork Tue May 7 13:18:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 795402 Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C36B116DEC3 for ; Tue, 7 May 2024 13:18:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087922; cv=none; b=O3OYW42QGJkU/0gwl8RLGfaOXWz14Nz+U0DoZ2/oCKmKQDT3NLoefNwtPKQIvZwD+i8b+yCjC3xU1aLdMjpWhRLaddP/Xt8fONt+/OPqSbjuuTr2zGhkJ6FtZl0OBPJWwOOEkaW4cSsAFfOmNVL195hNvcC40N8S+jlDmGE97eU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087922; c=relaxed/simple; bh=9NQhYiz/IbLF6F7xrUyCvcZeCyvNKJflJvFw3WrA/2Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dXWyfPlzPraVKhkb4WCfbta4lkJtqpWDbnAXKlRHfHbUhHooJO9E6RbDR7s5wbsSvRXZmbonp6+E4J21FZdmQTbND2i2MzGsZq4JJZjV1pOKOvyRV9EbsdjYnT6KNRobnkwDIAAqEQHOl6LJlkFNfZsNYjxINw557AvwEryNe1I= 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=JtFfH2cG; arc=none smtp.client-ip=209.85.219.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="JtFfH2cG" Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-69b4e94ecd2so12668756d6.3 for ; Tue, 07 May 2024 06:18:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087920; x=1715692720; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=WR87o59ttHnNvNigBqZHzwph/s3gT6BLw9Ga86sRtPA=; b=JtFfH2cGcjafuPkormhgFTXYN5icqyHToRCqOanoGWywBAv15WOhzX7Yr/hNCBbAh9 UL/9mfYyfkvnseYqsoXooMmkPQFGWZUochXnI59uSMICypEzYxNfS028r6x3qvuXJTtf LXfoHLOggxXCMD50eYw4FhGeXCnpuLG2X7ndk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087920; x=1715692720; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WR87o59ttHnNvNigBqZHzwph/s3gT6BLw9Ga86sRtPA=; b=rnrLyD7kDWERzn7y/SocBNRMektyWGhkLozOI8qNV+tdN8tf8VLOFjtjPJjxUU7uQ3 m3lFpjxQ1AfQ1p1F5a2RoVrQ2Z7h6gFrRHGurx5lbP25dYG3iPYP3NGN5I4m5EbXN68M UI2XeYStgvg9hy4NuH4wyGMzZrjoUqwcKkX2UVYQJoe9iBr3bxHV5NEn5YVteqx7/7EN Ml633wpyN98hEDQOxKGaE3bFmMSbBztiauddT0GGSseuww0/M1X8zDzKpIkJGy6Tvmjg OltyLVx82Zx/krV4Dc4TAweo9/oyOwnuASapbB4YSMQ3KIiqg52rXO82UXJ42rgoCaH4 LYDQ== X-Gm-Message-State: AOJu0YzSjzutfGwvY9huYLy/gVI3LartwbIbGTkglwZS9RPH1ieux0W5 Jkc22jCVxv2eFPJ6mn7fpIGDkE672TnzAy0aMEDEp8kRV5pcVl5+Bi1YOJNNWw== X-Google-Smtp-Source: AGHT+IGatpIQRwE9h01tY7yyLZRrAcLmql6eJb+YKcxD2Wq6gpUB9pyNvjqWHkivGZUb+9PKsnvIcg== X-Received: by 2002:a05:6214:c4b:b0:6a0:def6:6c8f with SMTP id r11-20020a0562140c4b00b006a0def66c8fmr15390917qvj.47.1715087919625; Tue, 07 May 2024 06:18:39 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:38 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:36 +0000 Subject: [PATCH 10/18] media: venus: Use flex array for hfi_session_release_buffer_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-10-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 Replace the old style single element array with a flex array. We do not allocate this structure, so the size change should not be an issue. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:204:5-16: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 41f765eac4d9..6dff949c4402 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -201,7 +201,7 @@ struct hfi_session_release_buffer_pkt { u32 extradata_size; u32 response_req; u32 num_buffers; - u32 buffer_info[1]; + u32 buffer_info[]; }; struct hfi_session_release_resources_pkt { From patchwork Tue May 7 13:18:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 795401 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (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 9E68616EBE8 for ; Tue, 7 May 2024 13:18:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087924; cv=none; b=mK7NwtE7piIZqZDqs27IQ+tvO4WthDSWn1F/WYyQ8fZKdFAxlDCpMqD3O9fqJmWdRlYljUKaZFED6bYLwYvzKOHKPLNdjtAIrmNnlkH3hprSmHwkksfeYtozow6gakBhJ3++O+KJwVcrRmM9WiLPnQoUKWVwkqpQrkBAgz/moWE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087924; c=relaxed/simple; bh=cqQiASSb1ke8R5KptOfAxJYuMrFDRm8Ouf7QBhfinuo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=isSeVck3B6ZI1lHLgUoL00fY25YKVbcz6ajELIpHe+ieNd9h6PhdxOH0t6oGOHdMUNjlhGucjI6+sI71ww0dDhyejPhB2yuENsmqnWDezVrftDWy4xZsf4hgOdQRElCNtqVpaw4RikyKWAKvYY8f7JRiO7me2AT34UccFPwSG48= 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=RDMbgFrt; arc=none smtp.client-ip=209.85.219.51 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="RDMbgFrt" Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-6a0d1032362so10595116d6.3 for ; Tue, 07 May 2024 06:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087921; x=1715692721; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1Dzq1v7dj+VBVNk1zZzFNzIZj2cxfHYcizI+MBp1ZX8=; b=RDMbgFrtVCgPuxbnWbZH1qbBZ7pa/VfszDw/xgHARRfziEaMkRLGuDthwezlyexIIg +I+DgiQD8mukDI8r8lffQ73cBecqHxyhKEi8kTzHeKh1Jq99YJML+K5uJIZvtHl5r95C G+WqWVekOUJH4IrPCpBsTu1obb6pWA8Bpo9dk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087921; x=1715692721; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1Dzq1v7dj+VBVNk1zZzFNzIZj2cxfHYcizI+MBp1ZX8=; b=ALHBXddRNRzYXdna2p2yWcO3swZoswLQBgeUfqaMT3mSVWbo8vqItMVtzVeuMEHoq6 NWkVkRHEUb9Nu4BGI1zgrM4pCxDsyxDy5oe3fIlgTqyRJmFoaGeAAdailWcoh4ZboIGy AoCcFxFV06nn9q6mUxgdOzobPqwS/Ikj2wR7K56x1wMnmiWCLaWsO3BLE7PBYwi48bb3 JZDJEtE59idr9POgvXgFN0l8U3tGHorRBtywWtIkxCzleY5LQnZqpxqvy4/EoiGREY4E pTjB0Vaqiq7WTvINpOykiblO9Lq2DQ8DLgLUjgz+bGMa+1dkCliOLkKnQKFFKczY42mi RLFw== X-Gm-Message-State: AOJu0YyUD/tL9cCBBJTNl20Wm9+03RXepIhrKyi2bPkg81FqDwGx9ItL W9j11p0clAvT8/rp7BgpYwzdSsM9wa5swQ3gp7mmw2z/2nnvCE7tKGAoobOSnQ== X-Google-Smtp-Source: AGHT+IEAUZYdUkG16+sKKGfbxJ3Nv32xMw8WTErK9sJC2vrPaqjhZxuw8OroCcIO1SEdeCxTaiebPw== X-Received: by 2002:ad4:5be8:0:b0:6a0:55c6:9b47 with SMTP id k8-20020ad45be8000000b006a055c69b47mr16507653qvc.37.1715087921664; Tue, 07 May 2024 06:18:41 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:41 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:38 +0000 Subject: [PATCH 12/18] media: venus: Refactor struct hfi_session_get_property_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-12-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 The struct hfi_session_get_property_pkt is always used to fectch a single property. Make that explicit in the code and avoid a single element array at the end of the struct. This change fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:194:5-9: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_cmds.c | 8 ++++---- drivers/media/platform/qcom/venus/hfi_cmds.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 3418d2dd9371..520ff8a587e6 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -401,8 +401,8 @@ static int pkt_session_get_property_1x(struct hfi_session_get_property_pkt *pkt, pkt->shdr.hdr.size = sizeof(*pkt); pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_GET_PROPERTY; pkt->shdr.session_id = hash32_ptr(cookie); - pkt->num_properties = 1; - pkt->data[0] = ptype; + pkt->one = 1; + pkt->data = ptype; return 0; } @@ -1106,11 +1106,11 @@ pkt_session_get_property_3xx(struct hfi_session_get_property_pkt *pkt, pkt->shdr.hdr.size = sizeof(struct hfi_session_get_property_pkt); pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_GET_PROPERTY; pkt->shdr.session_id = hash32_ptr(cookie); - pkt->num_properties = 1; + pkt->one = 1; switch (ptype) { case HFI_PROPERTY_CONFIG_VDEC_ENTROPY: - pkt->data[0] = HFI_PROPERTY_CONFIG_VDEC_ENTROPY; + pkt->data = HFI_PROPERTY_CONFIG_VDEC_ENTROPY; break; default: ret = pkt_session_get_property_1x(pkt, cookie, ptype); diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 6dff949c4402..e1dd0ea2be1a 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -190,8 +190,8 @@ struct hfi_session_resume_pkt { struct hfi_session_get_property_pkt { struct hfi_session_hdr_pkt shdr; - u32 num_properties; - u32 data[1]; + u32 one; + u32 data; }; struct hfi_session_release_buffer_pkt { From patchwork Tue May 7 13:18:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 795400 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.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 2875816D9BA for ; Tue, 7 May 2024 13:18:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087925; cv=none; b=VUq7VhsN/B6qzf9oJpS+KaTVwBpZ4iTM9GqwgjE2ywpCLczLGPkzQovyXyu1NgMSM5oRN2mqjUhkOeHV43GD6xyD5NFvpF6UdXwT2mnRvtqD4y8uXZhq4iYJRhtnqpFFf+4nvzLHHD756asSRWQ5uOZIDMXSs1fUxitdIoFojG0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087925; c=relaxed/simple; bh=EDdfr0+Pnj9r3H0XIbqR962gzmaw2rY41SXbAP3xmuY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cEA7rHFdOhQRmqLISHyB1ofHPCVYZkZmSgL3ofBHDNHglsjQlgXrnogw23rwdcnBOIiK18N7+Durgtbqh6V7Wt8zs+chTqxGA1U68SNeQUHL4Jq+lBVRhgKc5Og23ESFpj7x2DVKJ8FeQAisKZMWuIgdo8JabiRB8iuOxz9qr3g= 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=bOMgnXAQ; arc=none smtp.client-ip=209.85.167.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="bOMgnXAQ" Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-3c97a48575eso476187b6e.2 for ; Tue, 07 May 2024 06:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087922; x=1715692722; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=grfwfbVNg0FYwVP8zOHueia/jYu69rJdnTVnLodDO7c=; b=bOMgnXAQIlSZ3+/vgUBIIa/mHpEFDCRanOzOdnSiWt1kvfa1jab0oi4iNDST74XXqk eMY8oXCbnQdPQejspqU4D3iNXc5upN8R96HVrP2IKCD4YxEC5wmlGufJA/By6sn61hw+ 1rj+NVp8HagunRxlzzj7kFWKxDD9aSiQ3yZug= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087922; x=1715692722; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=grfwfbVNg0FYwVP8zOHueia/jYu69rJdnTVnLodDO7c=; b=a8EVZhpf5TPE4xE4gPpAaIXn56hPqHdXVwkUZXcDlqeYeyz9MdCKQfjNkoewPwDwG3 f8ug2Wen3DMdcLEMxBJ+FXpQuuyRmJ8nbvy27QvyuZeaMPrEDX71eFh3WsSovj5javtU I7BT3FLGJ+OZd3L4uyNE7geYHymUyPZmpPL7jNJ8Bgk/xrxAj2ZOwcHQq3SgMeKKEQkA l0X2JTWXe/GkGM0f/f+wMnzeCUqIH3EX1kLZ0jTZE35K/XMDK9WVKaG5BsxenyHPiWwl JltgkZSPUM92kJdevzU6KOMfJhrIOYiNYwqtaEzahvSf5u15vEX5rRN3PlOmxeIDLTrj 3TwA== X-Gm-Message-State: AOJu0YxHgdKj+TeCBd6DL+G6OteAfaKzhlU56WOu+R0sgLIUy52ieO9p EUDMkCBSD5Dt/skn7nzbO74iSVSkd1+ZcFNF1+hIg31nGanMhJ9sT3pZTl7JoQ== X-Google-Smtp-Source: AGHT+IFSSR3o5HtKdgIS/uE+VKpBV5Rv+stUdj3V5A3bS3LVQVk3ZyFe5CBq7bVuSTRuzIUL5DJ6ng== X-Received: by 2002:a05:6808:210a:b0:3c8:6223:c7bc with SMTP id r10-20020a056808210a00b003c86223c7bcmr17391584oiw.7.1715087922276; Tue, 07 May 2024 06:18:42 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:42 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:39 +0000 Subject: [PATCH 13/18] media: venus: Refactor struct hfi_uncompressed_format_supported Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-13-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 plane_info is not a typical array, the data is not contiguous: pinfo = (void *)pinfo + sizeof(*constr) * num_planes + 2 * sizeof(u32); Replace the single element array with a single element field. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_helper.h:1009:36-46: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_helper.h | 2 +- drivers/media/platform/qcom/venus/hfi_parser.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index eb0a4c64b7ef..dee439ea4d2e 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1006,7 +1006,7 @@ struct hfi_uncompressed_plane_info { struct hfi_uncompressed_format_supported { u32 buffer_type; u32 format_entries; - struct hfi_uncompressed_plane_info plane_info[1]; + struct hfi_uncompressed_plane_info plane_info; }; struct hfi_uncompressed_plane_actual { diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c index c43839539d4d..3df241dc3a11 100644 --- a/drivers/media/platform/qcom/venus/hfi_parser.c +++ b/drivers/media/platform/qcom/venus/hfi_parser.c @@ -157,7 +157,7 @@ static void parse_raw_formats(struct venus_core *core, u32 codecs, u32 domain, void *data) { struct hfi_uncompressed_format_supported *fmt = data; - struct hfi_uncompressed_plane_info *pinfo = fmt->plane_info; + struct hfi_uncompressed_plane_info *pinfo = &fmt->plane_info; struct hfi_uncompressed_plane_constraints *constr; struct raw_formats rawfmts[MAX_FMT_ENTRIES] = {}; u32 entries = fmt->format_entries; From patchwork Tue May 7 13:18:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 795398 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.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 359E216F29C for ; Tue, 7 May 2024 13:18:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087928; cv=none; b=InsfOh1K5pWjcYE+cbHDj9urvT3rxPMlGmcn9ouNCa7tzNlFHYF+0lE1vrmD506ZrTVOJgIe4nuSz+Cok91HYP7BlaV4cJ7hMeahx8g9uolx4BKZ7Y3rM46E5HR3To62Ab0mebWSE1HFV3ugQJFRU2awn4UCZQq3epHDgOQIUlI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087928; c=relaxed/simple; bh=P3Bstv/vPDiw+M+/G70Utl3bAIKOevXPnXzJX41+MtM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YvhUvttT3zM22cZ340rXOoFXIgMl934rwWEIQNgGOiyeDkNA6606idKfi4mQJGf6KA7nQ6+oUGyU45u512XoLhzRwYmiJbHOsLs0rBaNwVHqS0UBnaYY0dlcEl9puRWu8MTqBxAKO8akwNTT06cqNaEkgewwMYLQf850fYyC6d4= 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=AZ9ltb3I; arc=none smtp.client-ip=209.85.222.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="AZ9ltb3I" Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-79291d441fbso286968785a.0 for ; Tue, 07 May 2024 06:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087925; x=1715692725; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=AxOzymIGy9oIqpVIjgGXcOBfnvf3rPmoINBWnjxn4+k=; b=AZ9ltb3IB86//wjqAH7/jpArg1gKvlnnLw7s02NXnOtuJVXBWw7kooU45uZcNHklBd aK1pD4AXZnXMMGAv5kdV2vRa6gjO5ckfFFKqygzSku65tfhXBWoSHHN07jwtrr32lHe3 exseckclPfoZlET2o8NH98/Ha8qaJQFh8sXNo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087925; x=1715692725; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AxOzymIGy9oIqpVIjgGXcOBfnvf3rPmoINBWnjxn4+k=; b=PeIIZTWElNlEg9M89a/WY+pdUjdHVCMSjhVKlyWfy/8OJ7J/CFSV6BFmXqhHAlUpjk XFgjorv/PPJ+QpexRW7mVgiGiFS3rURssPSZqOIOnLI9aBbG4wfzkNPLbToXs3HkOmxP F2RDDyCMvUdgKRwnAi9pbtVRW978MpbtC47SjzcXk70ZBo5qJ0PNUH1EBSCKG/uZxX88 I6khXydzyEaVsxNCp8YztTNjLQ+cfu4wQfGFbti0O2nrHoAGYtmDlWgiAxmgM3e2U6pJ 5O5QBqz9iDPg7IMP46k3rX4gkJkvAhlHlIfxeEtlfrYcQfUCJAgbjAPpKNDNgdYR4t3t IPVA== X-Gm-Message-State: AOJu0YyuWebNbebRmL4w3WkWJQ+HK+WcqekUzqksmSyBrZ3hYbshdB0K ES9t4ZInmT/U0oRcgJg8xFvHMWaVDqf2LZHXg5MA5FMjIsYoLWQxTLJtY7+h5g== X-Google-Smtp-Source: AGHT+IFjQZjYTO14egmCt9EZ5CsVr4euVVQfMTbFSXKPd+8yhvIiVkrVYxti26YpbA+ubiSl4OVazw== X-Received: by 2002:ad4:5fcf:0:b0:6a0:cb53:a78 with SMTP id jq15-20020ad45fcf000000b006a0cb530a78mr15569643qvb.8.1715087925149; Tue, 07 May 2024 06:18:45 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:44 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:42 +0000 Subject: [PATCH 16/18] media: venus: Refactor hfi_sys_get_property_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-16-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 This struct was only used to get the version from the core. Make that explicit. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:77:5-9: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_cmds.c | 6 +++--- drivers/media/platform/qcom/venus/hfi_cmds.h | 8 ++++---- drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 520ff8a587e6..c5123f2e76fe 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -151,12 +151,12 @@ int pkt_sys_ssr_cmd(struct hfi_sys_test_ssr_pkt *pkt, u32 trigger_type) return 0; } -void pkt_sys_image_version(struct hfi_sys_get_property_pkt *pkt) +void pkt_sys_image_version(struct hfi_sys_get_version_pkt *pkt) { pkt->hdr.size = sizeof(*pkt); pkt->hdr.pkt_type = HFI_CMD_SYS_GET_PROPERTY; - pkt->num_properties = 1; - pkt->data[0] = HFI_PROPERTY_SYS_IMAGE_VERSION; + pkt->one = 1; + pkt->version = HFI_PROPERTY_SYS_IMAGE_VERSION; } int pkt_session_init(struct hfi_session_init_pkt *pkt, void *cookie, diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 02e9a073d0c1..cd7902743f62 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -71,10 +71,10 @@ struct hfi_sys_set_property_pkt { u32 data[]; }; -struct hfi_sys_get_property_pkt { +struct hfi_sys_get_version_pkt { struct hfi_pkt_hdr hdr; - u32 num_properties; - u32 data[1]; + u32 one; + u32 version; }; struct hfi_sys_ping_pkt { @@ -239,7 +239,7 @@ void pkt_sys_debug_config(struct hfi_sys_set_property_pkt *pkt, u32 mode, u32 config); void pkt_sys_coverage_config(struct hfi_sys_set_property_pkt *pkt, u32 mode); void pkt_sys_ping(struct hfi_sys_ping_pkt *pkt, u32 cookie); -void pkt_sys_image_version(struct hfi_sys_get_property_pkt *pkt); +void pkt_sys_image_version(struct hfi_sys_get_version_pkt *pkt); int pkt_sys_ssr_cmd(struct hfi_sys_test_ssr_pkt *pkt, u32 trigger_type); int pkt_session_init(struct hfi_session_init_pkt *pkt, void *cookie, u32 session_type, u32 codec); diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index f9437b6412b9..745c2c0c0d55 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1142,7 +1142,7 @@ static int venus_core_init(struct venus_core *core) { struct venus_hfi_device *hdev = to_hfi_priv(core); struct device *dev = core->dev; - struct hfi_sys_get_property_pkt version_pkt; + struct hfi_sys_get_version_pkt version_pkt; struct hfi_sys_init_pkt pkt; int ret;