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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8EDD8C433FE for ; Sun, 23 Oct 2022 11:30:53 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EB48D84571; Sun, 23 Oct 2022 13:30:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="CsS54+VV"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="PbkXyzEw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8AEFC84567; Sun, 23 Oct 2022 13:30:49 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 909A384CDF for ; Sun, 23 Oct 2022 13:30:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=msuchanek@suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 5595421FCD; Sun, 23 Oct 2022 11:30:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1666524646; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=asVgKcR8WVYmOCz3l9AK+INYOWIHSgZBw99bMFZUUoI=; b=CsS54+VVOSjfy5Igc42A5sWFZm6DAgChtBjd6E8xzVPj8Dytq5ZSP9gxME1+R42L+vJuwX 70xhAmbUrcrrQroEiUhfzv/HkPBfzFjZlTP14BkleLIfa1FntJcm/eHhjGTS3UuSfl3d/D 8AgXm6qMDSU0RXA6R8kaygCZyQtesRQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1666524646; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=asVgKcR8WVYmOCz3l9AK+INYOWIHSgZBw99bMFZUUoI=; b=PbkXyzEwH13lzRuItCVdOsLuc+itoOGeqrfbQkAZXTPcw715G4X2XxGpJyFa3NlLY49IvB jvFfSuEmKDZ8z/AQ== Received: from kitsune.suse.cz (kitsune.suse.cz [10.100.12.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 32D6B2C141; Sun, 23 Oct 2022 11:30:46 +0000 (UTC) Date: Sun, 23 Oct 2022 13:30:45 +0200 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Heinrich Schuchardt Cc: u-boot@lists.denx.de, Simon Glass Subject: Re: [PATCH] sandbox: Correctly define BITS_PER_LONG Message-ID: <20221023113044.GA28810@kitsune.suse.cz> References: <20221022212201.24268-1-msuchanek@suse.de> <6F205FC0-7806-484A-AE74-DED469E504FB@gmx.de> <20221023075004.GZ28810@kitsune.suse.cz> <6983f7a3-2904-ba13-25b8-0c13faea9687@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6983f7a3-2904-ba13-25b8-0c13faea9687@gmx.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On Sun, Oct 23, 2022 at 09:56:29AM +0200, Heinrich Schuchardt wrote: > On 10/23/22 09:50, Michal Suchánek wrote: > > On Sat, Oct 22, 2022 at 11:52:29PM +0200, Heinrich Schuchardt wrote: > > > > > > > > > Am 22. Oktober 2022 23:22:01 MESZ schrieb Michal Suchanek : > > > > SANDBOX_BITS_PER_LONG is the number of bits in long on the sandbox > > > > platform. > > > > > > Please, explain in the commit message what this patch is good for. > > > > For setting BITS_PER_LONG correctly. > > > > > Aren't further patches needed to make use of it? > > > > 'make ue of it' would likely by running 32bit sandbox with 64bit > > phys_addr_t, and that indeed won't be fixed by this patch alone. > > > > Nonetheless, since nobody noticed that this is broken so far I figured I > > will send the patch anyway. > > > > Thanks > > > > Michal > > > > > Best regards > > > > > > Heinrich > > > > > > > > > > > Signed-off-by: Michal Suchanek > > > > --- > > > > > > > > arch/sandbox/include/asm/types.h | 6 +----- > > > > 1 file changed, 1 insertion(+), 5 deletions(-) > > > > > > > > diff --git a/arch/sandbox/include/asm/types.h b/arch/sandbox/include/asm/types.h > > > > index c1a5d2af82..5f4b649ee3 100644 > > > > --- a/arch/sandbox/include/asm/types.h > > > > +++ b/arch/sandbox/include/asm/types.h > > > > @@ -18,11 +18,7 @@ typedef unsigned short umode_t; > > > > /* > > > > * Number of bits in a C 'long' on this architecture. > > > > */ > > > > -#ifdef CONFIG_PHYS_64BIT > > > > -#define BITS_PER_LONG 64 > CONFIG_PHYS_64BIT defines the length of phys_addr_t. > > BITS_PER_LONG is about the length of long. Sure > > The length of long is defined by the compiler. Sure > phys_addr_t exists for > having a type that is independent of the length of long. sure > > This patch is obviously wrong. That's completely contradictory to what you say above. According to that the patch is obviously right because it changes the definition of BITS_PER_LONG from depending on phys_addr_t to depending on the length of long is defined by the compiler. Thanks Michal > > Best regards > > Heinrich > > > > > -#else /* CONFIG_PHYS_64BIT */ > > > > -#define BITS_PER_LONG 32 > > > > -#endif /* CONFIG_PHYS_64BIT */ > > > > +#define BITS_PER_LONG CONFIG_SANDBOX_BITS_PER_LONG > > > > > > > > #ifdef CONFIG_PHYS_64BIT > > > > typedef unsigned long long dma_addr_t; >