Received: by 2002:a05:622a:251a:b0:39a:b4a2:e86 with SMTP id cm26csp314294qtb; Wed, 19 Oct 2022 02:38:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Uo+VWyVc1uydJHhZxUXh/aI8XqEpLGjrV9dnSMQ0IXddHKUouJf/FLBHMNgqiXbj3rD9V X-Received: by 2002:a05:6a00:1412:b0:557:d887:2025 with SMTP id l18-20020a056a00141200b00557d8872025mr7630865pfu.39.1666172335091; Wed, 19 Oct 2022 02:38:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172335; cv=none; d=google.com; s=arc-20160816; b=ZfMhfmT9uPPXSDaExPkCZc2zU3nx6JeR99rGQOS6945QPGfL7/m8kxjCnBIg9d1G0e i5GfmyqKsa3tKfJQ/KKMgb70lTWrqBr1sbDFnK8oM1yRlACs3saZ6NkDtH78dc5UMUr0 dZd6WW8w0F+YLZZOgP8AJWQpKoY+5Y9yVhBz8+2UuvNhQZ5RIEq6BiPmgUlqt+4lUP5r 4Mmu2jEw1iy89kg2/MCyJhD4+cREnjr8IqGvGFt3ZIli845+qp4yOnCuEPeDI8HEjEyS whtUkMsnD2HNqTSPGiBOdlooARVBZ7E/V2l06+ubBp4X/EB382Ga+FMb/6SqN4CwMqrd 7IYw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=h6Af/bWMPTPTczassFg0BYd5wZxN+IW7rU8K3m2EOMk=; b=1B8nbMAY9RHSTfLxyvliZFKAyirEjFzPSCA4NY5R36PD5bExSxqCzQ9gXR6kYbGdjV hO0Jc7us8w8pzZbxqJZ0+pMMJxzjy7jkHfcD7CX89+Tm0CKeA+BUKqws4bDXM7ZWVH8I BoQJLOX5ASvGeLNLHbGM2OyN3TUkF7LHDzd81VRC268tYvFsR0zETS2jDGxCcuIIBXfL G+hzTMxkC1uzdBDabeYcq3qVp2YJ/J57NKGyp11s0f7n9aMw8vSVn7OwKsiXksV+jBPB WWG90v0tZcKajZ+9w9JmBN5LYEXgQnRorNFJlL1bz6k687eRRbarkSKSuA6DfBPaMxkt AJJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XQeRc8gN; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m10-20020a638c0a000000b0045650af278bsi22342019pgd.817.2022.10.19.02.38.35; Wed, 19 Oct 2022 02:38:55 -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=@linuxfoundation.org header.s=korg header.b=XQeRc8gN; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233518AbiJSJ1R (ORCPT + 99 others); Wed, 19 Oct 2022 05:27:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233510AbiJSJ0B (ORCPT ); Wed, 19 Oct 2022 05:26:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A014E4E6F; Wed, 19 Oct 2022 02:11:44 -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 57F3261884; Wed, 19 Oct 2022 09:09:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68ECDC433D6; Wed, 19 Oct 2022 09:09:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170555; bh=5JkOB+HsRfMjF6JdEuT30fBWd/b3+QMJryRmJUvtxG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XQeRc8gNnkWmDxKsFpvk5BxtBFOLgjfE07Y7RVAeMEe5WLV2Kvc/zL71LbAao1P2H Y5Uje9JNtvUXbcvH3/3qjzTH5MMMKD+BFair7wDyh7BWm8DC4peTkqEAUmzqmhxb6n QltuGxCPhllbDvQPqJtA4tCsyCYRWguaAtRelytk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergei Antonov , Andrew Lunn , Paolo Abeni , Sasha Levin Subject: [PATCH 6.0 699/862] net: ftmac100: fix endianness-related issues from sparse Date: Wed, 19 Oct 2022 10:33:06 +0200 Message-Id: <20221019083320.869376559@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 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