Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2225984/?format=api
{ "id": 2225984, "url": "http://patchwork.ozlabs.org/api/patches/2225984/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260422012041.39933-3-vfazio@gmail.com/", "project": { "id": 42, "url": "http://patchwork.ozlabs.org/api/projects/42/?format=api", "name": "Linux GPIO development", "link_name": "linux-gpio", "list_id": "linux-gpio.vger.kernel.org", "list_email": "linux-gpio@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260422012041.39933-3-vfazio@gmail.com>", "list_archive_url": null, "date": "2026-04-22T01:20:34", "name": "[libgpiod,2/9] bindings: python: avoid PyObject_CallMethod during chip finalize", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "edde3d426bf06ad24f35aa5c2e8569e20f99b198", "submitter": { "id": 78694, "url": "http://patchwork.ozlabs.org/api/people/78694/?format=api", "name": "Vincent Fazio", "email": "vfazio@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260422012041.39933-3-vfazio@gmail.com/mbox/", "series": [ { "id": 500906, "url": "http://patchwork.ozlabs.org/api/series/500906/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=500906", "date": "2026-04-22T01:20:32", "name": "bindings: python: modernize C extensions", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/500906/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2225984/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2225984/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-gpio+bounces-35323-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-gpio@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=NIRM6Z06;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-gpio+bounces-35323-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"NIRM6Z06\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.161.44", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0hJh2wYPz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 11:21:40 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 18A8D3029253\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 01:21:00 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id EB7832D3EC7;\n\tWed, 22 Apr 2026 01:20:59 +0000 (UTC)", "from mail-oo1-f44.google.com (mail-oo1-f44.google.com\n [209.85.161.44])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 792471624C5\n\tfor <linux-gpio@vger.kernel.org>; Wed, 22 Apr 2026 01:20:58 +0000 (UTC)", "by mail-oo1-f44.google.com with SMTP id\n 006d021491bc7-66ee7b9af94so1862057eaf.0\n for <linux-gpio@vger.kernel.org>;\n Tue, 21 Apr 2026 18:20:58 -0700 (PDT)", "from Zephyrus.localdomain ([131.93.209.211])\n by smtp.gmail.com with ESMTPSA id\n 006d021491bc7-69464eeee56sm9876036eaf.8.2026.04.21.18.20.56\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 21 Apr 2026 18:20:56 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776820859; cv=none;\n b=F/sX6SFSEoCufeRat6YOFR2xQLqk0wegFyMrOgxYhx8CgsvcVpYYb7Oh2Z6S4TR4epTf7XxiGMCUcf4wfRXaYbmS8DiCuCTxtQNTSEBVomvAv3MolZof8TdM8jSMXs6wUzGT8lMeJyKOzhSXUYUr/BWkwzUoznepx5hwQz/uWDk=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776820859; c=relaxed/simple;\n\tbh=vBQiX4H+Q40tI+kXf7JLgyapPYbs/Gopdyd21AObp6o=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=V+mTmedUKxCWinEbarimLmWmQCI9UCsc5CrLVZllwyB+boqu2zxV+8IUtBoUxqQ/AoUamgoq0oKI7WShrmZquFkjwJXjyJPG8F7qLtGfLMWBoVHuZ0peY6/u5dGxHZP3Dz+e8Kr9jd+Ai47ZicEmaYVl4ekb6fmZ/pMULSRYCNw=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=NIRM6Z06; arc=none smtp.client-ip=209.85.161.44", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776820857; x=1777425657;\n darn=vger.kernel.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=e+oX+8l6WsiYQf+Ry3PGp+nmtNjVHKigsakMJwVqHaQ=;\n b=NIRM6Z06hataCKQ5n/6+RXHJQqwFF3mkYqtUc4pX5WfFSmSCb4hVRDpJOjxStKJEpN\n tVLWN9exYn50fHqQ2i+bsWGwBbpdZ3lcFeROFiVFN2P1IBTnAaCxVc2k7GSdkokMd65K\n EaCbUQjaTrmCvwwi5BuEhv50zvAL6T30XgJNDJyzXRyw6S26WzMJ7wX+RakGSalpW7/Q\n YnUo/Th9QNRm0KKcYeyX4accQVBpgS19Hzt5i0TxI3aac6APbDb7BmrIbDK/SyY2TsA8\n MTcbfKYJcK2JvtyIcchncMWQB4Sjy3BSkP82w1jRzwTqoKk9H8n00g0ZKRYXV1Vm9rig\n K9AQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776820857; x=1777425657;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=e+oX+8l6WsiYQf+Ry3PGp+nmtNjVHKigsakMJwVqHaQ=;\n b=GIu9yYfeW7zFhLuGAr0PRVN/xiGCBUDTfRTMtlZ44fOPZkM9mVwavSX2TAB+qMqMBS\n 113e+ZAaFINV1TmvCbxpDCSAZj0CKrbzv1bMTpTGqMWF42kK19rTk131F2+dpT8YXqjf\n IIm2lAWZ08HZSPH4cQ83UM4krA9pk60tJh8n8Dln9in41ErFh+4T1LY7pXWlnxcn4BYj\n V31tSoEdDDG6bW0ueGNzok2FWXzJhdZJdL3hGNHDRbzC6bXVhzQ4W7L0NVWR+K3lSCXX\n qMZ5TBXiFYPbgyrXf8tFLBhWmJqaO/GjRCo8IGUb/WCOjF0n9dCzvxf1lW46tUGNFIJG\n MRtg==", "X-Gm-Message-State": "AOJu0Yz7/qKCRAQZ4uTWIi0opDa7KzsW4az8jWqcO47ewfNZXbGx5m/1\n\tqUb96r+SwcHXfPdkZfpMYNkJmYTIeWRSSiZTnEBnSfQL0kHQi6l0QOuYG26LDA==", "X-Gm-Gg": "AeBDietCwRspTbcl4Soz1FJcvlBAzW5UkhZBPeTw9ligikbS9WrFZX8X53XCU/NHeBu\n\t/7gSXSzAWJh5K6I9dgibuLwZHLkbycwNCV16WN8Rb5fCW3bl9oZjaLo4SfNuGfG4Z+KfGytn3oJ\n\t9ZbNVKUrO5XoYbGQL/sPjPF7IBvzmYfnb1ED6Hqdg4o6ICut2YEfsbnJAjriLtv2MFfYldVtSkX\n\tGkW0OgqXQxIFBBssbgWOhaEhy/MUE1ES9HzHiU0JZjUowgUg/UouSj4yLyiFryp5Al5wN29L3PN\n\tRR3UreMY+vw1lWYXnbCxkFFK3xutrJm+iTubjksVcuDW1NRXxrJxreY6RMtDQllCGCId7LonpMi\n\tKLwoEkaCN4sLIiMkpnLv9r4KUT8qZmq5PcuDtbR0OKJO24V3KZ/39SWpJlY3AQF3suIDrpUMuKj\n\txXpC+FZLfYO+ulqSSDouHuGD1f6eCxJC4/DqBJuwkXE7if7eYZDqvkYVzeZL0n68S4cTJ21jPf", "X-Received": "by 2002:a05:6820:1909:b0:685:110:5572 with SMTP id\n 006d021491bc7-69462ee7145mr11324235eaf.29.1776820857188;\n Tue, 21 Apr 2026 18:20:57 -0700 (PDT)", "From": "Vincent Fazio <vfazio@gmail.com>", "To": "linux-gpio@vger.kernel.org", "Cc": "Vincent Fazio <vfazio@gmail.com>", "Subject": "[libgpiod][PATCH 2/9] bindings: python: avoid PyObject_CallMethod\n during chip finalize", "Date": "Tue, 21 Apr 2026 20:20:34 -0500", "Message-ID": "<20260422012041.39933-3-vfazio@gmail.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260422012041.39933-1-vfazio@gmail.com>", "References": "<20260422012041.39933-1-vfazio@gmail.com>", "Precedence": "bulk", "X-Mailing-List": "linux-gpio@vger.kernel.org", "List-Id": "<linux-gpio.vger.kernel.org>", "List-Subscribe": "<mailto:linux-gpio+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-gpio+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit" }, "content": "The PyObject_CallMethod function jumps through hoops to find the method\nto call and to build a stack (if necessary) to call a given method.\n\nIn the case of finalizing the chip object, that overhead can be avoided\nby simply sharing a function with `chip_close` to close the underlying\ngpiod_chip object.\n\nSigned-off-by: Vincent Fazio <vfazio@gmail.com>\n---\n bindings/python/gpiod/ext/chip.c | 18 ++++++++++++------\n 1 file changed, 12 insertions(+), 6 deletions(-)", "diff": "diff --git a/bindings/python/gpiod/ext/chip.c b/bindings/python/gpiod/ext/chip.c\nindex 19b3a4f..9061d23 100644\n--- a/bindings/python/gpiod/ext/chip.c\n+++ b/bindings/python/gpiod/ext/chip.c\n@@ -32,10 +32,19 @@ chip_init(chip_object *self, PyObject *args, PyObject *Py_UNUSED(ignored))\n \treturn 0;\n }\n \n+static void internal_chip_close(chip_object *self)\n+{\n+\tif (self->chip) {\n+\t\tPy_BEGIN_ALLOW_THREADS;\n+\t\tgpiod_chip_close(self->chip);\n+\t\tPy_END_ALLOW_THREADS;\n+\t\tself->chip = NULL;\n+\t}\n+}\n+\n static void chip_finalize(chip_object *self)\n {\n-\tif (self->chip)\n-\t\tPyObject_CallMethod((PyObject *)self, \"close\", \"\");\n+\tinternal_chip_close(self);\n }\n \n static PyObject *chip_path(chip_object *self, void *Py_UNUSED(ignored))\n@@ -62,10 +71,7 @@ static PyGetSetDef chip_getset[] = {\n \n static PyObject *chip_close(chip_object *self, PyObject *Py_UNUSED(ignored))\n {\n-\tPy_BEGIN_ALLOW_THREADS;\n-\tgpiod_chip_close(self->chip);\n-\tPy_END_ALLOW_THREADS;\n-\tself->chip = NULL;\n+\tinternal_chip_close(self);\n \n \tPy_RETURN_NONE;\n }\n", "prefixes": [ "libgpiod", "2/9" ] }