Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp4471842pxb; Sat, 12 Feb 2022 06:21:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzfK2yWf+zFlkY9TooCqOUxd7RQx3hlxQ/WtcPsrI3/billy8x5UluxAaVaFFJSh1SUXQki X-Received: by 2002:a63:982:: with SMTP id 124mr5202575pgj.438.1644675707097; Sat, 12 Feb 2022 06:21:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644675707; cv=none; d=google.com; s=arc-20160816; b=clj2hTvPEfZAgmUfpfBFyaGPSWTbFKyvMlUtQ5pCQU0/rUdcZA/HDeyHp4bftBe8cL dVdF59By00Mv1evR3G5T+a8yGWZfAkLxsljDsmrOkq4iMuVV/0qCJfbvOIOqLb6kQK0N RmZTIYAzkC4pxczu5SItKWmxzzDzLnEY8+KWzUFS688AArh1qer6Wx8RgyrXsIAfIKLD EHQXHRJVn2rTZ8e6NQ/GqJuMzY/aMWkfB2azkcsQBbssbdqs1tUK7MHxcPLgbMmtpwUK AsNuGFRwcMXb1iypVosP4AV6A+8JRzlYhNhgdre7PHMH9z1pPtvs96M9jgFHk2qZBFAI 4Nbw== 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 :message-id:date:subject:cc:to:from; bh=kLwr5zbgr0EUUreGJVPgEAVFHcyWt9zP0zc7yUevDOU=; b=0KTDyGUKouMx/F/kTnhpikXfc9ZcFnTMYez0rGYZupzZtZj7ySZ6Rv3QG0r4t4GM29 9bjjNZ/T+VkIgHoSzykk46ZbYoY4a38q8rzFGR219W3cQQDAJoJ0TEk2FyTJR1AvVkOl CYVf+5yjN5RxSoJupF/4Xs40uqqNepXL5i0i1XrxEf1MsoQ28v4aI8T84p/RJ0tpB9yR AYHLl189K7O/tu24GW2K7x+ZbV3lP9MHrKj3/uTroiaRcgfN/+ZNJrxQXjTVbOLxaBx+ jVW/cJQ6a+mw9ubes2bDRbvnAEnnXRS100/4dTRKJlYKzWTNAaut6fvXUUK1OaRDgAok xlDQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j190si896918pge.526.2022.02.12.06.21.31; Sat, 12 Feb 2022 06:21:47 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233851AbiBLNIR (ORCPT + 99 others); Sat, 12 Feb 2022 08:08:17 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235866AbiBLNII (ORCPT ); Sat, 12 Feb 2022 08:08:08 -0500 Received: from smtp.smtpout.orange.fr (smtp01.smtpout.orange.fr [80.12.242.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D2272982D for ; Sat, 12 Feb 2022 05:08:04 -0800 (PST) Received: from localhost.localdomain ([124.33.176.97]) by smtp.orange.fr with ESMTPA id Is7sniOlvu3WEIs80n92xc; Sat, 12 Feb 2022 14:07:55 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: MDU0YmViZGZmMDIzYiBlMiM2NTczNTRjNWZkZTMwOGRiOGQ4ODf3NWI1ZTMyMzdiODlhOQ== X-ME-Date: Sat, 12 Feb 2022 14:07:55 +0100 X-ME-IP: 124.33.176.97 From: Vincent Mailhol To: netdev@vger.kernel.org, linux-can@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Marc Kleine-Budde , Vincent Mailhol Subject: [PATCH] can: etas_es58x: use BITS_PER_TYPE() instead of manual calculation Date: Sat, 12 Feb 2022 22:07:37 +0900 Message-Id: <20220212130737.3008-1-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 The input to the GENMASK() macro was calculated by hand. Replaced it with a dedicated macro: BITS_PER_TYPE() which does the exact same job. Signed-off-by: Vincent Mailhol --- drivers/net/can/usb/etas_es58x/es58x_fd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/can/usb/etas_es58x/es58x_fd.c b/drivers/net/can/usb/etas_es58x/es58x_fd.c index ec87126e1a7d..88d2540abbbe 100644 --- a/drivers/net/can/usb/etas_es58x/es58x_fd.c +++ b/drivers/net/can/usb/etas_es58x/es58x_fd.c @@ -69,7 +69,8 @@ static int es58x_fd_echo_msg(struct net_device *netdev, int i, num_element; u32 rcv_packet_idx; - const u32 mask = GENMASK(31, sizeof(echo_msg->packet_idx) * 8); + const u32 mask = GENMASK(BITS_PER_TYPE(mask) - 1, + BITS_PER_TYPE(echo_msg->packet_idx)); num_element = es58x_msg_num_element(es58x_dev->dev, es58x_fd_urb_cmd->echo_msg, -- 2.34.1