Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp4183454rdh; Fri, 29 Sep 2023 13:58:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGiMxpZUSPdwcYNYWgCJgPL3WlY4I5JsUrC8OAl6UBBsbCOcUI6VyckTh6eR7oK7Btwy86P X-Received: by 2002:a05:6830:118:b0:6bc:9824:5089 with SMTP id i24-20020a056830011800b006bc98245089mr5762476otp.4.1696021081671; Fri, 29 Sep 2023 13:58:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696021081; cv=none; d=google.com; s=arc-20160816; b=LJHuDhR7P1a6NgPZElvSusQRhhqLEFEn9ENW9sIvZYwSREXBwJOcoDUl1//hmQfqAg R5eAMn8x6w8VfPnvW/t4v8osWN+cZCnnoeph3fH15b+UYzHvwtWtwjLV4TMNqcQ8+LeF qgAKHwyqgrJ5i3YS/LDcce1zhiorQ/p+DV3mpyoWJcmtaEN48lDdX2RhzPog7tACzPdW Q36v6ePpGMKSjGJA2wFucegoMOF9Okdi7erh3cdhrdTbfRX9cdl/WnhMefJ/7ov+QLkP +KmSmgkwo8pdCWYggkZbgEVGYuZRAgcIKpqtk0OMqc/YlCqg8AGBL/Hpe8JIMHzicM7K NR/Q== 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=GkCcF2KTU9N5lkXziHP+LXRrArD0pee4JR3G/zEvesA=; fh=EtuWLR14IhIbZM+E+fYn4isj1Y+iLrncbbgmHIVUFEQ=; b=dbHkyh1pdOBFuCagmy3SaLVkEZwG1OOApigIK5rSpnybBKL2OkHL31lAc1Rr1sk74F CkssR2MigYtKojvhoMJrOeSo6CQR8WO8nhfRqy+OqKYgHNZl9MPDp/v1LW9ugnzra6bA XGOGzifRYrfoJzofgAS8mTyEIH34BtxwYcmZRTmh+TvGS4+W51T3I8kaDoxg/Pupcj0e a5l+At0JxIZB/31RAZ/yNQ3De+SiYLK7hLn1Y00lm1ZEKXpDaMWhfTkVk9tPfYRRAblJ OVhHwy0WNilupafszRirqTu3S9RZx1e8X47gEN4LOXbIQRAt7mYLttmrZ1L6eTkxJcGt GKzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=cjVZAZi7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id q25-20020a656859000000b00578ac88e239si21951799pgt.595.2023.09.29.13.58.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 13:58:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=cjVZAZi7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 454668292A5C; Fri, 29 Sep 2023 07:14:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233424AbjI2ONi (ORCPT + 99 others); Fri, 29 Sep 2023 10:13:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233313AbjI2ONX (ORCPT ); Fri, 29 Sep 2023 10:13:23 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA2F5CCD for ; Fri, 29 Sep 2023 07:13:20 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4053c6f0db8so136643905e9.3 for ; Fri, 29 Sep 2023 07:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1695996799; x=1696601599; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GkCcF2KTU9N5lkXziHP+LXRrArD0pee4JR3G/zEvesA=; b=cjVZAZi70K0rgd+yj9PK5mhJkiGvhgOAyJpiizEzK22WoAeAwNZIC40co//x+Zw9xy dX4AFiaIoiTSNK2oVUI/p3R6rnSdhe7Oy0X63btpA4flVs4RUi1x+xrB8Oxolpzwk51B FP5S7NuKd+B1aSq29golbdWvcDcd107pDPukk/TRdMJweQJHFCC1rL6jQe9wur8Glp2f Ez83zmSblHM2pttcQCfWSIjZQe+yVHVBPPn30OxNJ1L0C5Ma+AX60nY04qdxemg9PG3p +43aFTM9vI/ohg2T6vgQfWnB/fdlHFEy0juhKyrR57esQLSvLdAuhW3Rf4R0yX7svgLR 6WIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695996799; x=1696601599; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GkCcF2KTU9N5lkXziHP+LXRrArD0pee4JR3G/zEvesA=; b=bOK6NmbQL99VtEs83mEHJGOKFGRg641rhGtqXgKoxmFrZnDAR9GmLGQe9+/Wmv1hUM fOYmFZbBM7OC0uYA5DbR12ks6hGpgA7xlKzlsrKhrOBJ4UUJaucOcOVkI2i8UImsAUfZ nV1xis113rurkKWPPl2DbOnFtamVy15lcydE0MZw1cxkfDs8Jt0exwLJBDdJdbwxN6pc iEvH8OHoHasvxc53WsO04U0otkMknqiog2txvVT5l3C82gncSv3SPNUVOMrZQEEbYzax YjSSsXMewuOWNidHaPnvb6mcBGsH6R5NL2fS9OLjT2ZADKW3Rfybm9v31sNXwOgLB0eG Vvow== X-Gm-Message-State: AOJu0YylpcsT+SlXqQTUr8J5y7sfs8okJF9y7rZ3bV3Utb3hziQKMGlm ms/kX+6gP50ubDaXOSANgzukRw== X-Received: by 2002:a05:600c:2053:b0:406:478e:9e2d with SMTP id p19-20020a05600c205300b00406478e9e2dmr3754793wmg.26.1695996799447; Fri, 29 Sep 2023 07:13:19 -0700 (PDT) Received: from blmsp.fritz.box ([2001:4091:a246:8222:dbda:9cd9:39cc:f174]) by smtp.gmail.com with ESMTPSA id t25-20020a7bc3d9000000b00405391f485fsm1513068wmj.41.2023.09.29.07.13.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 07:13:19 -0700 (PDT) From: Markus Schneider-Pargmann To: Marc Kleine-Budde , Chandrasekar Ramakrishnan , Wolfgang Grandegger Cc: Vincent MAILHOL , Simon Horman , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Julien Panis , Judith Mendez , Markus Schneider-Pargmann Subject: [PATCH v6 08/14] can: m_can: Use u32 for putidx Date: Fri, 29 Sep 2023 16:12:58 +0200 Message-Id: <20230929141304.3934380-9-msp@baylibre.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230929141304.3934380-1-msp@baylibre.com> References: <20230929141304.3934380-1-msp@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 29 Sep 2023 07:14:30 -0700 (PDT) putidx is not an integer normally, it is an unsigned field used in hardware registers. Use a u32 for it. Signed-off-by: Markus Schneider-Pargmann Reviewed-by: Simon Horman --- drivers/net/can/m_can/m_can.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index 1c021d99bae2..4e9e5c689b19 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -485,7 +485,7 @@ static void m_can_clean(struct net_device *net) struct m_can_classdev *cdev = netdev_priv(net); if (cdev->tx_skb) { - int putidx = 0; + u32 putidx = 0; net->stats.tx_errors++; if (cdev->version > 30) @@ -1694,12 +1694,12 @@ static int m_can_close(struct net_device *dev) return 0; } -static int m_can_next_echo_skb_occupied(struct net_device *dev, int putidx) +static int m_can_next_echo_skb_occupied(struct net_device *dev, u32 putidx) { struct m_can_classdev *cdev = netdev_priv(dev); /*get wrap around for loopback skb index */ unsigned int wrap = cdev->can.echo_skb_max; - int next_idx; + u32 next_idx; /* calculate next index */ next_idx = (++putidx >= wrap ? 0 : putidx); @@ -1718,7 +1718,7 @@ static netdev_tx_t m_can_tx_handler(struct m_can_classdev *cdev) u32 cccr, fdflags; u32 txfqs; int err; - int putidx; + u32 putidx; cdev->tx_skb = NULL; -- 2.40.1