Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3011285yba; Mon, 22 Apr 2019 17:47:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGjmr/6xCiRSTBj+WpHg63V3JDKk3f0mtsx1f6vQvW6V1zg2FDRsQtEY3E7vV1GtwAAfqU X-Received: by 2002:a62:1701:: with SMTP id 1mr23494355pfx.120.1555980442577; Mon, 22 Apr 2019 17:47:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555980442; cv=none; d=google.com; s=arc-20160816; b=OGfm85r2GLcvJ/nZ7QZaTxYmonBx1Ac2fUiHZR2uCC2VDkhxWrHcnvfkCqxTn5Iegg WcVGctBQMvGDGVKivWPiILSH5dxof8wmw5twhh0aXYoGwkEbwI3nrakG9D/YVFBLRHlJ Btxik1X5VNSyLwsda1SiLDZ7/25eSBR0nAnK2KKeO6vdKwt5G8m2PmG2DJslJH7L99lH 4FXBGhpeMXfYfmza+uBdeaTBm8mqicpD9pn/GsVSBDskLfc2nVPKL83ykRkxrbdqN7F6 F5lxDpAUEyfTefNkSBzDt29t7Qy8oPdsCjdnRYbsTcUfEy5v/ehYNpqna+QKeIsEBVRI xd3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:user-agent:message-id:to:subject :from:cc:references:in-reply-to:content-transfer-encoding :mime-version:dkim-signature; bh=eA18mVTZ0L8hnL8fFtYxqbj/ipCM+M9rhwI59GRa9Vk=; b=z1ir21eNh3JJMubRTK5TZlBeMOPJbZkkO7nK/TRU7HkpTeuNHbMWWlbYLIIwosx7Te dhoPkLRQPRiYPcKQ3cvt2fJj36VF2NwI0FkYhzoKNWkcX4W9wEN9i9cRg9XNwmiioNg7 e9supvBjB4v2UUq05cJoruVFxEFofxjHBxB69+qPdhWtdG9I5yHRBMxYkZh2rdmfsTnu v1uTWoOgF/uiSmRRuMPml5ayjVmXDT6yOxIIh0JdN9pTPTZMbeSYTJLEHZzbXW977yUA ivuxGB9IDyB4tmwojHQGF2w3kXVd/qOKDuidqBKeKChpQTTJNI5kJWlfJPDMEDLXBW0m ycXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kxgumhRq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i65si12511376plb.378.2019.04.22.17.47.06; Mon, 22 Apr 2019 17:47:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kxgumhRq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728368AbfDVUlX (ORCPT + 99 others); Mon, 22 Apr 2019 16:41:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:53950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727254AbfDVUlW (ORCPT ); Mon, 22 Apr 2019 16:41:22 -0400 Received: from localhost (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4BA4920859; Mon, 22 Apr 2019 20:41:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555965682; bh=MKOufmg1gp0O5MF4o/zzBGJXUoOn07OxqaP+2YdDMi0=; h=In-Reply-To:References:Cc:From:Subject:To:Date:From; b=kxgumhRqRdq5kUorCyX04QcQx6qluoRWT5qvllqpTD0JBlIbHj1bwfSuuE8KJU65j 0wc4gws1YhDHsUspgM2U5jn/6Qk1jfL7lDZhVkVCz/owNHzzNfpXAHxfMpyfJxa372 BtLBtUJc7Wyq1L+XiJikwdBxNAtaT9vActzKf6A0= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: Cc: Andrew Morton , "linux-kernel@vger.kernel.org" From: Stephen Boyd Subject: Re: [PATCH 1/3] scripts/gdb: Add hlist utilities To: Jan Kiszka , Kieran Bingham , Leonard Crestez Message-ID: <155596568158.15276.10057207756258850078@swboyd.mtv.corp.google.com> User-Agent: alot/0.8 Date: Mon, 22 Apr 2019 13:41:21 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Leonard Crestez (2019-04-22 01:26:56) > This allows easily examining kernel hlists in python. >=20 > Signed-off-by: Leonard Crestez Reviewed-by: Stephen Boyd > + > + > +def hlist_for_each_entry(head, gdbtype, member): > + for node in hlist_for_each(head): > + if node.type !=3D hlist_node.get_type().pointer(): > + raise TypeError("Type {} found. Expected struct hlist_head *= ." Maybe drop the full-stop? It looks weird to see struct list_head *. > + .format(node.type)) > + yield utils.container_of(node, gdbtype, member) > + > +