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 3B204C02182 for ; Thu, 23 Jan 2025 16:22:47 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.97.1) (envelope-from ) id 1tazdp-000000005iQ-1eH4; Thu, 23 Jan 2025 11:01:13 -0500 Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from ) id 1tazcK-000000005g3-0Cul for kernelnewbies@kernelnewbies.org; Thu, 23 Jan 2025 10:59:40 -0500 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfhigh.phl.internal (Postfix) with ESMTP id 52FE311401C7; Thu, 23 Jan 2025 10:59:20 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Thu, 23 Jan 2025 10:59:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h=cc :cc: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=1737647960; x=1737734360; bh=muyhuIntix S0pWdVoWBJVmWIqF+t33umhvB2bwtNyaQ=; b=a+yyn1gfRDkv8VimrT0UNehHm/ bFgJt+K11aIGbXtM0Laqiov5rhWqgSaIRaTowpcl65pECAGXc0WbCKvGhDM55BBP 2q7I8289TzFO8TgpC9zxbQ4Zh+myHD9GP2CtVTLfzklAfPYwaEUXHjU6obaFA8Xp TI96x6u+eLRUiqZX89Nh8AqOPEm0hRbl5ScV6s6vC3SOrf8wHHlB9WpSPI4M0Q5w 8mcbYKe8aa9uRKPk4jzE8cfRupNHceiTuA0txxx+zuL/fRIsEJbUOELUCa7ZB3HG H8yhR0vYhWqpQ2Q/f2t0gn6T6F7obc6DPyZqgT9q3MCiz2b5/zGiCDO7yZEA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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= 1737647960; x=1737734360; bh=muyhuIntixS0pWdVoWBJVmWIqF+t33umhvB 2bwtNyaQ=; b=0GdBum1JzIrQ/ey987sJYr6XcqdTOAhV/YPmXWNIWsWkzt4ZML3 0GcppZPTLDn7htZw3jVugvGbekpl9vlA5JqE7OYkyiSOTpt2+gDPK6bYDm0u1CNZ P9uYiRpAXQ/Kpz2+VZbhGT1SZsksKmt61v/OnKREyFfWKjlEoHz/Dl4Y969uFwRD SGJYLmXbmsWNJ0/qzRXo9Yn4oz8Y/FyuaeKIrWoSf9Vq1ipjoIbkjGals3rg3M59 q7dNBYB8LAfsnoTK7oaQHHdKaMLLC0/WIuetoWjZaAKb0Agal8wq3QtnNa8jJWLo U2opifaGc37lOIQSkm0LwVgcM/0UHZ4JhSw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedgvddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfhfgggtuggjsehttdertddttddv necuhfhrohhmpefirhgvghcumffjuceoghhrvghgsehkrhhorghhrdgtohhmqeenucggtf frrghtthgvrhhnpeehgedvvedvleejuefgtdduudfhkeeltdeihfevjeekjeeuhfdtueef hffgheekteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehgrhgvgheskhhrohgrhhdrtghomhdpnhgspghrtghpthhtohepgedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepshhnuggrnhgrihhlohhvsehgmhgrihhlrdgtohhmpd hrtghpthhtohepkhgvrhhnvghlnhgvfigsihgvsheskhgvrhhnvghlnhgvfigsihgvshdr ohhrgh X-ME-Proxy: Feedback-ID: i787e41f1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 23 Jan 2025 10:59:19 -0500 (EST) Date: Thu, 23 Jan 2025 16:59:18 +0100 From: Greg KH To: Sotir Danailov Subject: Re: Typecasting a void pointer to unsigned long in zsmalloc.c Message-ID: <2025012321-fool-blatantly-069a@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="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Thu, Jan 23, 2025 at 04:52:24PM +0100, Sotir Danailov wrote: > What's the guarantee that an unsigned long can hold the data > from the void pointer? This is a requirement that Linux makes for the compiler to work with it for any platform that Linux runs on. > Is this safe to do? Yes. > Shouldn't there be a special type for doing this type of conversion? That type is "unsigned long" :) thanks, greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies