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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDF3DC433F5 for ; Wed, 6 Oct 2021 21:41:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7752E611C6 for ; Wed, 6 Oct 2021 21:41:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7752E611C6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Mime-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LrKebQHnd6fuVAS//lLLjljXytwtZwtsgKHn2yHXs+U=; b=es43SBbZmtsg9/ pkVTcp26SEIggzOx0YBF784an6JCDgJ4Ru4Mxvg0z+/truiPa47XcXVdD4JwanvPsiEVTBG3xh7gU jeMBNIy9n2WLGBpHXhaoqOGcFPair0lwDqrIfNhh080ow0n6p6cZInxAV1iiRPnaCU40k1IQyxvof 88MQv9q9GVfhqky9dnRcFAdhK6FdIhqHpmffJjQpcon12W5S3VfkkAKtDv/aO/uofXDjndcTnEHRz SslhMWu8ov3Oof/Gh6kq9rcVbYxO/yfsnVLK3dIqi9rjqeMHanZyFtvi3OHEFsLaPZkdKS2LdOf0Y TuTgsK1uNclqu3K5tYug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYEdD-00FcOs-CX; Wed, 06 Oct 2021 21:39:19 +0000 Received: from gate.crashing.org ([63.228.1.57]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYEd7-00FcNn-Sm; Wed, 06 Oct 2021 21:39:15 +0000 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211006_143914_303599_098B6005 X-CRM114-Status: GOOD ( 11.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel