Message ID | 20240220195348.1270854-2-quic_abhinavk@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-73622-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp631166dyc; Tue, 20 Feb 2024 11:54:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXd1bgCDA+oIEZmZB+HHs/gofxzcjQRhMA/t16mAC1JTzfTtMtB3byV09bNxNmmBR5vmnQ1cvPMT4W8QA3h+6KN3Qu1dA== X-Google-Smtp-Source: AGHT+IEVIBVI75cXA42+2NwvYA9uyKHZYXf1LGiOadIdenbvMJTDqzs7yWaNvn1ZK8jE36RywwU2 X-Received: by 2002:a05:6218:260d:b0:178:8669:9d31 with SMTP id oy13-20020a056218260d00b0017886699d31mr18562062rwc.1.1708458874316; Tue, 20 Feb 2024 11:54:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708458874; cv=pass; d=google.com; s=arc-20160816; b=rRvKC+XfqFzR6zNtG6nbZDEpdZKWBgRRckv9IJGNQAlWP61PreOiCEFJCqI+41BgDj LCvdg2KtHRFK2/KblkVBQe8MrdZN726i81FJ9TgupSqV0OrZN6tyL6Bem29ttahIWBQ5 stfKVYMu/TckRqOXnN6Ixb6wEtuG6FUHykRKTv+RFL8M2m901sUvcE4+awgrzaftQmOI RqLXeswLh6lgpQRgaoBfPULcuOFTSxUV5AtWsjNCQvGPVLB+SA55O3df3QQkRWOZWmZ7 TFmTfJJAarfh8PrIe/aKqS3e6ShB3CbpQYeWEmdHhwYMg4kVCIo+jfb34U9IvMk6nhF3 pGtQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=kMBGN4lkN2oMFK9YeeSBL21U79zoUeATlaYcPPlP7IA=; fh=jkkot3vQwRdh7ZCFqr69BTjy6RVP37XrlzFJqwqUX3Q=; b=qov/4d7BVp1cmoW9hJAefVtxiu8n+eQ0NWlEyx2ozhxVKYun5b0LXQXytFbl+Cj4qs nKIl7N1rvrln9YYfVLOWfEtutIV2Lygo6FV15yYFpaq8pCZ1uKqk6Plv4xhPapztvlG0 UwWYmpvXSBiNxbwsfOk6A7IPkfzmxNaBsqa5Dzha5fLJRxgtBPJc0GJgZG96FaWcGVUn UsLvDLD351S+y12I3uyWgaBsAN7pKGHdjAnkzW3a0rpNICDasJMVpyMyCjz9pCzEKq97 y0azgzygb/j16jqmW0QsGnsGTkae9msFevZrwHqD8j5YKIQfQiUlYpJIueyI+R6Amc5x TUDQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=MF31SjYL; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-73622-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73622-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id b13-20020a63340d000000b005d8bf0a91besi6452196pga.276.2024.02.20.11.54.34 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 11:54:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73622-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=MF31SjYL; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-73622-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73622-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1237528599B for <ouuuleilei@gmail.com>; Tue, 20 Feb 2024 19:54:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7F45814AD2B; Tue, 20 Feb 2024 19:54:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="MF31SjYL" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 382DE6BFB8 for <linux-kernel@vger.kernel.org>; Tue, 20 Feb 2024 19:54:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708458851; cv=none; b=VmC5BmegnBepeaPOrTR3yflRFwNWrSw4/EtoZrM58jUYjsw1WOSucJeBkwZCcfTEToGoTN0ZbB5/UQXp81AzWYsD8JS4qpQqrSvM+cXvh5veizCDhuUXmraQsIRcFMwfnA9X3sbrs+8PYmNVODsSMtLFQndzlHmROSHsBGGw66c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708458851; c=relaxed/simple; bh=ofcmBlB61pfncK+lqFFnuyb5wHG6ps7OOLOSVhveehs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DYxaHdz6zqLHRfq9nBfcCGpNORChVslctWLZ1Z+BAAEInfTHMP2kLMr9Rp9zfj3Cenx+jOtk4qTF45Ljt7G3Dd8ktlwokeNsgUe4WzcqS4fkRZ86JjU+Tu2Kdnki9qh6Kcaw0V09o905vQHgp4zLQCz0lnY2oAeq17n3yLQLqK4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=MF31SjYL; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41KJCd5p000605; Tue, 20 Feb 2024 19:54:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=kMBGN4lkN2oMFK9YeeSBL21U79zoUeATlaYcPPlP7IA=; b=MF 31SjYLFCPOavY+iHqNC7LEiE0bFiu3Es+3fp9U9+ch0n7hU8W9ckeHWW9H3/hhns Qf8V3e4VZSPLJYh+cHzFTHcQN4W/wpKP2yykTlFUD5FCuL0lQFsc1LEoJ2JmQPkT WZXm/yXljyetwm2CQCX2q3SkNDe923tKBJlHJQjGHzW2YmdTegr/O/gT2imann5K eWRCKNsLPCmDD1Uev3MHtzzasa8d0KesKj1ifaOcY6ZowHHif+xXY6YDhQ6RuFtT vdRPhVeB1GL7E60IRV6MDRLcub4ycC4c2ZSUooKzZZPoGDvIFyE7lAGaTqkzzRiN s6bTT1QOs1Qw5FcQKTKg== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wd21s02t3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Feb 2024 19:54:01 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41KJs0wJ007926 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Feb 2024 19:54:00 GMT Received: from abhinavk-linux1.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 20 Feb 2024 11:53:59 -0800 From: Abhinav Kumar <quic_abhinavk@quicinc.com> To: <dri-devel@lists.freedesktop.org>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Jani Nikula <jani.nikula@linux.intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> CC: Abhinav Kumar <quic_abhinavk@quicinc.com>, <robdclark@gmail.com>, <freedreno@lists.freedesktop.org>, <dmitry.baryshkov@linaro.org>, <intel-gfx@lists.freedesktop.org>, <ville.syrjala@linux.intel.com>, <quic_jesszhan@quicinc.com>, <linux-kernel@vger.kernel.org>, <intel-xe@lists.freedesktop.org> Subject: [PATCH v3 2/2] drm/dp: drop the size parameter from drm_dp_vsc_sdp_pack() Date: Tue, 20 Feb 2024 11:53:47 -0800 Message-ID: <20240220195348.1270854-2-quic_abhinavk@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240220195348.1270854-1-quic_abhinavk@quicinc.com> References: <20240220195348.1270854-1-quic_abhinavk@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: -kJVHc1oYzxBTxEza_WBzv1l8isSsmoE X-Proofpoint-GUID: -kJVHc1oYzxBTxEza_WBzv1l8isSsmoE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-20_06,2024-02-20_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 impostorscore=0 mlxscore=0 suspectscore=0 phishscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402200142 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791448972473563340 X-GMAIL-MSGID: 1791448972473563340 |
Series |
[v3,1/2] drm/dp: move intel_dp_vsc_sdp_pack() to generic helper
|
|
Commit Message
Abhinav Kumar
Feb. 20, 2024, 7:53 p.m. UTC
Currently the size parameter of drm_dp_vsc_sdp_pack() is always
the size of struct dp_sdp. Hence lets drop this parameter and
use sizeof() directly.
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
---
drivers/gpu/drm/display/drm_dp_helper.c | 8 ++------
drivers/gpu/drm/i915/display/intel_dp.c | 3 +--
include/drm/display/drm_dp_helper.h | 3 +--
3 files changed, 4 insertions(+), 10 deletions(-)
Comments
On Tue, 20 Feb 2024 at 21:54, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote: > > Currently the size parameter of drm_dp_vsc_sdp_pack() is always > the size of struct dp_sdp. Hence lets drop this parameter and > use sizeof() directly. > > Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> > Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com> > --- > drivers/gpu/drm/display/drm_dp_helper.c | 8 ++------ > drivers/gpu/drm/i915/display/intel_dp.c | 3 +-- > include/drm/display/drm_dp_helper.h | 3 +-- > 3 files changed, 4 insertions(+), 10 deletions(-) Thank you! Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
On Tue, Feb 20, 2024 at 11:53:47AM -0800, Abhinav Kumar wrote: > Currently the size parameter of drm_dp_vsc_sdp_pack() is always > the size of struct dp_sdp. Hence lets drop this parameter and > use sizeof() directly. > > Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> > Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com> > --- > drivers/gpu/drm/display/drm_dp_helper.c | 8 ++------ > drivers/gpu/drm/i915/display/intel_dp.c | 3 +-- Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com> > include/drm/display/drm_dp_helper.h | 3 +-- > 3 files changed, 4 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c > index 6c91f400ecb1..10ee82e34de7 100644 > --- a/drivers/gpu/drm/display/drm_dp_helper.c > +++ b/drivers/gpu/drm/display/drm_dp_helper.c > @@ -2918,19 +2918,15 @@ EXPORT_SYMBOL(drm_dp_vsc_sdp_log); > * @vsc: vsc sdp initialized according to its purpose as defined in > * table 2-118 - table 2-120 in DP 1.4a specification > * @sdp: valid handle to the generic dp_sdp which will be packed > - * @size: valid size of the passed sdp handle > * > * Returns length of sdp on success and error code on failure > */ > ssize_t drm_dp_vsc_sdp_pack(const struct drm_dp_vsc_sdp *vsc, > - struct dp_sdp *sdp, size_t size) > + struct dp_sdp *sdp) > { > size_t length = sizeof(struct dp_sdp); > > - if (size < length) > - return -ENOSPC; > - > - memset(sdp, 0, size); > + memset(sdp, 0, sizeof(struct dp_sdp)); > > /* > * Prepare VSC Header for SU as per DP 1.4a spec, Table 2-119 > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c > index a9458df475e2..e13121dc3a03 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp.c > +++ b/drivers/gpu/drm/i915/display/intel_dp.c > @@ -4181,8 +4181,7 @@ static void intel_write_dp_sdp(struct intel_encoder *encoder, > > switch (type) { > case DP_SDP_VSC: > - len = drm_dp_vsc_sdp_pack(&crtc_state->infoframes.vsc, &sdp, > - sizeof(sdp)); > + len = drm_dp_vsc_sdp_pack(&crtc_state->infoframes.vsc, &sdp); > break; > case HDMI_PACKET_TYPE_GAMUT_METADATA: > len = intel_dp_hdr_metadata_infoframe_sdp_pack(dev_priv, > diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h > index 8474504d4c88..1f41994796d3 100644 > --- a/include/drm/display/drm_dp_helper.h > +++ b/include/drm/display/drm_dp_helper.h > @@ -812,7 +812,6 @@ int drm_dp_bw_overhead(int lane_count, int hactive, > int bpp_x16, unsigned long flags); > int drm_dp_bw_channel_coding_efficiency(bool is_uhbr); > > -ssize_t drm_dp_vsc_sdp_pack(const struct drm_dp_vsc_sdp *vsc, > - struct dp_sdp *sdp, size_t size); > +ssize_t drm_dp_vsc_sdp_pack(const struct drm_dp_vsc_sdp *vsc, struct dp_sdp *sdp); > > #endif /* _DRM_DP_HELPER_H_ */ > -- > 2.34.1 >
On Tue, Feb 20, 2024 at 11:53:47AM -0800, Abhinav Kumar wrote: > Currently the size parameter of drm_dp_vsc_sdp_pack() is always > the size of struct dp_sdp. Hence lets drop this parameter and > use sizeof() directly. > > Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> > Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com> it looks indeed an unecessary check. you can convert my ack to a Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> and the ack to take this through drm-misc if needed > --- > drivers/gpu/drm/display/drm_dp_helper.c | 8 ++------ > drivers/gpu/drm/i915/display/intel_dp.c | 3 +-- > include/drm/display/drm_dp_helper.h | 3 +-- > 3 files changed, 4 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c > index 6c91f400ecb1..10ee82e34de7 100644 > --- a/drivers/gpu/drm/display/drm_dp_helper.c > +++ b/drivers/gpu/drm/display/drm_dp_helper.c > @@ -2918,19 +2918,15 @@ EXPORT_SYMBOL(drm_dp_vsc_sdp_log); > * @vsc: vsc sdp initialized according to its purpose as defined in > * table 2-118 - table 2-120 in DP 1.4a specification > * @sdp: valid handle to the generic dp_sdp which will be packed > - * @size: valid size of the passed sdp handle > * > * Returns length of sdp on success and error code on failure > */ > ssize_t drm_dp_vsc_sdp_pack(const struct drm_dp_vsc_sdp *vsc, > - struct dp_sdp *sdp, size_t size) > + struct dp_sdp *sdp) > { > size_t length = sizeof(struct dp_sdp); > > - if (size < length) > - return -ENOSPC; > - > - memset(sdp, 0, size); > + memset(sdp, 0, sizeof(struct dp_sdp)); > > /* > * Prepare VSC Header for SU as per DP 1.4a spec, Table 2-119 > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c > index a9458df475e2..e13121dc3a03 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp.c > +++ b/drivers/gpu/drm/i915/display/intel_dp.c > @@ -4181,8 +4181,7 @@ static void intel_write_dp_sdp(struct intel_encoder *encoder, > > switch (type) { > case DP_SDP_VSC: > - len = drm_dp_vsc_sdp_pack(&crtc_state->infoframes.vsc, &sdp, > - sizeof(sdp)); > + len = drm_dp_vsc_sdp_pack(&crtc_state->infoframes.vsc, &sdp); > break; > case HDMI_PACKET_TYPE_GAMUT_METADATA: > len = intel_dp_hdr_metadata_infoframe_sdp_pack(dev_priv, > diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h > index 8474504d4c88..1f41994796d3 100644 > --- a/include/drm/display/drm_dp_helper.h > +++ b/include/drm/display/drm_dp_helper.h > @@ -812,7 +812,6 @@ int drm_dp_bw_overhead(int lane_count, int hactive, > int bpp_x16, unsigned long flags); > int drm_dp_bw_channel_coding_efficiency(bool is_uhbr); > > -ssize_t drm_dp_vsc_sdp_pack(const struct drm_dp_vsc_sdp *vsc, > - struct dp_sdp *sdp, size_t size); > +ssize_t drm_dp_vsc_sdp_pack(const struct drm_dp_vsc_sdp *vsc, struct dp_sdp *sdp); > > #endif /* _DRM_DP_HELPER_H_ */ > -- > 2.34.1 >
diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c index 6c91f400ecb1..10ee82e34de7 100644 --- a/drivers/gpu/drm/display/drm_dp_helper.c +++ b/drivers/gpu/drm/display/drm_dp_helper.c @@ -2918,19 +2918,15 @@ EXPORT_SYMBOL(drm_dp_vsc_sdp_log); * @vsc: vsc sdp initialized according to its purpose as defined in * table 2-118 - table 2-120 in DP 1.4a specification * @sdp: valid handle to the generic dp_sdp which will be packed - * @size: valid size of the passed sdp handle * * Returns length of sdp on success and error code on failure */ ssize_t drm_dp_vsc_sdp_pack(const struct drm_dp_vsc_sdp *vsc, - struct dp_sdp *sdp, size_t size) + struct dp_sdp *sdp) { size_t length = sizeof(struct dp_sdp); - if (size < length) - return -ENOSPC; - - memset(sdp, 0, size); + memset(sdp, 0, sizeof(struct dp_sdp)); /* * Prepare VSC Header for SU as per DP 1.4a spec, Table 2-119 diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index a9458df475e2..e13121dc3a03 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -4181,8 +4181,7 @@ static void intel_write_dp_sdp(struct intel_encoder *encoder, switch (type) { case DP_SDP_VSC: - len = drm_dp_vsc_sdp_pack(&crtc_state->infoframes.vsc, &sdp, - sizeof(sdp)); + len = drm_dp_vsc_sdp_pack(&crtc_state->infoframes.vsc, &sdp); break; case HDMI_PACKET_TYPE_GAMUT_METADATA: len = intel_dp_hdr_metadata_infoframe_sdp_pack(dev_priv, diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h index 8474504d4c88..1f41994796d3 100644 --- a/include/drm/display/drm_dp_helper.h +++ b/include/drm/display/drm_dp_helper.h @@ -812,7 +812,6 @@ int drm_dp_bw_overhead(int lane_count, int hactive, int bpp_x16, unsigned long flags); int drm_dp_bw_channel_coding_efficiency(bool is_uhbr); -ssize_t drm_dp_vsc_sdp_pack(const struct drm_dp_vsc_sdp *vsc, - struct dp_sdp *sdp, size_t size); +ssize_t drm_dp_vsc_sdp_pack(const struct drm_dp_vsc_sdp *vsc, struct dp_sdp *sdp); #endif /* _DRM_DP_HELPER_H_ */