From owner-freebsd-embedded@FreeBSD.ORG Thu Sep 5 23:14:15 2013 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 257C4726; Thu, 5 Sep 2013 23:14:15 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8FF8E2740; Thu, 5 Sep 2013 23:14:14 +0000 (UTC) Received: by mail-wi0-f182.google.com with SMTP id ez12so183781wid.9 for ; Thu, 05 Sep 2013 16:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Tj8+bBB1rW4MiYXuQv4ouKdqUkz3GdI7iRFuIongQEw=; b=WfivfXajtZNYItBsVxAU8waLW95qsGTLTIxJLrg9FjRzi7sNxd8NFOP8HgFxRmMrwX QapOoK0yq3Bpj8dXUoVBeseFpp883eg4R4933x36CWMQsiNRCfaz+oP7Pr9PUVSaS5Zc PWzWc5W7u1cjoBcBu41HqxDyseasrRe1HC6wAfTPICRYEi7zLCWsFgd6yM4E1Z9fAjSr 11MdN1XCUwM5SAV7hAQ5fkfFK8SJEqbHmb5+FODvCrnxJ6Xm141iOTEM6Z4eVwm8eJc4 THpdrnuBS58p9vYMs8QsyAjbzawctELCNrNg5fREAMKBZ8z4IEAYVc43PctFU7ALCXsz nghg== MIME-Version: 1.0 X-Received: by 10.180.37.164 with SMTP id z4mr8171828wij.30.1378422853047; Thu, 05 Sep 2013 16:14:13 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.73.133 with HTTP; Thu, 5 Sep 2013 16:14:12 -0700 (PDT) In-Reply-To: <1378421252.1647.21.camel@localhost> References: <1378420702.1647.18.camel@localhost> <1378421252.1647.21.camel@localhost> Date: Thu, 5 Sep 2013 16:14:12 -0700 X-Google-Sender-Auth: aHJvYRjVzBQWBZuVSyxRlgYwrQA Message-ID: Subject: Re: off by one error, maxpins From: Adrian Chadd To: Sean Bruno Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-embedded X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Sep 2013 23:14:15 -0000 Commit ahoy. :) -a On 5 September 2013 15:47, Sean Bruno wrote: > On Thu, 2013-09-05 at 16:42 -0600, Warner Losh wrote: > > Shouldn't npins and/or maxpin just be bumped by 1 instead? > > > > Warner > > > > On Sep 5, 2013, at 4:38 PM, Sean Bruno wrote: > > > > > http://people.freebsd.org/~sbruno/maxpin_plus_one.txt > > > > > It looks like its *intentionally* assigned as the h/w specific (GPIO > COUNT) -1 in ar71xx_gpio_pin_max() > > Userland assumes that this value is a 0-based thing. >