From nobody Wed Feb 11 04:00:53 2026 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (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 7BC7F1D8A0A for ; Mon, 6 Jan 2025 08:49:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736153361; cv=none; b=OIiBNsgVp/b6ebpOGSp6AC34UI14fUD7PJV3Ya8qbD82EDsFVjqE0njXFd51A1YYDTy3I4o8n25P1QY6HoQ5Mi5SGL4jQ3hx7dX3F6yWkX6p01+wGUO0dBcFte+CrHKHejzjTXyDEWnlW7XIQc5hL+Wui9W7QsMg1UPJuFXpbvk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736153361; c=relaxed/simple; bh=/a3blq7uTO7fUJvEaGIXSRTJ4dpfb7qJYZHpImk2dVY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UdxKBHD9B5g09xVktoBmhZ+6RUct1nD/fluq5ZPcKXmTOc/ZVZYJUYS/ztcS0Bkw7TsftiIrcmKgy9V+jslsAfIUigJjDwZbB5nmGCFpPfqBAMv6NpYKzytOXaN8FXw5DjStTGPID3iZojI6nVwHE3L/PlzDKkMGoDibfCWPADE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=T2R+EdtS; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="T2R+EdtS" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-aa6a38e64e4so236425966b.0 for ; Mon, 06 Jan 2025 00:49:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736153358; x=1736758158; 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=FqYqpE74NSCIuQ6we8Kew8vkG28Edsdn09mE/ypD+oI=; b=T2R+EdtS5kGyaR8h3RcUO97TJaL9fBZWekaZkPHz3z5s8aU2U58icTwfdw1d0+AP6w Vi4j5Kbd8i8wMtlt2tuQ6DUpTgqK04f3rT+QMK5LrR93DVNnrZUGxBm+BLuNsuhix33u QwLNCEb2M61nlQPEoBIeYQTG3db3Y8QDv6apnb/jjwyj3Kb8oWX+Rgcv6diJNU7K8qrt Qdk0AXqX3EyDGjKetu1ns5vREfmIGdH4awtBEBjJNiSo3Q0NCv3sgaVFoqLZ5z3oJSTK 3FCEO2PqxbFx4QublRBbNtr/P7d6jMKsypVKH4DcNJ7OeS4Jl9H62KY7uvjsXP+0+yfi hC/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736153358; x=1736758158; 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=FqYqpE74NSCIuQ6we8Kew8vkG28Edsdn09mE/ypD+oI=; b=WlHkwd0PxafNa97RfdLKQj4rSMelt4CHk63DDn6oCg4KlZ9CWiCjQcrrILtEPbWQUi C9V84+sIIp6CJffcCRNqcC8oWsyV0L09C87QCfZmjuabBDvupF2M9WbLqLg9X1WejNT7 Cer2B9QF4qPqlaYczanmNGZcR1tm3LjwDtXqdRTBoy8OYF1+SP3YIHAGKzcCZdQDaovp a1r1COuh74zaUchT2f2tkON6sPIfNTJtyDfHPOuhTYUv7yKL4nFAJXwLMWnm1EjKqnjI drSUTA6dhPUmfEb3oxIXp1IIcZpXkkHt/PxxT9h03DAlVjEpXC0HF9KTmICKEvQ66+Xo rxww== X-Forwarded-Encrypted: i=1; AJvYcCWr4cYsjeJAr3BV1gSlOxP3SU7dhj37lOfcxi19JDGPUUv7QpFD63jTT9jZPeREEZYnbkjDCw8VTPJpQ/4=@vger.kernel.org X-Gm-Message-State: AOJu0YzvDwxtveQqqrFQG8YHNc+uVkBRhu1KPhlL0NlVOh9CKOXifttV pa8xJWd2TlSBXEzD86aaEUHG1MYN8PNaYuy6i/C1x1IeLk2lFmiW4kMfg/7x86o= X-Gm-Gg: ASbGncsbSOZvhHtKA/DHujN2VjN99L1W1/7YnN+RCtoZCQOsWPvkhspHxuHlfX6qHxt qWqyu2V9OMxCzkQP1zk07SoyiSte2h9IdN4g3Z+heX1gN4OxsO7VGCXFmnv4u8S4C6UZqQ7Y2nl FIEsNsekgHDCjMnuIKwe0Tg3Sv80qazjXIgVTZ9oi1tKzso4ErXJPxQG8e4AM6Wq4Bk15a8x/Hm sCSx+n59FofGSVwh9GDp9BeYoHR9h39i0PD5PWUf+UfXf99b9+BiLUrySH/xEmJ8HCKJ9Ov X-Google-Smtp-Source: AGHT+IH+pwK330xaahhvQucFSZxUuXVT0b0dCvqw2hihR/wXtnoUMiZ/CIdtEfAi9ckdZ9cr0u7txw== X-Received: by 2002:a17:907:3d86:b0:aa5:3e81:5abc with SMTP id a640c23a62f3a-aac2714ad32mr2069989566b.1.1736153357678; Mon, 06 Jan 2025 00:49:17 -0800 (PST) Received: from [127.0.1.1] ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e82f1d2sm2222112466b.11.2025.01.06.00.49.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 00:49:17 -0800 (PST) From: Krzysztof Kozlowski Date: Mon, 06 Jan 2025 09:49:06 +0100 Subject: [PATCH 3/4] drm/msm/dsi: Minor whitespace and style cleanup Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250106-drm-msm-cleanups-v1-3-271ff1c00795@linaro.org> References: <20250106-drm-msm-cleanups-v1-0-271ff1c00795@linaro.org> In-Reply-To: <20250106-drm-msm-cleanups-v1-0-271ff1c00795@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4972; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=/a3blq7uTO7fUJvEaGIXSRTJ4dpfb7qJYZHpImk2dVY=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBne5kGPLcMDXTAFLB7FrGzq2KBwobfDoM2Axvrj aejM+xFPaCJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZ3uZBgAKCRDBN2bmhouD 12suD/9plZkSR1GSSGcpRhCfw5+T70v5pcFayEvEVJBIDykDJm8lIN92LDQE5NBumEO11lwWxPC CZ4f/waCUhmh3Loap2GjCt4/4TxZBM1+aMK0//cTiLj7LoTR0mYfUSIjZ11gIsOPOaQwsh1CeXC yUvvzhwKVTJCm+oHioyAbm3GexCFBEn7GRx6yLHqtto5VOgMlaFh0GsUry3e6LIpIkevjZmCpGz cS+TaFatdkNFN77I2PGoi1aw3iIR82bKz7Aeu+K09XcJuNuCDZbTcgZlyRae6i4lveD+Pl7U5ir jiulukBPI60UsavcKrcTuTLAk4HCe5/t7gkYg1vhOV5ZoCe1xpxZEr15oMtZki6S9y9bSpjycyG ha3tev3HEVuUFIQhikzEOfOHkrCu0k9LgY+UZ77Lv5alOKdF6SIVlWICmhlhe5oOZTLKZPJKYlJ byShuxZrJF71LQzuuRgkWc4rr2CCgNVIdhSDA45ohfZCR98soas9LngZ/suxJdM19rW8C4tzeR7 pdkdcCPWQH3djhjBFye1+bjsiynZ/HPhGOijgIGeDZxLiFnTM0m0lmZmlWsbRANHQ//cOXMvMhu i3mvlotSNMgX/cEKm8c19rqHws8FkfadXTX6VfvoaxLTQMTwRGHBmpF/j3HxbxwdRoWxLoXOvfO bpSXOzVQ17OSjcA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Cleanup few obvious kernel coding style violations: missing or unnecessary braces in 'if-else', unnecessary break lines, incorrect breaking of long function declarations, unnecessary 'else' after a 'return'. No functional impact expected. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/dsi_host.c | 51 +++++++++++++++++++---------------= ---- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/d= si_host.c index 4a2ad04eea7359545a088bdc63907f6b3e5615bd..a3c344b75fc2e90923cd6d26df8= 7b7c05208f736 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -179,18 +179,18 @@ struct msm_dsi_host { int irq; }; =20 - static inline u32 dsi_read(struct msm_dsi_host *msm_host, u32 reg) { return readl(msm_host->ctrl_base + reg); } + static inline void dsi_write(struct msm_dsi_host *msm_host, u32 reg, u32 d= ata) { writel(data, msm_host->ctrl_base + reg); } =20 -static const struct msm_dsi_cfg_handler *dsi_get_config( - struct msm_dsi_host *msm_host) +static const struct msm_dsi_cfg_handler * +dsi_get_config(struct msm_dsi_host *msm_host) { const struct msm_dsi_cfg_handler *cfg_hnd =3D NULL; struct device *dev =3D &msm_host->pdev->dev; @@ -370,7 +370,6 @@ int dsi_link_clk_set_rate_6g(struct msm_dsi_host *msm_h= ost) return 0; } =20 - int dsi_link_clk_enable_6g(struct msm_dsi_host *msm_host) { int ret; @@ -588,7 +587,6 @@ static void dsi_calc_pclk(struct msm_dsi_host *msm_host= , bool is_bonded_dsi) =20 DBG("pclk=3D%lu, bclk=3D%lu", msm_host->pixel_clk_rate, msm_host->byte_clk_rate); - } =20 int dsi_calc_clk_rate_6g(struct msm_dsi_host *msm_host, bool is_bonded_dsi) @@ -677,8 +675,8 @@ static inline enum dsi_traffic_mode dsi_get_traffic_mod= e(const u32 mode_flags) return NON_BURST_SYNCH_EVENT; } =20 -static inline enum dsi_vid_dst_format dsi_get_vid_fmt( - const enum mipi_dsi_pixel_format mipi_fmt) +static inline enum dsi_vid_dst_format +dsi_get_vid_fmt(const enum mipi_dsi_pixel_format mipi_fmt) { switch (mipi_fmt) { case MIPI_DSI_FMT_RGB888: return VID_DST_FORMAT_RGB888; @@ -689,8 +687,8 @@ static inline enum dsi_vid_dst_format dsi_get_vid_fmt( } } =20 -static inline enum dsi_cmd_dst_format dsi_get_cmd_fmt( - const enum mipi_dsi_pixel_format mipi_fmt) +static inline enum dsi_cmd_dst_format +dsi_get_cmd_fmt(const enum mipi_dsi_pixel_format mipi_fmt) { switch (mipi_fmt) { case MIPI_DSI_FMT_RGB888: return CMD_DST_FORMAT_RGB888; @@ -1282,14 +1280,15 @@ static int dsi_cmd_dma_add(struct msm_dsi_host *msm= _host, static int dsi_short_read1_resp(u8 *buf, const struct mipi_dsi_msg *msg) { u8 *data =3D msg->rx_buf; + if (data && (msg->rx_len >=3D 1)) { *data =3D buf[1]; /* strip out dcs type */ return 1; - } else { - pr_err("%s: read data does not match with rx_buf len %zu\n", - __func__, msg->rx_len); - return -EINVAL; } + + pr_err("%s: read data does not match with rx_buf len %zu\n", + __func__, msg->rx_len); + return -EINVAL; } =20 /* @@ -1298,15 +1297,16 @@ static int dsi_short_read1_resp(u8 *buf, const stru= ct mipi_dsi_msg *msg) static int dsi_short_read2_resp(u8 *buf, const struct mipi_dsi_msg *msg) { u8 *data =3D msg->rx_buf; + if (data && (msg->rx_len >=3D 2)) { data[0] =3D buf[1]; /* strip out dcs type */ data[1] =3D buf[2]; return 2; - } else { - pr_err("%s: read data does not match with rx_buf len %zu\n", - __func__, msg->rx_len); - return -EINVAL; } + + pr_err("%s: read data does not match with rx_buf len %zu\n", + __func__, msg->rx_len); + return -EINVAL; } =20 static int dsi_long_read_resp(u8 *buf, const struct mipi_dsi_msg *msg) @@ -1366,8 +1366,9 @@ static int dsi_cmd_dma_tx(struct msm_dsi_host *msm_ho= st, int len) ret =3D -ETIMEDOUT; else ret =3D len; - } else + } else { ret =3D len; + } =20 return ret; } @@ -1435,11 +1436,12 @@ static int dsi_cmds2buf_tx(struct msm_dsi_host *msm= _host, return len; } =20 - /* for video mode, do not send cmds more than - * one pixel line, since it only transmit it - * during BLLP. - */ - /* TODO: if the command is sent in LP mode, the bit rate is only + /* + * for video mode, do not send cmds more than + * one pixel line, since it only transmit it + * during BLLP. + * + * TODO: if the command is sent in LP mode, the bit rate is only * half of esc clk rate. In this case, if the video is already * actively streaming, we need to check more carefully if the * command can be fit into one BLLP. @@ -1864,9 +1866,8 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi) int ret; =20 msm_host =3D devm_kzalloc(&pdev->dev, sizeof(*msm_host), GFP_KERNEL); - if (!msm_host) { + if (!msm_host) return -ENOMEM; - } =20 msm_host->pdev =3D pdev; msm_dsi->host =3D &msm_host->base; --=20 2.43.0