Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1950940rdb; Tue, 20 Feb 2024 11:54:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVuzvlVYbf7zIxJa3zB66ON1068k0NtACzyiqh85l46EQ41tOknhtr2Kh+Yplmh44jlZkXIQtRFrcrogvDd/ysh32f/glyQowQwC6eQ7w== X-Google-Smtp-Source: AGHT+IH/XuG8aRTXfLrtXvW7lRoGwIU9fF+Z7WRo6GRFBxdBpcFcF0yvllQeE2JZv8VguUu4hC0q X-Received: by 2002:ae9:c007:0:b0:787:3315:61aa with SMTP id u7-20020ae9c007000000b00787331561aamr16419739qkk.22.1708458859557; Tue, 20 Feb 2024 11:54:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708458859; cv=pass; d=google.com; s=arc-20160816; b=Q/s9lnJgHI6djSfOK7WTVI4jVCo3JvxXm1MXa5jj99PcvMhHfH0z4VTQiDWr74Qv+c rwizP5S50e3CiI0djRNb7sxsb7AridtpWzOO3ZaO7Rhum00xNYoqtJoIlG9uqHA1SMdX wBMpA2gkmgAf/09NgXX+jBEZ81cn/F4Hwy9dhs6di5ouHo/lhjMRqCXbFdtlvsksll6o MUk6parlgzWOiCQPgVsc6kfNqpi4C7zPwsLMttZcs/AkD1aGiQms/MVMfDDiHe3UfE1n 6cnr2tUSh/Bj/3I3hlqza6F8gSLj9yikFysRGUcpcVMXifO37CsO/35sz1JGgPHKzgoi 9vLA== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73622-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x17-20020a05620a0ed100b007873ca4eaaesi8866542qkm.660.2024.02.20.11.54.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 11:54:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73622-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73622-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 43B631C218DB for ; Tue, 20 Feb 2024 19:54:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8819A14A4D8; Tue, 20 Feb 2024 19:54:12 +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 ; 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 To: , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Jani Nikula , Rodrigo Vivi , Joonas Lahtinen , Tvrtko Ursulin CC: Abhinav Kumar , , , , , , , , 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: List-Subscribe: List-Unsubscribe: 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 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 Signed-off-by: Abhinav Kumar --- 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