From owner-p4-projects@FreeBSD.ORG Wed Feb 3 20:47:54 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 853CA1065693; Wed, 3 Feb 2010 20:47:54 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 490FC1065672; Wed, 3 Feb 2010 20:47:54 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id E8A918FC08; Wed, 3 Feb 2010 20:47:53 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 037FFC42D2; Wed, 3 Feb 2010 21:49:21 +0100 (CET) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id C3ipFWs+RXSp; Wed, 3 Feb 2010 21:49:20 +0100 (CET) Received: from [192.168.133.14] (nat2-102.ghnet.pl [91.150.223.102]) by smtp.semihalf.com (Postfix) with ESMTPSA id 48037C41E7; Wed, 3 Feb 2010 21:49:20 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: <4B69DB88.2050502@freebsd.org> Date: Wed, 3 Feb 2010 21:47:50 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <95088A21-2657-424D-AD80-725F05F26AAB@semihalf.com> References: <201002032021.o13KLkPO006520@repoman.freebsd.org> <4B69DB88.2050502@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1077) Cc: Perforce Change Reviews Subject: Re: PERFORCE change 174261 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2010 20:47:54 -0000 On 2010-02-03, at 21:24, Nathan Whitehorn wrote: > Rafal Jaworowski wrote: >> http://p4web.freebsd.org/chv.cgi?CH=3D174261 >>=20 >> Change 174261 by raj@raj_fdt on 2010/02/03 20:20:54 >>=20 >> Bring more endian-safety for FDT uart(4) attachment. >>=20 >> Affected files ... >>=20 >> .. //depot/projects/fdt/sys/dev/uart/uart_bus_fdt.c#5 edit >>=20 >> Differences ... >>=20 >> =3D=3D=3D=3D //depot/projects/fdt/sys/dev/uart/uart_bus_fdt.c#5 = (text+ko) =3D=3D=3D=3D >>=20 >> @@ -1,5 +1,5 @@ >> /*- >> - * Copyright (c) 2009 The FreeBSD Foundation >> + * Copyright (c) 2009-2010 The FreeBSD Foundation >> * All rights reserved. >> * >> * This software was developed by Semihalf under sponsorship from >> @@ -35,11 +35,15 @@ >> #include >> #include >> +#include >> + >> #include >> #include >> #include >> #include >> +#include "../../contrib/dtc/libfdt/libfdt_env.h" >> + >> static int uart_fdt_probe(device_t); >> static device_method_t uart_fdt_methods[] =3D { >> @@ -81,8 +85,11 @@ >> sizeof(clock))) <=3D 0) >> clock =3D 0; >> + clock =3D fdt32_to_cpu(clock); >> + > Can't you just use ntoh*? As far as I know, FDT (and Open Firmware) = are defined to always use network byte order. Techinically yes, although the fdt* accessors are native for libfdt, so = I'd rather stay with uniform behaviour. Also, they are explict in name = while noth* could be a bit confusing, I think, for people not intimate = with FDT internals. Rafal