From patchwork Tue May 23 17:31:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Jungclaus X-Patchwork-Id: 13252723 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 A04D121CC2 for ; Tue, 23 May 2023 17:32:24 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2108.outbound.protection.outlook.com [40.107.20.108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07255E7C; Tue, 23 May 2023 10:31:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MIMVMM599AGJQSfCOxSodiFz3x0RIkv7AdDrImkirxRadin5j7CNRC4zxFr6vHRnSyHhtgzCffvgXodOmTEWLfVyBkjQB/LjV7qe7Tktq6rljjgKuzT439L3E7CyeGFIG/RC30/myDw66yF+oLYPm3qWZN2CFyzATZIhiIEB+uZYWpI7cTfww9lTm4phllKGFiNvwebGQVRqaV+8eqBDmnXYe0po5bulfEaGia3Ogwreyc1mCmRJSGm01O6gtyP1yvgm5mBZ2gVzEWUridNeuhShuLaICOZh5V7fBFHpj554Xr/Mw3c7K7LNN6SoWkaebV86H1vWjBae2a1cQhyfWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aJANENL85gsGC2hfqCVR4IXN7gKgfp43J7J0EGCtheI=; b=eWfUp2/mVm57dig7AkHPERY3xwnXLJFM2ONCRKwicivxPVlyQSa0KvqdEllUw9dHvFSGlXSzTG1FyYe3LYIRe0Daa14Gc5CLuGRBZbsucQf36i5jXt533AfXm0oY6YtV01tKJQtS9joO3SwMvfPrTO1/eXpr06uS43S2xjIKyBGizzAIxJC+3qE/wL0q4/SzTbu0qNVLCotGlA5Re3AKsQNzUqI1yZZ7mFmkHNoRAXi0d7s37eNZVYYKTPRQ0x2KOaHvSstkd8CW2yHCWBH9gh8+Ja3QRnK01C6tgnCYTf6Ib46+maZu+bIWQTACjkbnyaZfO6W2cbP5FNtPKEOW7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 80.151.164.27) smtp.rcpttodomain=esd.eu smtp.mailfrom=esd.eu; dmarc=none action=none header.from=esd.eu; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=esdhannover.onmicrosoft.com; s=selector1-esdhannover-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aJANENL85gsGC2hfqCVR4IXN7gKgfp43J7J0EGCtheI=; b=bvw6s9+LK0ilJvRIu0JvNoOHAmLBjNlUNR3QxXmqYTIijDBAUG1v7+9hsJrO5TdEFY7G8jHwYmuO0v16b2WCcdNEdLiCd+7R07HS0s3G6yh7Ff5iyo/JqNAP+wlUzQZbZKGfXEumisnQSy69zzZWLNmXIHC1mhYxVZC2oGsq8q8= Received: from FR0P281CA0054.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:48::16) by AS8PR03MB8737.eurprd03.prod.outlook.com (2603:10a6:20b:538::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.29; Tue, 23 May 2023 17:31:07 +0000 Received: from VI1EUR06FT029.eop-eur06.prod.protection.outlook.com (2603:10a6:d10:48:cafe::b5) by FR0P281CA0054.outlook.office365.com (2603:10a6:d10:48::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.14 via Frontend Transport; Tue, 23 May 2023 17:31:07 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 80.151.164.27) smtp.mailfrom=esd.eu; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=esd.eu; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning esd.eu discourages use of 80.151.164.27 as permitted sender) Received: from esd-s7.esd (80.151.164.27) by VI1EUR06FT029.mail.protection.outlook.com (10.13.7.190) with Microsoft SMTP Server id 15.20.6433.14 via Frontend Transport; Tue, 23 May 2023 17:31:07 +0000 Received: from esd-s20.esd.local (jenkins.esd.local [10.0.0.190]) by esd-s7.esd (Postfix) with ESMTPS id 030307C16D8; Tue, 23 May 2023 19:31:07 +0200 (CEST) Received: by esd-s20.esd.local (Postfix, from userid 2046) id E86DA2E1805; Tue, 23 May 2023 19:31:06 +0200 (CEST) From: Frank Jungclaus To: linux-can@vger.kernel.org, Marc Kleine-Budde , Wolfgang Grandegger , Vincent Mailhol Cc: =?utf-8?q?Stefan_M=C3=A4tje?= , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Frank Jungclaus Subject: [PATCH 1/2] can: esd_usb: Make use of kernel macros BIT() and GENMASK() Date: Tue, 23 May 2023 19:31:04 +0200 Message-Id: <20230523173105.3175086-2-frank.jungclaus@esd.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230523173105.3175086-1-frank.jungclaus@esd.eu> References: <20230523173105.3175086-1-frank.jungclaus@esd.eu> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1EUR06FT029:EE_|AS8PR03MB8737:EE_ X-MS-Office365-Filtering-Correlation-Id: a33d73f2-8373-47c3-459f-08db5bb37df1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8p+kTB5F2ZyBSk1MU/Byy9UR04VQ2NVXQHX9e8brm5tRSB2+G3YX0l6kM3aK4+7cD3O4j0F1zAt80DERzBoz+lYyWWFoWX2bcj1yB6zsbbgg4Fq7f6CljG9uf04GKKt8ajmFILyZ1gN70W+4pTNTpOOvstW9oWUwARIwIMaBMmHiC2k8lrr9QXgMLL1qNCTmaghS8srUJDrfwcKkSdJG7pgZBOvnUE6J76kANfVpNey/nuXDRjgI2SQkcAd7Jl5QZuNt3Jbvk3PH5HT2uLVAC5nAmBE+sLJPvHN7LfFy6ZTJX5HUxV8CMRHzAS0kcxgmzZKJ7uZEaH2hym0nXWJGHchuKvtMIkEElJDYj4OOpl8c9T1oawkTSR++cLQ2bVzXKWNYbrys8184ADtmi2uzHG0E1udjkAvr+flGAuAwBQh24qHoR+AX4buWnRlJXHScCmxv8TYO1+Y6h06hyVbIHUyIZ7gS+W9IXRIhP8R6n2mUhnh86KZK+Twl4uxXaPj4vTw2w22SPv7MwbgI30DHfexYjt0X3I376RxddN7eEvDLyMoIZPGpmuOk5yuVQ+scjHIWmtIa4Vl1zXCRSQtoCmKYBJI8EiYIDir4ONPKqS7g3QnP0bC+vY0msb8aOWVb/sjE8Xyix6PQQJaf+X4xG0OEMOuxYFXLQzd3JoiAb1TghUKGcN1QfzF4AHI+RdyKaxyCu2/Lrhhp8q/paAz8XQ== X-Forefront-Antispam-Report: CIP:80.151.164.27;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:esd-s7.esd;PTR:p5097a41b.dip0.t-ipconnect.de;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(39840400004)(396003)(376002)(451199021)(36840700001)(46966006)(82310400005)(70206006)(70586007)(478600001)(41300700001)(110136005)(54906003)(42186006)(316002)(4326008)(86362001)(8936002)(8676002)(5660300002)(44832011)(356005)(6266002)(26005)(186003)(81166007)(1076003)(83380400001)(2906002)(40480700001)(336012)(2616005)(36756003)(36860700001)(47076005);DIR:OUT;SFP:1102; X-OriginatorOrg: esd.eu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 17:31:07.2513 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a33d73f2-8373-47c3-459f-08db5bb37df1 X-MS-Exchange-CrossTenant-Id: 5a9c3a1d-52db-4235-b74c-9fd851db2e6b X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5a9c3a1d-52db-4235-b74c-9fd851db2e6b;Ip=[80.151.164.27];Helo=[esd-s7.esd] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR06FT029.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB8737 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Make use of kernel macros BIT() and GENMASK(). Signed-off-by: Frank Jungclaus --- drivers/net/can/usb/esd_usb.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/net/can/usb/esd_usb.c b/drivers/net/can/usb/esd_usb.c index 1399b832ea3f..d40a04db7458 100644 --- a/drivers/net/can/usb/esd_usb.c +++ b/drivers/net/can/usb/esd_usb.c @@ -67,23 +67,23 @@ MODULE_LICENSE("GPL v2"); #define ESD_USB_TRIPLE_SAMPLES BIT(23) /* esd IDADD message */ -#define ESD_USB_ID_ENABLE 0x80 +#define ESD_USB_ID_ENABLE BIT(7) #define ESD_USB_MAX_ID_SEGMENT 64 /* SJA1000 ECC register (emulated by usb firmware) */ -#define ESD_USB_SJA1000_ECC_SEG 0x1F -#define ESD_USB_SJA1000_ECC_DIR 0x20 -#define ESD_USB_SJA1000_ECC_ERR 0x06 +#define ESD_USB_SJA1000_ECC_SEG GENMASK(4, 0) +#define ESD_USB_SJA1000_ECC_DIR BIT(5) +#define ESD_USB_SJA1000_ECC_ERR BIT(2, 1) #define ESD_USB_SJA1000_ECC_BIT 0x00 -#define ESD_USB_SJA1000_ECC_FORM 0x40 -#define ESD_USB_SJA1000_ECC_STUFF 0x80 -#define ESD_USB_SJA1000_ECC_MASK 0xc0 +#define ESD_USB_SJA1000_ECC_FORM BIT(6) +#define ESD_USB_SJA1000_ECC_STUFF BIT(7) +#define ESD_USB_SJA1000_ECC_MASK GENMASK(7, 6) /* esd bus state event codes */ -#define ESD_USB_BUSSTATE_MASK 0xc0 -#define ESD_USB_BUSSTATE_WARN 0x40 -#define ESD_USB_BUSSTATE_ERRPASSIVE 0x80 -#define ESD_USB_BUSSTATE_BUSOFF 0xc0 +#define ESD_USB_BUSSTATE_MASK GENMASK(7, 6) +#define ESD_USB_BUSSTATE_WARN BIT(6) +#define ESD_USB_BUSSTATE_ERRPASSIVE BIT(7) +#define ESD_USB_BUSSTATE_BUSOFF GENMASK(7, 6) #define ESD_USB_RX_BUFFER_SIZE 1024 #define ESD_USB_MAX_RX_URBS 4 @@ -652,9 +652,9 @@ static int esd_usb_start(struct esd_usb_net_priv *priv) msg->filter.net = priv->index; msg->filter.option = ESD_USB_ID_ENABLE; /* start with segment 0 */ for (i = 0; i < ESD_USB_MAX_ID_SEGMENT; i++) - msg->filter.mask[i] = cpu_to_le32(0xffffffff); + msg->filter.mask[i] = cpu_to_le32(GENMASK(31, 0)); /* enable 29bit extended IDs */ - msg->filter.mask[ESD_USB_MAX_ID_SEGMENT] = cpu_to_le32(0x00000001); + msg->filter.mask[ESD_USB_MAX_ID_SEGMENT] = cpu_to_le32(BIT(0)); err = esd_usb_send_msg(dev, msg); if (err) @@ -796,7 +796,7 @@ static netdev_tx_t esd_usb_start_xmit(struct sk_buff *skb, context->echo_index = i; /* hnd must not be 0 - MSB is stripped in txdone handling */ - msg->tx.hnd = 0x80000000 | i; /* returned in TX done message */ + msg->tx.hnd = BIT(31) | i; /* returned in TX done message */ usb_fill_bulk_urb(urb, dev->udev, usb_sndbulkpipe(dev->udev, 2), buf, msg->hdr.len * sizeof(u32), /* convert to # of bytes */ From patchwork Tue May 23 17:31:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Jungclaus X-Patchwork-Id: 13252721 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 E8ACD21061 for ; Tue, 23 May 2023 17:31:51 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20707.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1b::707]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EFFB10EA; Tue, 23 May 2023 10:31:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lqg0aTWdBjAS/MtGIGFfDVjaxn28JBYQy90Rhlmk2n6MtYNLoCMjpYCyvsvlSwTYKqwklqHV1l2pEHlTnr+yqviLF7X30wSXZWUqJPiOjtTCvSiW8yOa9OWveiuKIcFpsY0t2LNoDyJO2sDicWQJBZe0ThGUcZok9JvPRfr40hsVd+dUleuvCaEjJmUWoQs9Kt9hN626bRGAXoAS9iAZF4OxCbyM4+EwelUQXKl4AEiG96Qk+sK84du9NAJXXz5bi5arOT4Tts/hILMwSHUtNQjYbWKPdwzjakXXhfg5fpuh6PKMdY5/aqiRHSiaF+Jg19m1NIw+lGB0IYvCjw0yAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tfJRPzi2hkbffzi6LCRoAYKv7B2ODW65P9OLf03cknE=; b=hW0NsLGmEhXIRWRoKp6XPv2ugIbrRu308Ci6fpB7SI6uVXBPI7W7S/L4fy+VV5RnTjTAPu+dZe9syjD1PwPwaPT+k4XSs38ky3UErx5mjCDqsEccwe+Dy+mXkxURCtDiCfcsKKkXiDxgEBZVwJCz/v9QS/gWSX0rpA2Q0c43qLDCh3WB/rWB5BsjonhX0Wh1xx0sxYe9jltRis002tmi9dQclBLf4uy6iWQ7hHaRpgWMYpfECiBw0GQ1MVuXMyKNdpBBCU2KDZJKxNuYiCWhpaoN87J6kQaSP+ronmuMz8j2SSP0KzfGR0AaoNoSck2zUAnyNTDsZfEkR3/hpndkhA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 80.151.164.27) smtp.rcpttodomain=esd.eu smtp.mailfrom=esd.eu; dmarc=none action=none header.from=esd.eu; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=esdhannover.onmicrosoft.com; s=selector1-esdhannover-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tfJRPzi2hkbffzi6LCRoAYKv7B2ODW65P9OLf03cknE=; b=IrOtSE+ZPEy+Sy7nIlGx1D8497gyT8vG22WmPcUgBak+D9U5mdwTa8msz1I/DQdUpWPcYymq0LupimTYFxQ6+ruFVczSDdeSzKa0Tq7CNVW255lgTHmSYvdt1Cv3+L0cCc3NCGs/KNQ5lCXglfYkMIKmfniLQUm4geEMmupMYZU= Received: from AM0PR03CA0061.eurprd03.prod.outlook.com (2603:10a6:208::38) by AS8PR03MB7477.eurprd03.prod.outlook.com (2603:10a6:20b:2b7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.29; Tue, 23 May 2023 17:31:07 +0000 Received: from AM7EUR06FT063.eop-eur06.prod.protection.outlook.com (2603:10a6:208:0:cafe::66) by AM0PR03CA0061.outlook.office365.com (2603:10a6:208::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.29 via Frontend Transport; Tue, 23 May 2023 17:31:07 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 80.151.164.27) smtp.mailfrom=esd.eu; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=esd.eu; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning esd.eu discourages use of 80.151.164.27 as permitted sender) Received: from esd-s7.esd (80.151.164.27) by AM7EUR06FT063.mail.protection.outlook.com (10.233.255.147) with Microsoft SMTP Server id 15.20.6433.14 via Frontend Transport; Tue, 23 May 2023 17:31:07 +0000 Received: from esd-s20.esd.local (jenkins.esd [10.0.0.190]) by esd-s7.esd (Postfix) with ESMTPS id 03EDE7C16E3; Tue, 23 May 2023 19:31:07 +0200 (CEST) Received: by esd-s20.esd.local (Postfix, from userid 2046) id EC1E42E1806; Tue, 23 May 2023 19:31:06 +0200 (CEST) From: Frank Jungclaus To: linux-can@vger.kernel.org, Marc Kleine-Budde , Wolfgang Grandegger , Vincent Mailhol Cc: =?utf-8?q?Stefan_M=C3=A4tje?= , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Frank Jungclaus Subject: [PATCH 2/2] can: esd_usb: Use consistent prefix ESD_USB_ for macros Date: Tue, 23 May 2023 19:31:05 +0200 Message-Id: <20230523173105.3175086-3-frank.jungclaus@esd.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230523173105.3175086-1-frank.jungclaus@esd.eu> References: <20230523173105.3175086-1-frank.jungclaus@esd.eu> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7EUR06FT063:EE_|AS8PR03MB7477:EE_ X-MS-Office365-Filtering-Correlation-Id: ce9ae933-4035-4392-f8ea-08db5bb37e1f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1BupReRPjtI9hZzcaN6gC5LDbZllAaMg7Kv8cbpDIrJ0XH6rNc+ixSqNzmIlUDnS14ipMu+BpHFZZRZHsAI2uyYdOSnzc7Cf//ITZab/uiJw3OGtEMINvB5M+fF4/bV1s/3IGK9OAKl0oXdYGly9qxQ7e6ijPPYefSGNnNBWkHnnXbs5O0gSOI1Q4KDILIOZtfLiXKisE+n0vuCiDbwCEAGM8v9f/eLAjNftW0TvPZm8YzHKtI5j9YE8XLSWiDN9fLbpnAxCqqH7zyzZjrW9VtDpDnBIQYIQgD/uHC55Bgx1JMAQunxwDpM17r0W+5uqFT6CHxPLBwDfBCjKGWgCTD84IpCqRzajmp+DIDXG0jXuAgxa2mo8Dsw4mDLvodq+gEV8cmtah9TNYnHnzi/U3sm5xNdpQEQWYVI9Lgdn8Jh1mKwQnm1aAXBn4CnSn2WC84sGR53PIi2pgddDfyIIVBY7XyI1IgErDZFkdAQSqYVM2ObPUUPtdmRdW2ys21sauzq64lRt3CMeMKPlvQryRXo94kYKPNRmUBqNWJ2lzH1a+jehLPPnyAez6bslLP0/fGHHjogXatPew8NFBfh90Y9MuQawdTQ2d4pOWvuvlAcGxn5qJ7TKiH6x0Kh/3GV68w/u7emjqoScvZRFi0asTyLaXS23iBKHhNpbGuUtpDVxvW/FDUFeYk2UMQdGsxWZredzkZC5dU08mDiVQS/cYQ== X-Forefront-Antispam-Report: CIP:80.151.164.27;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:esd-s7.esd;PTR:p5097a41b.dip0.t-ipconnect.de;CAT:NONE;SFS:(13230028)(4636009)(396003)(39840400004)(376002)(346002)(136003)(451199021)(46966006)(36840700001)(54906003)(42186006)(110136005)(70586007)(70206006)(82310400005)(478600001)(86362001)(4326008)(316002)(36860700001)(81166007)(47076005)(356005)(83380400001)(41300700001)(336012)(186003)(2616005)(36756003)(6266002)(44832011)(2906002)(1076003)(26005)(5660300002)(40480700001)(8676002)(8936002);DIR:OUT;SFP:1102; X-OriginatorOrg: esd.eu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 17:31:07.5574 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ce9ae933-4035-4392-f8ea-08db5bb37e1f X-MS-Exchange-CrossTenant-Id: 5a9c3a1d-52db-4235-b74c-9fd851db2e6b X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5a9c3a1d-52db-4235-b74c-9fd851db2e6b;Ip=[80.151.164.27];Helo=[esd-s7.esd] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR06FT063.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7477 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Rename the following macros: - ESD_RTR to ESD_USB_RTR - ESD_EV_CAN_ERROR_EXT to ESD_USB_EV_CAN_ERROR_EXT Additionally remove the double newline trailing to definition of ESD_USB_RTR. Signed-off-by: Frank Jungclaus --- drivers/net/can/usb/esd_usb.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/can/usb/esd_usb.c b/drivers/net/can/usb/esd_usb.c index d40a04db7458..6201637ac0ff 100644 --- a/drivers/net/can/usb/esd_usb.c +++ b/drivers/net/can/usb/esd_usb.c @@ -43,8 +43,7 @@ MODULE_LICENSE("GPL v2"); #define ESD_USB_CMD_IDADD 6 /* also used for IDADD_REPLY */ /* esd CAN message flags - dlc field */ -#define ESD_RTR BIT(4) - +#define ESD_USB_RTR BIT(4) /* esd CAN message flags - id field */ #define ESD_USB_EXTID BIT(29) @@ -52,7 +51,7 @@ MODULE_LICENSE("GPL v2"); #define ESD_USB_IDMASK GENMASK(28, 0) /* esd CAN event ids */ -#define ESD_EV_CAN_ERROR_EXT 2 /* CAN controller specific diagnostic data */ +#define ESD_USB_EV_CAN_ERROR_EXT 2 /* CAN controller specific diagnostic data */ /* baudrate message flags */ #define ESD_USB_LOM BIT(30) /* Listen Only Mode */ @@ -228,7 +227,7 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv, struct sk_buff *skb; u32 id = le32_to_cpu(msg->rx.id) & ESD_USB_IDMASK; - if (id == ESD_EV_CAN_ERROR_EXT) { + if (id == ESD_USB_EV_CAN_ERROR_EXT) { u8 state = msg->rx.ev_can_err_ext.status; u8 ecc = msg->rx.ev_can_err_ext.ecc; @@ -341,13 +340,13 @@ static void esd_usb_rx_can_msg(struct esd_usb_net_priv *priv, } cf->can_id = id & ESD_USB_IDMASK; - can_frame_set_cc_len(cf, msg->rx.dlc & ~ESD_RTR, + can_frame_set_cc_len(cf, msg->rx.dlc & ~ESD_USB_RTR, priv->can.ctrlmode); if (id & ESD_USB_EXTID) cf->can_id |= CAN_EFF_FLAG; - if (msg->rx.dlc & ESD_RTR) { + if (msg->rx.dlc & ESD_USB_RTR) { cf->can_id |= CAN_RTR_FLAG; } else { for (i = 0; i < cf->len; i++) @@ -767,7 +766,7 @@ static netdev_tx_t esd_usb_start_xmit(struct sk_buff *skb, msg->tx.id = cpu_to_le32(cf->can_id & CAN_ERR_MASK); if (cf->can_id & CAN_RTR_FLAG) - msg->tx.dlc |= ESD_RTR; + msg->tx.dlc |= ESD_USB_RTR; if (cf->can_id & CAN_EFF_FLAG) msg->tx.id |= cpu_to_le32(ESD_USB_EXTID);