From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3496C02182 for ; Thu, 23 Jan 2025 18:48:51 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.97.1) (envelope-from ) id 1tb1ws-000000003Es-1QwY; Thu, 23 Jan 2025 13:29:02 -0500 Received: from fout-a6-smtp.messagingengine.com ([103.168.172.149]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from ) id 1tb1rw-0000000036j-44yH for kernelnewbies@kernelnewbies.org; Thu, 23 Jan 2025 13:23:57 -0500 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.phl.internal (Postfix) with ESMTP id 273BB1380206; Thu, 23 Jan 2025 13:23:37 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Thu, 23 Jan 2025 13:23:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1737656617; x=1737743017; bh=AYNOAwX9ZNzydCCpLMsXzQuF/n2P7ZACqGGIQySR8Cw=; b= auYhftp+gR9PysGo+7uqJsKD1J/E6TYEzCNue83wunrN46J/QCDCP/mmwTdMyGIi WOa0SDutpTxLQ2i4pek/B8XYys1K+dv+AA4w6HqNZYrEnbXcmL0nFHlyJmWiRzv/ oYmOcs53Asj2JxaO+sYD+z/1/zpO3MuzNAdijAMMPxFeeTMKj83VBJju1RmQOIeJ yb4guqaK6PXolkRNGR+9hztWkNzYPpx3mJbEI8Xk2c2F2IhnWQI5CQ8vzrBepplr 8LhiapfDC27yaDn5LobzISQBnOdqXVj+IkTuicnIvac/8yp2isJw5xfol5sfWj4i mCstuAHac9/D/+uCQoyrGA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1737656617; x= 1737743017; bh=AYNOAwX9ZNzydCCpLMsXzQuF/n2P7ZACqGGIQySR8Cw=; b=s yF2BRBI7pydxJGtopzbyauljfU0CJdnTKQorrOS+O/s42o7pR2vP6fP8NfYEkM5g 4xh/dZUnxnY7KAisUoP5xv7AQbi3aAPJR0lFWBrxjT+1s/gUxyYyH+G8xouoatwW oiC6CO33vcIGlHZrOA6hYg6Pa5oLc30qPBiUDp37KSBLTLsUulJFhLJ16p4dHz0Q h9RSfWvyWbxX03CnEWSQ9QCYxfiWpRLUKB4w6n+tgXVbl9nfjWlD7BtfKipXVyIb mqqcmmR2tPRDmT/ban350FkiAsnq1l9bXz4fP6Sk8EGEO096LF3YSJ4WfnHWWYf/ YsASRVFwuRCvPD8itO3Og== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedgvdefjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfhfgggtugfgjgesthekredttddt udenucfhrhhomhepifhrvghgucfmjfcuoehgrhgvgheskhhrohgrhhdrtghomheqnecugg ftrfgrthhtvghrnhepleehheduudeugeegjefgheeuudffheevueekgfekueefledtjeet ieeutdekkeelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepghhrvghgsehkrhhorghhrdgtohhmpdhnsggprhgtphhtthhopeegpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopegrlhgvgiesvgguthdrtghomhdprhgtphhtthhope hkvghrnhgvlhhnvgifsghivghssehkvghrnhgvlhhnvgifsghivghsrdhorhhg X-ME-Proxy: Feedback-ID: i787e41f1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 23 Jan 2025 13:23:36 -0500 (EST) Date: Thu, 23 Jan 2025 19:23:33 +0100 From: Greg KH To: Alex Hogen Subject: Re: Typecasting a void pointer to unsigned long in zsmalloc.c Message-ID: <2025012338-macarena-caliber-17e6@gregkh> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Cc: "kernelnewbies@kernelnewbies.org" X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: kernelnewbies-bounces@kernelnewbies.org On Thu, Jan 23, 2025 at 05:58:10PM +0000, Alex Hogen wrote: > >> Shouldn't there be a special type for doing this type of conversion? > = > > That type is "unsigned long" :) > = > Wouldn't "uintptr_t"=A0be a more explicit type for storing pointer addres= ses as integers? It seems to me it has the advantage of expressing intent b= etter for us human readers. See . Yes, it is currently defin= ed as an "unsigned long." "unitptr_t" came years, if not decades, after the policy of "a pointer fits into an unsigned long" was the rule (i.e. from the very first release of Linux. And those crazy _t types are for userspace code, don't use them in the kernel, there's no need. thanks, greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies