From nobody Fri Apr 3 03:23:06 2026 Received: from smtp-out3.simply.com (smtp-out3.simply.com [94.231.106.210]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A976E310635; Mon, 16 Feb 2026 13:53:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=94.231.106.210 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771250041; cv=none; b=c2CeJLxtBK/HRRwOR424+zdzYMPA/7SKdFNInvuLgJrGa1GpSncaenF5m7gfqlG+JhevsLOvWZrPP7PVs1UZCO0JpqX3lV/cLHBzPqbS46kwnhi5FSLvBzWQGSQ2bzyzDVIJBiZ7dxwNENxgGnme1BcVXuQ4gErGP9y278vE7bs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771250041; c=relaxed/simple; bh=JpdUupId/R8qhXGqFCNEF2uh+WoduDoWFD8Bwdx86dk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b5hytw162Jt7u70ClM4rPGOyL47Y/CUV4qumHFPyXPPJKTOYwE8yYQCf+P2VHAGN2iAW9X5nF4iWBIiPgdjZZA6N3eOEaeHZt+PzYSEIytFQTvUJ2p+TB1iZML16jWuTtLHAynD/zqm/jdpIib0d7tKi/KnbSD937d6WeKs2wPM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gaisler.com; spf=pass smtp.mailfrom=gaisler.com; dkim=fail (0-bit key) header.d=gaisler.com header.i=@gaisler.com header.b=Eyu3n2TM reason="key not found in DNS"; arc=none smtp.client-ip=94.231.106.210 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gaisler.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gaisler.com Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=gaisler.com header.i=@gaisler.com header.b="Eyu3n2TM" Received: from localhost (localhost [127.0.0.1]) by smtp.simply.com (Simply.com) with ESMTP id 4fF44Y2yvBz1FbwL; Mon, 16 Feb 2026 14:53:49 +0100 (CET) Received: from d-5xj5g74.got.gaisler.com.com (h-98-128-223-123.NA.cust.bahnhof.se [98.128.223.123]) by smtp.simply.com (Simply.com) with ESMTPA id 4fF44Y0l1rz1FV00; Mon, 16 Feb 2026 14:53:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gaisler.com; s=simplycom2; t=1771250029; bh=p+KzDx4M2gcKRYgJHx+u+LHbuSg09/20zOFN0HOSdwA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Eyu3n2TMS2pWI6DY1oj4LMQyYGz7F42LrFuwNdpYfwvBAbp1KYiRd3ioLfYQiW4tb 3PIboqf7iFyDN9hl2SQgoDSdAnySjYV7+atItKz5HzMh9PZDI4FDOEUeG30HuZTFVR 1F9qs63dDk6UQDKYTSnEBeQvLQCkUg+0qiruvDKtrM/8qsdwREvH7M02dyqw7mozpm V+oNGahIXzAED0/C4ihnwPYn/7elcDFP/NuBLAb+s5315yAwC/1yx/XDDyB99mHK5k S1xivSUMSuNCyZLiruY38ZppjF4TGFJExjqXERCDtX1wQnx3p1vwmpW9ww0Bo3uzcQ D4S5gHjXYPXIA== From: Arun Muthusamy To: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, mkl@pengutronix.de, mailhol@kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-can@vger.kernel.org, Arun Muthusamy , Daniel Hellstrom Subject: [PATCH v5 05/16] can: grcan: Replace bit timing macros with literal values Date: Mon, 16 Feb 2026 14:53:33 +0100 Message-ID: <20260216135344.23246-6-arun.muthusamy@gaisler.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260216135344.23246-1-arun.muthusamy@gaisler.com> References: <20260216135344.23246-1-arun.muthusamy@gaisler.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Refactor the bit timing constants in grcan_bittiming_const by replacing macros with literal values. Signed-off-by: Arun Muthusamy Signed-off-by: Daniel Hellstrom --- drivers/net/can/grcan.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c index f3821e224f4f..12fd4911add2 100644 --- a/drivers/net/can/grcan.c +++ b/drivers/net/can/grcan.c @@ -36,6 +36,7 @@ #include #include #include +#include =20 #define DRV_NAME "grcan" =20 @@ -93,16 +94,6 @@ struct grcan_registers { (GRCAN_CONF_BPR | GRCAN_CONF_RSJ | GRCAN_CONF_PS1 \ | GRCAN_CONF_PS2 | GRCAN_CONF_SCALER) =20 -#define GRCAN_CONF_RSJ_MIN 1 -#define GRCAN_CONF_RSJ_MAX 4 -#define GRCAN_CONF_PS1_MIN 1 -#define GRCAN_CONF_PS1_MAX 15 -#define GRCAN_CONF_PS2_MIN 2 -#define GRCAN_CONF_PS2_MAX 8 -#define GRCAN_CONF_SCALER_MIN 0 -#define GRCAN_CONF_SCALER_MAX 255 -#define GRCAN_CONF_SCALER_INC 1 - #define GRCAN_CONF_BPR_BIT 8 #define GRCAN_CONF_RSJ_BIT 12 #define GRCAN_CONF_PS1_BIT 20 @@ -392,14 +383,14 @@ static struct grcan_device_config grcan_module_config= =3D =20 static const struct can_bittiming_const grcan_bittiming_const =3D { .name =3D DRV_NAME, - .tseg1_min =3D GRCAN_CONF_PS1_MIN + 1, - .tseg1_max =3D GRCAN_CONF_PS1_MAX + 1, - .tseg2_min =3D GRCAN_CONF_PS2_MIN, - .tseg2_max =3D GRCAN_CONF_PS2_MAX, - .sjw_max =3D GRCAN_CONF_RSJ_MAX, - .brp_min =3D GRCAN_CONF_SCALER_MIN + 1, - .brp_max =3D GRCAN_CONF_SCALER_MAX + 1, - .brp_inc =3D GRCAN_CONF_SCALER_INC, + .tseg1_min =3D 2, + .tseg1_max =3D 16, + .tseg2_min =3D 2, + .tseg2_max =3D 8, + .sjw_max =3D 4, + .brp_min =3D 1, + .brp_max =3D 256, + .brp_inc =3D 1, }; =20 static int grcan_set_bittiming(struct net_device *dev) --=20 2.51.0