Message ID | 20230929141304.3934380-9-msp@baylibre.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6359:6f87:b0:13f:353d:d1ed with SMTP id tl7csp3539303rwb; Fri, 29 Sep 2023 13:27:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsW0HRbU5rLlCRobMJdRpJxoOEm4bJVYwkttMLSK1CVir7F916wuFUzYeJdhpmMz8O9JUH X-Received: by 2002:a17:90a:f408:b0:25d:eca9:1621 with SMTP id ch8-20020a17090af40800b0025deca91621mr4800958pjb.6.1696019260964; Fri, 29 Sep 2023 13:27:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696019260; cv=none; d=google.com; s=arc-20160816; b=USzRhklz7A9SZ7p8+n/1E8jytYhhHM23lr0HI783i/+PEKQe3HklXu0rivHjxGUC8s B+SKi57cyWhJjT0WIAdC0sqNXWbO/GJ+PEF/M/tjoImuWhbqHcOF06oLM9+iFX7sC73y dAbnI48+GioCQk24iL3g9sC7AZfRM5oyGmYQ9l0nLc3xqqAaVnP6CPAf3q5fxt+7d9Qt CP/TCluqaimkJj3om2c18vRTDUHF80aOPZRNmSNC5TNVl72sx5xFPp9JnQArLJFE0N7A fxJMxQPvzVFzAvuVFbzkdQQmG2g2rMHdi3XFj9+EFvHCfLZXMOMCLaqmFayWG4Q6sYS5 +41w== 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 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id d59-20020a17090a6f4100b0027762fed4a0si2170545pjk.11.2023.09.29.13.27.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 13:27:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; 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 23.128.96.36 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 0A550807C5D6; Fri, 29 Sep 2023 07:15:24 -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 S233426AbjI2ONj (ORCPT <rfc822;pwkd43@gmail.com> + 20 others); Fri, 29 Sep 2023 10:13:39 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; Fri, 29 Sep 2023 07:13:20 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4053c6f0db8so136643905e9.3 for <linux-kernel@vger.kernel.org>; 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 <msp@baylibre.com> To: Marc Kleine-Budde <mkl@pengutronix.de>, Chandrasekar Ramakrishnan <rcsekar@samsung.com>, Wolfgang Grandegger <wg@grandegger.com> Cc: Vincent MAILHOL <mailhol.vincent@wanadoo.fr>, Simon Horman <simon.horman@corigine.com>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Julien Panis <jpanis@baylibre.com>, Judith Mendez <jm@ti.com>, Markus Schneider-Pargmann <msp@baylibre.com> 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: <linux-kernel.vger.kernel.org> 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:15:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778405092916047777 X-GMAIL-MSGID: 1778405092916047777 |
Series |
can: m_can: Optimizations for m_can/tcan part 2
|
|
Commit Message
Markus Schneider-Pargmann
Sept. 29, 2023, 2:12 p.m. UTC
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 <msp@baylibre.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> --- 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;