Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp1641473rdb; Wed, 16 Aug 2023 19:10:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFV01L2+T6vmYWUMQ9AnfSoSMGveEm460u2+nSGKCJ5bnJAkZwCLGTDa5DqJds7qIq+6ERu X-Received: by 2002:a05:6808:2914:b0:3a7:60f2:9d1d with SMTP id ev20-20020a056808291400b003a760f29d1dmr4418494oib.28.1692238241151; Wed, 16 Aug 2023 19:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692238241; cv=none; d=google.com; s=arc-20160816; b=OQLTs9aDtvqRqeVQmZXGMFrKB29hzFHhHQHPwwpcB5BPqRIJ4meAoRLKi0eockep50 L9k//yB+IOZalprJvYBAzP0LlIzwktunqBccw8AYvCEWXOQ2kA266FVdpAVphg9sT4rZ nbRNaYurdR7tc6UNzDAEJzIXNb2h+3P1fhwG63kwa9RWOFW9JPVm36VCbz/NbuKxIdC7 Uwrjl1BmiHhmhO0osKfxRXgqsNrfq0VDfR/2uI0AKpbRjSeTREUBJEuMNU1CE1MuD0+V JKUzr/R5ABV7ZfKJw0Lryp+sjlU/O1xBnp4DR9vYS7Md7KMmGrrfxPLDaJ9wtZx+W+ux 41XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Dd5H6LDuMmRaB6wC9F0x7AjWGWVAoUWTtCuhgZvDAU8=; fh=pEv4mFOAg1q1kiqdvvTwQc4fMRVLROsynbZAh4D+fPQ=; b=vVWBH8z+tLUvyJwvJTZLXPhG8hdbcJFRmmFKq/yJn+mESxIhXZeHXHKis+x4mkkrKC BcXr5l65aAgw3lTA9mQOm0rYgQtYQTYmWRtMc54SJhBiFyYt3D4m4ag59ZV1fBu86sZj tjfwOCZQC9cBCzscmaYTDnryiT+DMrtEM9QXxX5RtmoT15m8T4QmcLisradmHsLCoXP1 KoV/F11ThJWW9AjfiOqv+HsItBfvdqVjz2DBxj/c49a7u/TxYfxqfx9MOPNDj5HrmiwA E2P1HIO3ZdUsaznlDayUqBfKWHNyEynsPqVEyFGOj4U3exsHJOjQRxIPr6caVL5A8tPn sdAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DnXg3q8h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x26-20020a63171a000000b0055b731aa9adsi2616249pgl.562.2023.08.16.19.10.22; Wed, 16 Aug 2023 19:10:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DnXg3q8h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345521AbjHPS0D (ORCPT + 99 others); Wed, 16 Aug 2023 14:26:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345544AbjHPSZp (ORCPT ); Wed, 16 Aug 2023 14:25:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06C032102 for ; Wed, 16 Aug 2023 11:25:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 982D664E15 for ; Wed, 16 Aug 2023 18:25:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3E1BC433CA; Wed, 16 Aug 2023 18:25:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692210340; bh=NVIO9mQ7Sul835zV4M+ab2QePvs6SlNuDEAVCUPvwKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DnXg3q8h3h+NaBnVLSqq7//1YT9liViGFT/C4Pu1vN9x4LFbLYb6ZwIEasPYW+Duz Ui0lvYQC71kFCtFJ4DaVM2Zb/7/wZTCCq7Hh+qaBUJHL9OmEd9tzXUysX8feVMEghz QVDC4D1D/C9aJwZZIffNgxI4VdulkNolsH2pZ09VObWdcMTOUJdKUqavenfy6XviyM P/0OauVeYr8d0Q3/oT31R9gCpdJ3IDWweTp/OHQknW6cS7vhEAyb7x9QfQ//0hfRiR RRP/DComBUNiOMAHi02RYUBl0P7fmNCCyixd/+4sfwu7jaeXeQDbBVgj6NpdDB1QX+ Ah49dORRIWY1Q== From: Will Deacon To: anshuman.khandual@arm.com, linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, James Clark Cc: catalin.marinas@arm.com, kernel-team@android.com, Will Deacon , Jintack Lim , Kristina Martsenko , James Morse , linux-kernel@vger.kernel.org, Mark Brown , Rob Herring Subject: Re: [PATCH] arm64: sysreg: Generate C compiler warnings on {read,write}_sysreg_s arguments Date: Wed, 16 Aug 2023 19:25:25 +0100 Message-Id: <169219366150.1947685.9640471201961433232.b4-ty@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230815140639.614769-1-james.clark@arm.com> References: <20230815140639.614769-1-james.clark@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 15 Aug 2023 15:06:39 +0100, James Clark wrote: > Evaluate the register before the asm section so that the C compiler > generates warnings when there is an issue with the register argument. > > This will prevent possible future issues such as the one seen here [1] > where a missing bracket caused the shift and addition operators to be > evaluated in the wrong order, but no warning was emitted. The GNU > assembler has no warning for when expressions evaluate differently to C > due to different operator precedence, but the C compiler has some > warnings that may suggest something is wrong. For example in this case > the following warning would have been emitted: > > [...] Applied to arm64 (for-next/misc), thanks! [1/1] arm64: sysreg: Generate C compiler warnings on {read,write}_sysreg_s arguments https://git.kernel.org/arm64/c/18b8f57a7f51 Cheers, -- Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev