From nobody Tue Jan 25 01:40:18 2022 X-Original-To: dev-commits-src-all@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 4677A19730FE; Tue, 25 Jan 2022 01:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JjV0f4XJ6z4ZgD; Tue, 25 Jan 2022 01:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643074818; 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; bh=PnAG9GSaUpoHPJJnwyyGmuK7pEkA+9IWRn3egx4i3Vk=; b=urzQ7ESwxULWRr4Be4rlPSi4bbXZlzQxD5Oy4XmLkbH5Q+BKwQ76VXxVy7pSsTForuu3VP bim/QKcLB75rJWXAa0rgZyfEGENX8IXQrVqT+/hRowQi51Qdz3V8Y3pmiW6B7dhL7xv6LM YtgKRHWFDSIy5uCpfXs/Zae6dtGn84qEcsPaE4Io2eVaJfzFhdYY+rb1bWZ8vcI79UlTXU OmufEaA/8AvhtNgVwY6P3TVitPCpppyK1BwpjEZLbNgh1pUTmaazLaX5TCaI6mMpad8wVL PimOtyoTq4HZfJxox/mOxZ8YJymezLVQUvQNTqic0ae2Pd2X1x6e0eFAvheHzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 412FE20B3C; Tue, 25 Jan 2022 01:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20P1eIDZ049798; Tue, 25 Jan 2022 01:40:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20P1eIeY049793; Tue, 25 Jan 2022 01:40:18 GMT (envelope-from git) Date: Tue, 25 Jan 2022 01:40:18 GMT Message-Id: <202201250140.20P1eIeY049793@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: f63a2e288c92 - stable/13 - intrng: Use less confusing return value for intr_pic_add_handler List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f63a2e288c92e4b21ad6cde821b42d17ef307a84 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643074818; 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; bh=PnAG9GSaUpoHPJJnwyyGmuK7pEkA+9IWRn3egx4i3Vk=; b=Q6QY8CC/wlByM8zt4ml+8PZTlV/1qDL+DCnDRzdP1QIKNaR0pfsydTvjp9jYhDsb0NBqRi QrSaRYkblnh3ymKwmxmlOmqx7H3ECJJLGNunz6IB/935zGVcGw2rPQqS9K/lwPWd10olej EayP8/w0IGVMXX9oU9xyqFATDSUfS9VttVm135Jg2Kops/wfBnfrrHKIKMMmBjKgrpgYtm dgsZNIBdy+oxh+dhNQY6+epNSNB+i4WPuyi0XsGp8y2FGJpyg1ZLoU+KdUQ/xthCcWdTdN jdCSzxWvJG9R1gJ4Odtt4IRA3EBAWTjuW2ynmS6Z5HPHNlE60v8DV0riAhhdIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643074818; a=rsa-sha256; cv=none; b=YJCQPSPWURM3JDYivtqB7sMUXJpcuoYUK/Cg1IuBXiBTtYaEZQ4Yva5gSFl5P3dCMD9R+m EkO+SpTef0zobQISzfLZHCCFaNavQCbsDoPj3kWq/vQxJhvOHHXZ3N4RphVoceBtzc8ncr U968ruxWHKPiC6muMYhAsG16X2JOlm53up5vXJ41EuiHAZ4Y1B1JwewJDDkI31rxDbVqSO 9GGsJq0ep4ir+xF1a/+SdU16X8PBUurTnWD8RHNc1YDS7eXX5Ha5cGetQzN/rupVT0MeQ1 yZtfQ3pLI9vpJdqGmkXKQc/xNHXN9jDxhjnnIJuLw1Ck2pWwrKqY31nvHbaVwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=f63a2e288c92e4b21ad6cde821b42d17ef307a84 commit f63a2e288c92e4b21ad6cde821b42d17ef307a84 Author: Jessica Clarke AuthorDate: 2022-01-03 17:08:44 +0000 Commit: Jessica Clarke CommitDate: 2022-01-24 23:59:55 +0000 intrng: Use less confusing return value for intr_pic_add_handler Currently intr_pic_add_handler either returns the PIC you gave it (which is useless and risks causing confusion about whether it's creating another PIC) or, on error, NULL. Instead, convert it to return an int error code as one would expect. Note that the only consumer of this API, arm64's gicv3_its, does not use the return value, so no uses need updating to work with the revised API. Reviewed by: markj, mmel MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D33341 (cherry picked from commit a3e828c91d34e9e00f3f99516c1e5a349e49b1d4) --- sys/kern/subr_intr.c | 6 +++--- sys/sys/intr.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index 04636f09c5a1..16306c78cbd9 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -898,7 +898,7 @@ intr_pic_claim_root(device_t dev, intptr_t xref, intr_irq_filter_t *filter, /* * Add a handler to manage a sub range of a parents interrupts. */ -struct intr_pic * +int intr_pic_add_handler(device_t parent, struct intr_pic *pic, intr_child_irq_filter_t *filter, void *arg, uintptr_t start, uintptr_t length) @@ -912,7 +912,7 @@ intr_pic_add_handler(device_t parent, struct intr_pic *pic, /* Find the parent PIC */ parent_pic = pic_lookup(parent, 0, FLAG_PIC); if (parent_pic == NULL) - return (NULL); + return (ENXIO); newchild = malloc(sizeof(*newchild), M_INTRNG, M_WAITOK | M_ZERO); newchild->pc_pic = pic; @@ -931,7 +931,7 @@ intr_pic_add_handler(device_t parent, struct intr_pic *pic, SLIST_INSERT_HEAD(&parent_pic->pic_children, newchild, pc_next); mtx_unlock_spin(&parent_pic->pic_child_lock); - return (pic); + return (0); } static int diff --git a/sys/sys/intr.h b/sys/sys/intr.h index b373a6f23bf0..8c51fe7cb504 100644 --- a/sys/sys/intr.h +++ b/sys/sys/intr.h @@ -113,7 +113,7 @@ u_int intr_irq_next_cpu(u_int current_cpu, cpuset_t *cpumask); struct intr_pic *intr_pic_register(device_t, intptr_t); int intr_pic_deregister(device_t, intptr_t); int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *, u_int); -struct intr_pic *intr_pic_add_handler(device_t, struct intr_pic *, +int intr_pic_add_handler(device_t, struct intr_pic *, intr_child_irq_filter_t *, void *, uintptr_t, uintptr_t); bool intr_is_per_cpu(struct resource *);