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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42367C7EE23 for ; Mon, 5 Jun 2023 13:17:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234050AbjFENRP (ORCPT ); Mon, 5 Jun 2023 09:17:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234040AbjFENRK (ORCPT ); Mon, 5 Jun 2023 09:17:10 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8F30DB for ; Mon, 5 Jun 2023 06:17:05 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 53D9A1FE67; Mon, 5 Jun 2023 13:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1685971024; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nQ/D4JXr2jkATGmTql3tYtvfsfon8UBRMwLFWJ2zmbo=; b=HYgbmPXPKxG1Oh9kEW67R4NktUDQpiudtrchPD2Rnv1aEj22Ool+IwRCH0YfCgYBWu8H4f 2E+uF/g5bMp+v6zeN6ssEZYXCt+wpyN0trWXpgiM+j+skupm6UnkW7+IVD9FEbTgjW12Pe Sqws5dXs9aRehpxjXcynwxvHmydXC4o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1685971024; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nQ/D4JXr2jkATGmTql3tYtvfsfon8UBRMwLFWJ2zmbo=; b=L4KoVQxMZTBs4QKvBjnzvzSRkieruEav2FMfzx0jz2k5mX0YenO2xU2yVkU2vomjR1ZzGB KJTs3iPhdh2ge7Cw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 26D38139C8; Mon, 5 Jun 2023 13:17:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id VG6OCFDgfWTxKwAAMHmgww (envelope-from ); Mon, 05 Jun 2023 13:17:04 +0000 Date: Mon, 05 Jun 2023 15:17:03 +0200 Message-ID: <878rcyhwvk.wl-tiwai@suse.de> From: Takashi Iwai To: Stefan Binding Cc: Jaroslav Kysela , Takashi Iwai , , , Subject: Re: [PATCH RESEND v1 2/3] ALSA: hda: cs35l41: Fix endian conversions In-Reply-To: References: <20230525135955.2108140-1-sbinding@opensource.cirrus.com> <20230525135955.2108140-3-sbinding@opensource.cirrus.com> <87zg5eidcb.wl-tiwai@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. thanks, Takashi