Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1826508pxp; Thu, 10 Mar 2022 12:59:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5v3VtHS8z/lUyh23vzOxT1TUkSno+JYwCHzHjAJ3kQXnJglhVZnkiBnxF4M19/aRWGwzT X-Received: by 2002:a17:906:2991:b0:6cf:6b24:e92f with SMTP id x17-20020a170906299100b006cf6b24e92fmr5838870eje.748.1646945943970; Thu, 10 Mar 2022 12:59:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646945943; cv=none; d=google.com; s=arc-20160816; b=E1EgEgBAV1modWMzTzboQcJUeagSIqggogwj8QIFSWV3pg3EPLTNN2jr+APdQ55l6I mX7+e22r0nfsqYqRzpbSkmsdAaBiUZtM3DdH+outLdSpZ1W/iBCROujs4NQ4BNHQ23nr y5kjaaauk04kgHOliaoVhaX2UkTePGhUnboq734TkycTbUjnQLDf1tNX1F5q3ewbHdvZ 4WmM/jBAR97ElvdtrZzbRvNCa9ZtTFyYzRat7o0CHD2RCJuRrbi+nivQ37kkgELmsKDa jntgWm3l9SpZnyBctPt/qioB+Rub5GXkIhJ9oZcgp/k34YpcXclz6ISdm16niNGC3shL LWvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=ErK3D5PMeiTJ/NldVQn3Pkx/0U4sBl8cqz6KqGYP24U=; b=V/mLqogcO5W3kTGwb3BRNMzhT+mFyDFaqLNzlMOKNu3XNVn5rwj8d2dHronEv4FjG7 LNcCQclQrz1RqLojXmzFFZFHS216J/K4UgMnxizmP6rX2m3peam2T93VyGlZfX9frfey GztY3EJ3ArcP22B3rVwzkS1YBv3LAflqzg0Nkmv0H3YXBvZYRQRvFLJvihm0fJFA+Y3g T/piNp8lOttbzehLwM+6eagZl/oeMEs1/NTFABUG8OyDFmTKqYhXydnmSg/kyiW3ywje IGQfocNXyMhxwa5HxmY6IRWqCUyYLqKyMJxKfffFfNR+xlztrh8javnXy32XW5k057Z3 4UTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r14-20020a1709062cce00b006b8b3c04131si3535193ejr.320.2022.03.10.12.58.39; Thu, 10 Mar 2022 12:59:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245634AbiCJSzK (ORCPT + 99 others); Thu, 10 Mar 2022 13:55:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245623AbiCJSzJ (ORCPT ); Thu, 10 Mar 2022 13:55:09 -0500 Received: from mx2.smtp.larsendata.com (mx2.smtp.larsendata.com [91.221.196.228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76B47156971 for ; Thu, 10 Mar 2022 10:54:07 -0800 (PST) Received: from mail01.mxhotel.dk (mail01.mxhotel.dk [91.221.196.236]) by mx2.smtp.larsendata.com (Halon) with ESMTPS id 820433a5-a0a3-11ec-b2df-0050568cd888; Thu, 10 Mar 2022 18:54:26 +0000 (UTC) Received: from ravnborg.org (80-162-45-141-cable.dk.customer.tdc.net [80.162.45.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sam@ravnborg.org) by mail01.mxhotel.dk (Postfix) with ESMTPSA id 64B14194B61; Thu, 10 Mar 2022 19:54:03 +0100 (CET) Date: Thu, 10 Mar 2022 19:53:59 +0100 X-Report-Abuse-To: abuse@mxhotel.dk From: Sam Ravnborg To: Xin Ji Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , qwen@analogixsemi.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, mliu@analogixsemi.com, hsinyi@chromium.org, bliang@analogixsemi.com Subject: Re: [PATCH] drm/bridge: anx7625: Fix not correct get property counts Message-ID: References: <20220310091653.1298588-1-xji@analogixsemi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220310091653.1298588-1-xji@analogixsemi.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Xin, On Thu, Mar 10, 2022 at 05:16:53PM +0800, Xin Ji wrote: > The property length which returns from "of_get_property", divided by > sizeof(int) to get the total property counts. > > Fixes: fd0310b6fe7d ("drm/bridge: anx7625: add MIPI DPI input feature") > > Signed-off-by: Xin Ji > --- > drivers/gpu/drm/bridge/analogix/anx7625.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c > index c6a9a02ed762..87081d5b408d 100644 > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > @@ -1594,6 +1594,7 @@ static int anx7625_get_swing_setting(struct device *dev, > > if (of_get_property(dev->of_node, > "analogix,lane0-swing", &num_regs)) { > + num_regs /= sizeof(int); Since the property is an array maybe use: of_property_read_u8_array() Sam