Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4044023rwb; Sun, 9 Oct 2022 16:41:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5EbEv5fTZqjSNJS/LigKA6ef3R/ma6SWqUt7eEqillRILGJoLwTu87v0lDa7MXS2zF8GNf X-Received: by 2002:a17:902:e0c1:b0:180:1aec:1f12 with SMTP id e1-20020a170902e0c100b001801aec1f12mr13756339pla.155.1665358914810; Sun, 09 Oct 2022 16:41:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665358914; cv=none; d=google.com; s=arc-20160816; b=b+2Kck4VzImGvAs98hBj38jO4KfjZ5Ng0vCq2bSxhx8JuqV8r/DRdrMlZyzyPEdR6S ZfxTAgmF5t+YHyUGdg8cgtbgsrRYKvjnqAo0hHrilgZCnQ7ubPSbL/k4vwRmOaLQtCgT UubchAz9Yi6GF7MGwQdqPpoIYz9kXc1t4Z31Z5Is12ofh8VYklhmK4bxsg1H2NHpWf0B e/vWazN1FBfrUCOqxRvHBUQkfEVspe0VxDpnT9hhu4RvBLDJ9oP3ZBJw2ZJjfpnMxuRE Gmv89b2UVc84ohmVm9klgQu64RKm1mnfvfPMZPGRWy2Qql1WUVUHhXQ51oW7c5qdxf79 BUHg== 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=h6Af/bWMPTPTczassFg0BYd5wZxN+IW7rU8K3m2EOMk=; b=Ap8xqToK0F6tQohW9AGhXyRluPo2GlSPSKExNSYuezWZazksw8JCXSFu6bfhRkmbEJ sdPI0m7HD3KSoMilxId+9WV9Ezl3aoy484ktO1SXaTl9SQLbI1eStMJtz/IDHW04vBz3 aUTUjwMLwyrffOW4Jb+rq1ONOnpvzVVk4eGl8L13v8pKBWm1DIu6oaZKTpmaWKal/g4V Cc1GpMfh8if2hSK8GjLpMwCDa+Ec1bcgXMC35YUq2KxP+/Cl6vMYaM/fQBh0X5WZrjzh mIk+Klrfzxq3QlJh+ibX5PezkQYhIcM3FzDToYFtqJ+UncFHnzv4RmoS6V+jUYG/vm5r /hqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o9jydAhj; 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 133-20020a63028b000000b003fe34317ce2si9975778pgc.778.2022.10.09.16.41.43; Sun, 09 Oct 2022 16:41:54 -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=o9jydAhj; 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 S231475AbiJIWOm (ORCPT + 99 others); Sun, 9 Oct 2022 18:14:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230308AbiJIWOJ (ORCPT ); Sun, 9 Oct 2022 18:14:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8D642D1DE; Sun, 9 Oct 2022 15:10:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BDF9D60CBA; Sun, 9 Oct 2022 22:10:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0429C433D7; Sun, 9 Oct 2022 22:10:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665353407; bh=5JkOB+HsRfMjF6JdEuT30fBWd/b3+QMJryRmJUvtxG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o9jydAhjP7NYGpwX84YM4J/2PMjRMZWasUbNwO9ohEQLWPbHQlJBZOTaYxu1Yj5qt BWRrSy3vYXGuPWeGmiQM6lJtiPMJ2V+umUZ/WRAc3ED8ElC8cGmaGo0B3DbvZ9QJpN YDJ+QfWopcwiUvfAwmJ7h1IFz9sy/NA1mj8IWa33mC3S+BW8IFnLoJ0ET8u1zzlJf5 17esvWXbcgtKLyHXPabvnmaOyqeW8+E/5OkLwaALl9nbp2iCND61YlYknykKvH1EYH 1zYYEq0KB8gjaLr4QbEgheuzSF9tv73pmRn9ak9oH7Om6WsCswgwtOH7eoD2+yYvLf wcpWikyVeRPPA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sergei Antonov , Andrew Lunn , Paolo Abeni , Sasha Levin , davem@davemloft.net, edumazet@google.com, kuba@kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 6.0 33/77] net: ftmac100: fix endianness-related issues from 'sparse' Date: Sun, 9 Oct 2022 18:07:10 -0400 Message-Id: <20221009220754.1214186-33-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221009220754.1214186-1-sashal@kernel.org> References: <20221009220754.1214186-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 From: Sergei Antonov [ Upstream commit 9df696b3b3a4c96c3219eb87c7bf03fb50e490b8 ] Sparse found a number of endianness-related issues of these kinds: .../ftmac100.c:192:32: warning: restricted __le32 degrades to integer .../ftmac100.c:208:23: warning: incorrect type in assignment (different base types) .../ftmac100.c:208:23: expected unsigned int rxdes0 .../ftmac100.c:208:23: got restricted __le32 [usertype] .../ftmac100.c:249:23: warning: invalid assignment: &= .../ftmac100.c:249:23: left side has type unsigned int .../ftmac100.c:249:23: right side has type restricted __le32 .../ftmac100.c:527:16: warning: cast to restricted __le32 Change type of some fields from 'unsigned int' to '__le32' to fix it. Signed-off-by: Sergei Antonov Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220902113749.1408562-1-saproj@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/faraday/ftmac100.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftmac100.h b/drivers/net/ethernet/faraday/ftmac100.h index fe986f1673fc..8af32f9070f4 100644 --- a/drivers/net/ethernet/faraday/ftmac100.h +++ b/drivers/net/ethernet/faraday/ftmac100.h @@ -122,9 +122,9 @@ * Transmit descriptor, aligned to 16 bytes */ struct ftmac100_txdes { - unsigned int txdes0; - unsigned int txdes1; - unsigned int txdes2; /* TXBUF_BADR */ + __le32 txdes0; + __le32 txdes1; + __le32 txdes2; /* TXBUF_BADR */ unsigned int txdes3; /* not used by HW */ } __attribute__ ((aligned(16))); @@ -143,9 +143,9 @@ struct ftmac100_txdes { * Receive descriptor, aligned to 16 bytes */ struct ftmac100_rxdes { - unsigned int rxdes0; - unsigned int rxdes1; - unsigned int rxdes2; /* RXBUF_BADR */ + __le32 rxdes0; + __le32 rxdes1; + __le32 rxdes2; /* RXBUF_BADR */ unsigned int rxdes3; /* not used by HW */ } __attribute__ ((aligned(16))); -- 2.35.1