From owner-dev-commits-src-main@freebsd.org Wed Jan 13 11:25:18 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8A51A4D9242; Wed, 13 Jan 2021 11:25:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4DG4qf30M2z4Wl1; Wed, 13 Jan 2021 11:25:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 610FA2601CA; Wed, 13 Jan 2021 12:25:16 +0100 (CET) Subject: Re: git: bafb68265672 - main - Fix for off-by-one in GPIO driver after r368585. While at it declare the iteration variable outside the for-loop to appease older compilers. To: mmel@freebsd.org, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202101130907.10D97J6M058131@gitrepo.freebsd.org> <1bbcc331-9a7a-f2d5-a71b-28e55ef32d40@freebsd.org> From: Hans Petter Selasky Message-ID: <91d89b94-0416-44b3-2a4c-3e64b7be5f28@selasky.org> Date: Wed, 13 Jan 2021 12:25:05 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <1bbcc331-9a7a-f2d5-a71b-28e55ef32d40@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4DG4qf30M2z4Wl1 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2021 11:25:18 -0000 On 1/13/21 12:13 PM, Michal Meloun wrote: > > > On 13.01.2021 10:07, Hans Petter Selasky wrote: >> The branch main has been updated by hselasky: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=bafb682656724d06045fa494efb83a4312036f1f >> >> >> commit bafb682656724d06045fa494efb83a4312036f1f >> Author:     Hans Petter Selasky >> AuthorDate: 2021-01-12 17:46:09 +0000 >> Commit:     Hans Petter Selasky >> CommitDate: 2021-01-13 09:06:30 +0000 >> >>      Fix for off-by-one in GPIO driver after r368585. >>      While at it declare the iteration variable outside the for-loop >>      to appease older compilers. > > Why? All supported compilers are familiar with this variable > declaration. It is explicitly allowed by style (9) and makes the code > much more readable, IMHO. > Hi, Maybe I'm a bit old-fashioned, but it appears declaring variables inside for-loops is a C99 thing: https://stackoverflow.com/questions/1287863/c-for-loop-int-initial-declaration You are right, I didn't have to change that. And btw, style(9) was updated: commit 34a8e7368f3f00d4564b0b980871f73929d6b1ce Author: Warner Losh Date: Thu Jul 16 14:12:54 2020 +0000 And I didn't yet install that version :-) I'll fix. --HPS