From nobody Fri Nov 24 18:21:22 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ScNbT02xVz524sJ; Fri, 24 Nov 2023 18:21:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ScNbS55Ljz4fXZ; Fri, 24 Nov 2023 18:21:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700850084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vN6ppuuqo2eMelQU+KqVIy0u0gQe3DySCPDvDmx+A5c=; b=VqaBS/PGuKDNM2cewisie7fGjP056qla+nzLz0fA7ArMgCFjNHfZA050fGhMHI3c0XT+3B OCDaU2M1RQuv+5W2MaxKIpcMMJR7iuKk76K7MWrKHdritMKHhV+SjZCIuVMJghkhDBZrq3 GUqs6ZyzgkmfrkN6HcQk466BMT0ipDvEwLjBoqCDs5e+B5TUNeHxPTPT8NQcKMOQtWUkeo 4JWnYYcLX3k6tUCMWh3pj9OMju086deOw8n+dwB1PfruWrbsrhsQFehUgrF0XdrTEoTHH7 z+R1i+wKqDn+gsPUmRqXFjwD9YWrmSp1P8uGvZT6O9b3wxXaEwBQF4OlVCZHJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700850084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vN6ppuuqo2eMelQU+KqVIy0u0gQe3DySCPDvDmx+A5c=; b=qGObOTq/iRRVuSr0ypbAMfQ2tKwLspqiHQKJzf/a/EEjClM73iyRb7HuL7uQLhRv88NfDR k/ML084K0mUOTRNQG9EYEXwbuOEFl/3u1ofeUUPkia79Z5B1yJqPdbEP7K3aEiClAskE0v nJVu6GevLIiIdCXxEF6NXZyfa2YJ+LtwrtFgV/U/qMl4MxM45wARSvi+lQ4neWpUwTYzCM D4UfPJrKfYBjfPrWs2HFsC4GI9bzRlxI29der7AjFSv2Ir78as2gPzJu992/nawI5uJ5Nb nSYenuLcFGNiFurValI1mu7Qcdaqfsw7jYo6URaoRXIUIltEq++PhkMSnwYMbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700850084; a=rsa-sha256; cv=none; b=WtJVYSUu/kaq22PvehCvPYep+pxKE23ewIyxenMB6ME835dGFk9xa6NxEqzHET9no2ZBjC zeTXz8Q9uFSUQGONGAmiyjbSnRseGSQwByKKW+fccfOKe0/Y5I0KjeZmqxfeTpAg2xPonD mBtqXuQXIcRcGrKBQxfOtQDp3rJ2bD7ridb14VT9SRYj4m5a/S/hEe+3P3yy11jW0pvJvu Qa0pgkDuijhc0cKYwTWM8120luzYKY/O9+frtgs0SYAs7G/o6LrWhaUfuLDqwv+itO6lQJ dL8zExrBvRxAdXvQewFEFotvb6TyVY9UXtpTRNYe0yVtYonOJ8KKVUmZpulc0Q== Received: from [IPV6:2601:648:8384:fd00:b51f:602b:c1d1:8fc9] (unknown [IPv6:2601:648:8384:fd00:b51f:602b:c1d1:8fc9]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4ScNbS1Cqmz466; Fri, 24 Nov 2023 18:21:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Fri, 24 Nov 2023 10:21:22 -0800 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 19f073c612af - main - new-bus: Add resource_validate_map_request function Content-Language: en-US To: Mitchell Horne , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202311231707.3ANH758D008755@gitrepo.freebsd.org> <48b90d6b-5772-4aba-8948-bcf8b50c9b5b@freebsd.org> From: John Baldwin In-Reply-To: <48b90d6b-5772-4aba-8948-bcf8b50c9b5b@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/23/23 9:41 AM, Mitchell Horne wrote: > > > On 11/23/23 13:07, John Baldwin wrote: >> The branch main has been updated by jhb: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=19f073c612afa0111d216e5ccab9525bfc97ec32 >> >> commit 19f073c612afa0111d216e5ccab9525bfc97ec32 >> Author: John Baldwin >> AuthorDate: 2023-11-23 17:06:24 +0000 >> Commit: John Baldwin >> CommitDate: 2023-11-23 17:06:24 +0000 >> >> new-bus: Add resource_validate_map_request function >> >> This helper function for BUS_MAP_RESOURCE performs common argument >> validation. >> >> Reviewed by: imp >> Differential Revision: https://reviews.freebsd.org/D42723 >> --- >> sys/kern/subr_bus.c | 31 +++++++++++++++++++++++++++++++ >> sys/sys/bus.h | 6 +++++- >> 2 files changed, 36 insertions(+), 1 deletion(-) >> >> diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c >> index 648394abd026..80fe182eab56 100644 >> --- a/sys/kern/subr_bus.c >> +++ b/sys/kern/subr_bus.c >> @@ -2715,6 +2715,37 @@ resource_init_map_request_impl(struct resource_map_request *args, size_t sz) >> args->memattr = VM_MEMATTR_DEVICE; >> } >> >> +int >> +resource_validate_map_request(struct resource *r, >> + struct resource_map_request *in, struct resource_map_request *out, >> + rman_res_t *startp, rman_res_t *lengthp) > > Can the function be given a top-level comment stating its purpose? This > file does a really good job providing this for the majority of its > public functions. > > Sorry to ask post-commit, but I did not see the review. Sure. I also hope to write a manpage for bus_generic_rl_* (and bus_get_resource_list) along with a second manpage for bus_generic_rman_* (and bus_get_rman) describing when they should be used. A manpage for resource_list_* might also be nice to write, but possibly a bit more work. -- John Baldwin