Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp752880pxb; Wed, 6 Oct 2021 14:47:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYz8kGZWKobq0T0B1RWiFJI6/zCPIgdatznKpAXvudU+5a2q4r/DbFZUNLF7H8OOS0B13F X-Received: by 2002:a17:906:c7c1:: with SMTP id dc1mr936549ejb.6.1633556864532; Wed, 06 Oct 2021 14:47:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633556864; cv=none; d=google.com; s=arc-20160816; b=tk+DxRrMje1m9aCl/DXJcN5BV49JkQAynYMOPcsfmvjOKoORet3wGnStO5FplKvOHb b6X4vBdkBnNEhd8Xq38Wr58FF1i2La/CDPRCSPPYf8an7U/lC2FC6aHki2zECv5vaecJ yCCkE5uoSsaAqsIR48aWwxGYXHOJoXe2G3X8o0T770ZfCtERk9oO4yO5NcZgZt66IC4A //4ZzDoWw0V27W4KZj0GgJgC99kvvOXKoZHoGVG+yYkU6MU8PUccZD5rzxpnGlwQ19Sw wd3PoQSLlULfcRtrDtQE5HYCXlB60PVLkKejA3/zQ/G984Shb/CeQ27gKPqa/arSiSgz G0Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=W2NFEc6PiLBW8RXdbLMSGzbNiA5Xzw0NFhpoyGGu1IQ=; b=alnQ2102lBhCfDQ3KUYfJX5KWaDonLjg7/Gmqc3pEJT5jxIwGap0HGH9u+PAhlAYT+ C637icxLKdoMdCP8rNOQcKo9Z3Yl+vUjE5k9zwe2Lt9pP/46OcueU1Wk+sIFoPtMRrxp 3KU3wvmS+llPUggiSbTzdYcw7KPLYPddjs0tq0RdAXncw1Cc/RvgJCutgTolDpljuYDi bR/EwGS4e2+3eQCV7IuEv/2iLJNJJSxAk/n/ZL/Rqls2HIjdx3TBLZaCO1D/hFbbOTUm up4O/kHn4W4W/r0aXANkiS161JiXQNBtL7kxAMA/GmTRoYnT9XzPBzmC5oB8podR5Q1l kZAw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m1si24907604ejj.198.2021.10.06.14.47.20; Wed, 06 Oct 2021 14:47:44 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239710AbhJFVru (ORCPT + 99 others); Wed, 6 Oct 2021 17:47:50 -0400 Received: from gate.crashing.org ([63.228.1.57]:45236 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbhJFVrs (ORCPT ); Wed, 6 Oct 2021 17:47:48 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 196LRU0O007032; Wed, 6 Oct 2021 16:27:30 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 196LRS4V007029; Wed, 6 Oct 2021 16:27:28 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 6 Oct 2021 16:27:28 -0500 From: Segher Boessenkool To: Stafford Horne 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: <20211006212728.GM10333@gate.crashing.org> References: <20211006164332.1981454-1-robh@kernel.org> <20211006164332.1981454-7-robh@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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." > 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! Segher