From patchwork Tue Jul 16 18:09:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 812781 Delivered-To: patch@linaro.org Received: by 2002:a5d:42c4:0:b0:367:895a:4699 with SMTP id t4csp435731wrr; Tue, 16 Jul 2024 11:11:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUlZeT1L5PrH+H2QI62W0KtLLYVOKRw2pixv+3EosJ6RVpwRbmv2s9RNqx83juldsnPiZXyd+l17oXODtmZ4O5C X-Google-Smtp-Source: AGHT+IEq1lipslipoIW5vYFUScOWgxFK6Os2cZ64laLlHEt7xWzxEg/7piQyEr+ohJ54Z1wJ5BRM X-Received: by 2002:a81:8784:0:b0:631:43e1:6b99 with SMTP id 00721157ae682-6637f2b7c28mr30857257b3.12.1721153504810; Tue, 16 Jul 2024 11:11:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721153504; cv=none; d=google.com; s=arc-20160816; b=DkHmuE/uxDlCVM0CZJfMNIJG3qgMwIoaAFV+KYfxVTZd6lFOg9oJacZu3fMKD6cZB6 rPihPvXCz/wwUH3zcxAhe82ALDSCNDTtZHWKpHQjchiLeAqNPTjsoX1yb3oQJqFGbdCW AuFuUHYRmZfB84vwkEz+gUE/lUCm6PJ4yji8EA3YwGgCsq2dj4cGokdXBdJ7EAVfIhxM LVrayub30DsBGtWbTbH8nWZhW48m1y5Kk1v7/VgZl76GMU9JJ06Q74wf5uIxugAw0+8J 71FqthYGuQFZ1dP8+S1uLBDSvUG47gK8zJ7LDHO0H/32MV/OkMF4gv8HCHTh3ztLISCt pluA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+f/7N8GJRq8hKRVda+Tlkh41f3Qt1aALkfzBVC63ub4=; fh=SvSSdOh/FtIuNzd1oS5IjFxss0muSWHQxcPQVOxivx8=; b=KIopUBBQNEv87cVBcx7lFhqfHfUzOTehzQ8qaqoUyz/p3DOcXQI9fGC1ZAlQrw8pdo 8K/qmYpbUZ9ttA9rSTlhiOjGVofn/WWJiufnBS9er6xRapnfDhfNpJ0DbDT/KZRkn5Ap pps/Oc/6K+PZ3tLS9cjmsPLK0I7g1PQx21u+cIqVxldcuR0mhgy13cXkt+EJ4YHK5Nyh kKmkIDklViDG/D8FW9neIerVMPJpf+8bqoLpq/ePvqdHQdYISUh7QDae1vSdmUQ6Gz27 iJWNxkZIl91BoYiRqVqwS4IR5+r11HHB674cXRZvVDaP2j1eULlmA3w2Kf9tpAxxgqd+ WFNg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V7Ct9ZN0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-44f5b79e16fsi78852001cf.215.2024.07.16.11.11.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jul 2024 11:11:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V7Ct9ZN0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTmco-0006oo-NJ; Tue, 16 Jul 2024 14:10:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTmcm-0006i6-Sp for qemu-devel@nongnu.org; Tue, 16 Jul 2024 14:10:04 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sTmcl-0000ur-22 for qemu-devel@nongnu.org; Tue, 16 Jul 2024 14:10:04 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3678aa359b7so5749f8f.1 for ; Tue, 16 Jul 2024 11:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721153401; x=1721758201; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+f/7N8GJRq8hKRVda+Tlkh41f3Qt1aALkfzBVC63ub4=; b=V7Ct9ZN03/DkPtULc0Y+htfBvdw1OfHV7TWTWk7XIeyTZKd0bXgm2NCmloWnQACBaA 4NFL8lszHMpLT3nvE2Q84L0XGWqKqkLfvKjvMRKQ5NWvFT+0duRN8CSie5a6Yc/pLF2X xjeK5a9QrUV4JU25RtnJykxKBUZUCOhIAxbBpUs5Xo9LjZ0eWW+prRhnJlv6rzBDiYHB pi5FpjzUEarIz4hZ4KmFzKMv4m6B9SPBW+p9IQaaH+gC40E9zDy2KpKFckQx/Pe9ea4V 6KRhjiOfg6R6uHGv7KV67lx/2DsPJNkfrqaMlPYg2RtZcEKxlpebcmSeWEWMZ3pCpfg6 PPMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721153401; x=1721758201; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+f/7N8GJRq8hKRVda+Tlkh41f3Qt1aALkfzBVC63ub4=; b=SmzD/M0LRiIIAWR2WdyDU8bwpdSZkqWsR3ihJf9SW0/1gxVfEpZhEbjDB9hrGZEFxN rgEshtlIRK++9hG4cLuhozutHNiHDDAd4DyQI+jmQy3YEZ4t+2sVJmDZczFXRvfNC08e 9CkpReVK6jDte2Fo3jtC/MNpCGVNkeT915C6F3snJhguh0HukigX5/SwxdBGpiwAfx2D Va86Lom+MEux5IIYSK3HYSgrXGQkxF/Zrl9B0KT2zK6DrXCA9wnewk2t+pPHge7h54RT K7phR4bdZC8lovSs9OcXIyMDHF7U0PEYJ4CK/UkRpoHmKB0L+TDfjG1pUet20ku+TQOp m21Q== X-Gm-Message-State: AOJu0Yznp3krq1e8vd1Kck9cXI2nIHZQpnjHMcQ4UBa621HhQdpMS8NN i9Fhdtp4qOXz6r8xEd4g9sgG1+j7Mm77+1DjNftjVp+q2AKxE4FT6fVqCKrnzJLMm8b/xefMber j+OsG7w== X-Received: by 2002:adf:ef86:0:b0:367:8e57:8 with SMTP id ffacd0b85a97d-36827432f95mr2270756f8f.19.1721153400814; Tue, 16 Jul 2024 11:10:00 -0700 (PDT) Received: from localhost.localdomain ([176.187.209.82]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3680dafb939sm9701924f8f.89.2024.07.16.11.09.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 16 Jul 2024 11:10:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , BALATON Zoltan , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 03/13] include/hw/qdev-core.h: Correct and clarify gpio doc comments Date: Tue, 16 Jul 2024 20:09:30 +0200 Message-ID: <20240716180941.40211-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240716180941.40211-1-philmd@linaro.org> References: <20240716180941.40211-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Peter Maydell The doc comments for the functions for named GPIO inputs and outputs had a couple of problems: * some copy-and-paste errors meant the qdev_connect_gpio_out_named() doc comment had references to input GPIOs that should be to output GPIOs * it wasn't very clear that named GPIOs are arrays and so the connect functions specify a single GPIO line by giving both the name of the array and the index within that array Fix the copy-and-paste errors and slightly expand the text to say that functions are connecting one line in a named GPIO array, not a single named GPIO line. Reported-by: BALATON Zoltan Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240708153312.3109380-1-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/qdev-core.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 5336728a23..77bfcbdf73 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -624,8 +624,9 @@ qemu_irq qdev_get_gpio_in(DeviceState *dev, int n); * @name: Name of the input GPIO array * @n: Number of the GPIO line in that array (which must be in range) * - * Returns the qemu_irq corresponding to a named input GPIO line - * (which the device has set up with qdev_init_gpio_in_named()). + * Returns the qemu_irq corresponding to a single input GPIO line + * in a named array of input GPIO lines on a device (which the device + * has set up with qdev_init_gpio_in_named()). * The @name string must correspond to an input GPIO array which exists on * the device, and the index @n of the GPIO line must be valid (i.e. * be at least 0 and less than the total number of input GPIOs in that @@ -673,15 +674,15 @@ void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin); * GPIO lines * @dev: Device whose GPIO to connect * @name: Name of the output GPIO array - * @n: Number of the anonymous output GPIO line (which must be in range) + * @n: Number of the output GPIO line within that array (which must be in range) * @input_pin: qemu_irq to connect the output line to * - * This function connects an anonymous output GPIO line on a device - * up to an arbitrary qemu_irq, so that when the device asserts that - * output GPIO line, the qemu_irq's callback is invoked. + * This function connects a single GPIO output in a named array of output + * GPIO lines on a device up to an arbitrary qemu_irq, so that when the + * device asserts that output GPIO line, the qemu_irq's callback is invoked. * The @name string must correspond to an output GPIO array which exists on * the device, and the index @n of the GPIO line must be valid (i.e. - * be at least 0 and less than the total number of input GPIOs in that + * be at least 0 and less than the total number of output GPIOs in that * array); this function will assert() if passed an invalid name or index. * * Outbound GPIO lines can be connected to any qemu_irq, but the common @@ -796,7 +797,7 @@ void qdev_init_gpio_out(DeviceState *dev, qemu_irq *pins, int n); * @dev: Device to create output GPIOs for * @pins: Pointer to qemu_irq or qemu_irq array for the GPIO lines * @name: Name to give this array of GPIO lines - * @n: Number of GPIO lines to create + * @n: Number of GPIO lines to create in this array * * Like qdev_init_gpio_out(), but creates an array of GPIO output lines * with a name. Code using the device can then connect these GPIO lines