From owner-dev-commits-src-all@freebsd.org Wed Mar 3 16:11:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C323856F085; Wed, 3 Mar 2021 16:11:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrJrr5DYXz4Str; Wed, 3 Mar 2021 16:11:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4F054945; Wed, 3 Mar 2021 16:11:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 123GB8Rk024815; Wed, 3 Mar 2021 16:11:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 123GB8xe024814; Wed, 3 Mar 2021 16:11:08 GMT (envelope-from git) Date: Wed, 3 Mar 2021 16:11:08 GMT Message-Id: <202103031611.123GB8xe024814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: 622d17da46eb - main - arm64: mv_ap806_gicp: Fix spi_ranges_cnt MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 622d17da46eb360c3d6847e4da8dbb166b775d14 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 16:11:08 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=622d17da46eb360c3d6847e4da8dbb166b775d14 commit 622d17da46eb360c3d6847e4da8dbb166b775d14 Author: Zyta Szpak AuthorDate: 2021-02-19 14:31:45 +0000 Commit: Marcin Wojtas CommitDate: 2021-03-03 16:08:12 +0000 arm64: mv_ap806_gicp: Fix spi_ranges_cnt Previously the spi_ranges_cnt stored the table size in bytes instead of the number of elements. Fix that. Reviewed by: mmel Submitted by: Zyta Szpak Obtained from: Semihalf Sponsored by: Marvell --- sys/arm/mv/mv_ap806_gicp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/arm/mv/mv_ap806_gicp.c b/sys/arm/mv/mv_ap806_gicp.c index da93a32f2b23..0a1a69707956 100644 --- a/sys/arm/mv/mv_ap806_gicp.c +++ b/sys/arm/mv/mv_ap806_gicp.c @@ -107,8 +107,8 @@ mv_ap806_gicp_attach(device_t dev) return (ENXIO); } - sc->spi_ranges_cnt = OF_getencprop_alloc(node, "marvell,spi-ranges", - (void **)&sc->spi_ranges); + sc->spi_ranges_cnt = OF_getencprop_alloc_multi(node, "marvell,spi-ranges", + sizeof(*sc->spi_ranges), (void **)&sc->spi_ranges); xref = OF_xref_from_node(node); if (intr_pic_register(dev, xref) == NULL) { @@ -153,7 +153,7 @@ mv_ap806_gicp_convert_map_data(struct mv_ap806_gicp_softc *sc, sc->parent_map_data->cells[2] = irq_type; /* Map the interrupt number to SPI number */ - for (i = 0; i < sc->spi_ranges_cnt / 2; i += 2) { + for (i = 0; i < sc->spi_ranges_cnt; i += 2) { if (irq_num < sc->spi_ranges[i + 1]) { irq_num += sc->spi_ranges[i]; break;