Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp789326pxb; Wed, 6 Oct 2021 15:40:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJze7Iu2LRfNTwlh5YRsI1Fd4GXYbTcyd1zGGTVB3xcLi5Kb/efyiipEFx3MN/xm4peietNJ X-Received: by 2002:a50:c006:: with SMTP id r6mr1208843edb.289.1633560043726; Wed, 06 Oct 2021 15:40:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633560043; cv=none; d=google.com; s=arc-20160816; b=U/nG72IFeed5zm1PmaWZjgIMwKXkE0/dWEk0zFlGZcgy1Xrf+YD/nHCeGG31iDL6Wq zT9QJRdAPUPHphMNWWjTxb1fuvrTNuQMcfDk49Pp/zw7Ar5LjqYB6afsYrzLoL/aOWM9 mZ2l5ZoITitXep7p7V+g6SV6hcmAqDkCNQ5kQKQzwhISx2FSerxRpfC8Ztej2wehij+l XAKEW5eE+bhF7bolr0at7AsjhMTEN2cD9IeSZVAW0sGVlp1PjZNvayRg9I3BVSjguEX8 RiMuUhAp0CAi9jmcCs6OtfFa7vZUZULIVqA1IGWP1dkl13xFPCIm0NgjuIJA6Vr0OdJz PQuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=u2ABEJkCd1WJjIKZz+HrMsC2GEgILkJNEDXWHfmz6WM=; b=CwB5H/AmmWn8N4wMEGWFQ4O+JIna6FW5FMQPsim3blqw9jgjLJwlSu3LKdUlYF9uLz 4zY5WzOdwYYL1n8f8eW5aIn4pIObFmaYFUFFmDxp5Y7eT4SiOYdz3tvjO3ZZpD3ysBIC 4n6X418wYmHGpu+1vCIE7NQVkZdTi45B6bvtH4kt2ypdq/MVXTjOecHQxmkXAEyyB8/R 2QM/uKpZOtF55N2/mcPVoe//CHkLfZWkA6CGyNPCyUmXRoFQgoEna3gOgSYNCf7gBnUk 9771fPLU+qbDD/4IgisYXk4lb+Lml2X4DU6MDgzpbpaQZHV1bGdhBBrD0DFkYMYAjLZ1 +85Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FIrtOed5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 5si27397931ejq.398.2021.10.06.15.40.20; Wed, 06 Oct 2021 15:40:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FIrtOed5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239616AbhJFWk3 (ORCPT + 99 others); Wed, 6 Oct 2021 18:40:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239859AbhJFWkX (ORCPT ); Wed, 6 Oct 2021 18:40:23 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E81BC06177C; Wed, 6 Oct 2021 15:37:43 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id np13so3309234pjb.4; Wed, 06 Oct 2021 15:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=u2ABEJkCd1WJjIKZz+HrMsC2GEgILkJNEDXWHfmz6WM=; b=FIrtOed5QowKUvESH0rG0wvV+3jKddQCuuIuBfhHRTk8T8VmPDFwv1/sTJAAFMgoXe HXkN7YWXjhF/zrR2F/U+/MkjdMr28Eiiif61PM8lgdzeGlwKVNoy3cZO3oVwxlf1y4Qq ML0Zxd6olLxMEd7tbUGjRpK/R7cb1ynklKOEnOsKGuHS+AR9eM3gQhrSgwrpbIXxDltH O/Ru0l0Mwm5WP0mW7srNV2jrlVjnmHbcXmHAwvScFtyDBwPixATxWKZZPvwE9Leemq7b /FuyLrO0jdPkAaWnvyISUJPK4unL1H92dmReVh6yyqBPX6EVv7yFmcldM3IfxchdNGsR dHOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=u2ABEJkCd1WJjIKZz+HrMsC2GEgILkJNEDXWHfmz6WM=; b=jr36hr+unBUX+e4+RGzWWTFxCJhgO3Fr69AyfZx0/qnL4AbdGpovcQmx8qb+mq2qcx zaqEsjAKpMQwuJBDRxngvfagIQKGHCXSsSW026teLJ1VwBgRfsNoUbtKubJmfBCR0Xbd CFzI0tgly7kWIzDUEAz5NLN84DkgRBefTqfQMCLIqMbeck2l+qrbojF+qbDm1aXfMdyc hTfwIC54m1LMYnmv1ndvJWx8Bwmq7lNsTxEV1SCOlpmdtpIv1j3zb5Kn03Xl+VuJM4g6 sEoPQ8OQQ4t8IDWVMQMbpIUIKA+l4lPz8euC7x2pibF6qUxshVDJczhQYfwAVaVAHCf3 Nokg== X-Gm-Message-State: AOAM533cszsY5tQvaPc/ZDtulmvXyNRfQjXtjZdAknV81ul7zdb5AUNB TEIL3CKgB2QhRf7H4HajJe4= X-Received: by 2002:a17:90b:1804:: with SMTP id lw4mr830200pjb.174.1633559862671; Wed, 06 Oct 2021 15:37:42 -0700 (PDT) Received: from localhost ([2409:10:24a0:4700:e8ad:216a:2a9d:6d0c]) by smtp.gmail.com with ESMTPSA id c18sm20848814pge.69.2021.10.06.15.37.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 15:37:41 -0700 (PDT) Date: Thu, 7 Oct 2021 07:37:39 +0900 From: Stafford Horne To: Segher Boessenkool Cc: Rob Herring , Rich Felker , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Guo Ren , "H. Peter Anvin" , linux-riscv@lists.infradead.org, Will Deacon , Jonas Bonn , Florian Fainelli , Yoshinori Sato , linux-sh@vger.kernel.org, x86@kernel.org, Russell King , linux-csky@vger.kernel.org, Ingo Molnar , bcm-kernel-feedback-list@broadcom.com, Catalin Marinas , Palmer Dabbelt , devicetree@vger.kernel.org, Albert Ou , Ray Jui , Stefan Kristiansson , openrisc@lists.librecores.org, Borislav Petkov , Paul Walmsley , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Scott Branden , Greg Kroah-Hartman , Frank Rowand , James Morse , Paul Mackerras , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 06/12] openrisc: Use of_get_cpu_hwid() Message-ID: References: <20211006164332.1981454-1-robh@kernel.org> <20211006164332.1981454-7-robh@kernel.org> <20211006212728.GM10333@gate.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211006212728.GM10333@gate.crashing.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Segher, On Wed, Oct 06, 2021 at 04:27:28PM -0500, Segher Boessenkool wrote: > On Thu, Oct 07, 2021 at 05:44:00AM +0900, Stafford Horne wrote: > > You have defined of_get_cpu_hwid to return u64, will this create compiler > > warnings when since we are storing a u64 into a u32? > > > > It seems only if we make with W=3. > > Yes. This is done by -Wconversion, "Warn for implicit conversions that > may alter a value." Yeah, that is what I found out when I looked into it. > > I thought we usually warned on this. > > This warning is not in -Wall or -Wextra either, it suffers too much from > false positives. It is very natural to just ignore the high bits of > modulo types (which is what "unsigned" types *are*). Or the bits that > "fall off" on a conversion. The C standard makes this required > behaviour, it is useful, and it is the only convenient way of getting > this! Thanks for the background, It does make sense. I guess I was confused with java which requires casting when you store to a smaller size. I.e. Test.java:5: error: incompatible types: possible lossy conversion from int to short s = i; -Stafford