Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5795599rwd; Mon, 5 Jun 2023 08:39:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ZYvvBRAK14UJWT87b80cJEV3c4J1BRV8zUE8KZL0zmgRo/XwRmfWeRnrYqA3QdmzYGoGF X-Received: by 2002:a17:903:18f:b0:1b0:aec3:ed52 with SMTP id z15-20020a170903018f00b001b0aec3ed52mr4157650plg.50.1685979588824; Mon, 05 Jun 2023 08:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685979588; cv=none; d=google.com; s=arc-20160816; b=x7ET/KFYr9V/J/wxCQVsjibW9ew19voGa3ginRz3VgCPZmUlxWghWLBMODIw31pUUP 7vR7FJbNPznCnhMhTr57EiNuWFOMZOC0Xtk5Oa7UU1SgN7G3goR1FS+26i9R/O14cww6 fDUuWoaqaLgUn1VqPYavuXIMfGQ0xPaJU3yWk1pPnfB93ik6D0NH71vRLEHKfrgo84CH FUpESVg5ghSy/oiNx9Pq410klziNPL9M2oHpzPAfoKmxpHU39fqZzn6DxZXA42TGf56G NVC0sDwjV30Ghvfvvze7ox9g00zvmoxLn2PhhCcoACngdWPsbym+Qxkpuwkr0UES2q1F LlkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=uVmiTfqw7mNMn6Bzor8qN+zV9QQNIDAGFDMziJpJE20=; b=1AQmY7H0bhDkPoCJlIMTQzrB7dkIcMrIoZ3LrClN+u6AUS6HmQk2XM65bZQV4F+fNw tonzXmAP1LZsH46Lk2a7So5JQvfXXjrAh1GaKYZ03diq3gfK5i5wLONFGOcVQqXJPuco vQJHHrte1VrNSIyAV7qWZzY1WmoA1h7cuFGJLCFGxk3d5EtnU7uAJW4ZH3LsK7VwQKkW FI2uR9ye06mWBbhdNytJf7BpR0I8pOZawIHS7BugLBinB6x6dBBfjRdaHaDQC0nVAdxf QnCJ6+K2Cs3s9sw6jQE0j7EYelzllPQdJcVMe0rUHqYXAY0xqTXGgSsJjId9JdyUM5Tr bBVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=SuFG+NYO; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9-20020a170903018900b001adf0f9cf6fsi5720656plg.303.2023.06.05.08.39.34; Mon, 05 Jun 2023 08:39:48 -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=@cirrus.com header.s=PODMain02222019 header.b=SuFG+NYO; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232196AbjFEPYO (ORCPT + 99 others); Mon, 5 Jun 2023 11:24:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231774AbjFEPYM (ORCPT ); Mon, 5 Jun 2023 11:24:12 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C436CEE for ; Mon, 5 Jun 2023 08:24:11 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3558e8qJ010267; Mon, 5 Jun 2023 10:23:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=PODMain02222019; bh=uVmiTfqw7mNMn6Bzor8qN+zV9QQNIDAGFDMziJpJE20=; b=SuFG+NYOcggQgxA4azHkNp9/VLKBi9gRkHgOavnPxGKUnYrGhiUVWKgHTz4wkvEk2Ej6 hLlSx/3WmWJmPLrYrDF2u4huit6QxPVg2Q+XlEIveAdRU1jjh+XTTw84kEQcBV+YIGlO uVkCti6JSnsckNk56mu8lCapFn7RGCrGdqC+5MpNnhEqA+yzQ9YjCvwtmBoPpXQz77sY 6auErS2Zj0qjMdufWn+Qvtg5VInFjShRJzdrPFAv+C27ORQSKBYslO2OUibt96Q/Ea4B 0bXZmPtYs+iDpidqCQQnHl+pZLbwSQSB+P2/4cx4YM5iMTrA1OVZEH2LU5C8yylFauqF Vg== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3r01xna11f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Jun 2023 10:23:57 -0500 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Mon, 5 Jun 2023 16:23:55 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Mon, 5 Jun 2023 16:23:55 +0100 Received: from [198.90.238.35] (LONN2DGDQ73.ad.cirrus.com [198.90.238.35]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 7597D11AA; Mon, 5 Jun 2023 15:23:55 +0000 (UTC) Message-ID: <21d2e747-f911-e9d4-2c55-e31c76c9d2bc@opensource.cirrus.com> Date: Mon, 5 Jun 2023 16:23:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH RESEND v1 2/3] ALSA: hda: cs35l41: Fix endian conversions To: Takashi Iwai CC: Jaroslav Kysela , Takashi Iwai , , , References: <20230525135955.2108140-1-sbinding@opensource.cirrus.com> <20230525135955.2108140-3-sbinding@opensource.cirrus.com> <87zg5eidcb.wl-tiwai@suse.de> <878rcyhwvk.wl-tiwai@suse.de> From: Stefan Binding In-Reply-To: <878rcyhwvk.wl-tiwai@suse.de> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: Lkg6Khi7KamQ91EwYW0YOCtQrNfT2HqX X-Proofpoint-GUID: Lkg6Khi7KamQ91EwYW0YOCtQrNfT2HqX X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi Takashi, On 05/06/2023 14:17, Takashi Iwai wrote: > On Mon, 05 Jun 2023 14:50:54 +0200, > Stefan Binding wrote: >> Hi Takashi, >> >> On 05/06/2023 08:21, Takashi Iwai wrote: >>> On Thu, 25 May 2023 15:59:54 +0200, >>> Stefan Binding wrote: >>>> @@ -379,10 +379,10 @@ static int cs35l41_save_calibration(struct cs35l41_hda *cs35l41) >>>> /* Calibration can only be applied >>>> whilst the DSP is not running */ >>>> ret = cs35l41_apply_calibration(cs35l41, >>>> - cpu_to_be32(cl->calAmbient), >>>> - cpu_to_be32(cl->calR), >>>> - cpu_to_be32(cl->calStatus), >>>> - cpu_to_be32(cl->calR + 1)); >>>> + (__be32)cpu_to_be32(cl->calAmbient), >>>> + (__be32)cpu_to_be32(cl->calR), >>>> + (__be32)cpu_to_be32(cl->calStatus), >>>> + (__be32)cpu_to_be32(cl->calR + 1)); >>> Do we really need those cast? Even if yes, it must be with __force >>> prefix for the endian cast in general. >> These casts were added because we found some warnings when we ran the >> static analyzer sparse locally. >> I think these warnings are very minor, and we can drop this patch if >> you prefer? > The warnings must be bogus, or maybe pointing to other things? > The cpu_to_be32() macro itself must return a __be32 value, hence it > makes no sense to add an extra cast . > > If the static analysis still shows such a warning, it should be fixed > differently -- either fix the analyzer or fix the cpu_to_be32() macro > itself. > > The changes of the argument types to __be32 are fine. I'm arguing > only about those unnecessary cast. You are correct, I double checked and the cast is not needed. I'll push up a v2. Thanks, Stefan > > > thanks, > > Takashi