From owner-freebsd-arm@freebsd.org Sat Jan 23 06:34:17 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C556BA8ECEF for ; Sat, 23 Jan 2016 06:34:17 +0000 (UTC) (envelope-from sgalabov@gmail.com) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E9A71BCE for ; Sat, 23 Jan 2016 06:34:17 +0000 (UTC) (envelope-from sgalabov@gmail.com) Received: by mail-wm0-x22e.google.com with SMTP id n5so10618346wmn.0 for ; Fri, 22 Jan 2016 22:34:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:date:message-id :cc:to:mime-version; bh=E0g4Jxj5/0kGUudHPCoqnmaaW+vP8TSf0X4LvrXOcu0=; b=0CxauCJiyJJMHdRZ6R2Ut6oJOUzK8gz8X8C2LjUSzB9ONM3bhByirlhx0yML2prlf+ vVYnulXW6mFouAOOxPOQ8P0AM2FH7LlZqnH1/3UgBuT+Ahd7bfu17pdRDVlYEy9Og5nB /S73lZrbNTzwU05hyyLYPoAfw4O6dppw7lK4vSK0tnG7AYfYjJlnPEuDIhj0NdaaWZqo qZdnLU1hCc94O1rkn1gGqwoiyb0rum+bq7K03XGvgb4pdMU111hanSEfzizwrourSF0V fs9GeXUprJnbdIzlJ9VDB7VnZC3VXD75Og8iQin61jliwzwQFkRQkNE/DklRMTfZ34pY iX6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:content-transfer-encoding :subject:date:message-id:cc:to:mime-version; bh=E0g4Jxj5/0kGUudHPCoqnmaaW+vP8TSf0X4LvrXOcu0=; b=bM6jhlhM7giZEk/hH0ybXLEWCSBxLZqQWhwEiH798EXtaQMRbDsKVILtsWCkw0wShW 0t9o1o3k4WJsn7b5FQJaSHPWpZ/e1IESIGGZHCy91lnsUitaqX9MmcTnelfM0g+C2/2p etgCLYYFx0xdp4efzICF5NbkjpP81AkgljII9T+lyaWex+YQy9ufoJ1cH+8P6YDk13rk qTAfB+UMTjCa17QxrnIxWtvHrszfUk/1BBCA5tbl9bKAFkRehOjZR/yNmT+P/5kRGMNO Mazao5HBM2KuZqhAXtwz8jcJ7nZD65Bymmn74lBEVZjTI6it5SQXPrw3I+rom//JrEka bB7g== X-Gm-Message-State: AG10YOT+b4QrIngMFQmwjHYHvqPVR2ZULWFCnhWI8Ucz8pUjKEX+sN1WoAwqW8p5Fm+Ysg== X-Received: by 10.28.140.142 with SMTP id o136mr6846782wmd.45.1453530855896; Fri, 22 Jan 2016 22:34:15 -0800 (PST) Received: from [10.0.50.9] ([94.155.70.123]) by smtp.gmail.com with ESMTPSA id l7sm8950742wjx.14.2016.01.22.22.34.14 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Jan 2016 22:34:15 -0800 (PST) From: Stanislav Galabov Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: [patch] Teach ofw_bus_parse_xref_list_alloc to be able to return the length of the parsed list Date: Sat, 23 Jan 2016 08:34:12 +0200 Message-Id: <6A3FDC79-6AB8-477C-8FBE-30DB3E88BF83@gmail.com> Cc: Stanislav Galabov , Adrian Chadd To: freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 9.0 \(3094\)) X-Mailer: Apple Mail (2.3094) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 06:34:17 -0000 Hi all, I=E2=80=99ve just opened the following PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206516 The patch, attached to the PR, basically suggests a way to obtain the = length of the list parsed by ofw_bus_parse_xref_list_alloc in advance = (e.g., without having to iterate until we get an error or a NULL = result). This would be useful in cases where we don=E2=80=99t know what = the length of the list would be, but we need to get all its parsed = entries and store a reference to them somewhere (e.g., a device=E2=80=99s = softc). This would be useful in particular for my Ralink/Mediatek MIPS work, = since there are, for example, chips in this family, that need to = enable/disable 2 clocks for USB and then there are others that only need = 1. The same goes for resets. Best wishes, Stanislav=