Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35560380rwd; Mon, 10 Jul 2023 09:07:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlFReZvIxqHQOAlLBsYmdxmbRf8mFDwWaOihk1hHz/G+QCAsKnkyiwWDrOIKdpe2DNd6t55B X-Received: by 2002:a17:907:2d2c:b0:98d:ebb7:a8b0 with SMTP id gs44-20020a1709072d2c00b0098debb7a8b0mr20569623ejc.14.1689005255381; Mon, 10 Jul 2023 09:07:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689005255; cv=none; d=google.com; s=arc-20160816; b=P8FgXZ6kA9foGPiDptSalEqO1a8/uxZBeWkgXJTJueKLcOBi4gUJHvo7envjY+dWaA JjxUmu3aJNb+JbK2VIf4pk46Jh9Tqr6JtZJgitPu75APQETJ1oWBpBVpc38OpQKrAphC q/QdDrSp6r4hwWSeaT3/UcFXYaZhBPhD1XVhK2xiH89mYwe2jfr0hPdQTIbEUBk6bTdd LJJWYsoiiQxsyOiYdaUhdE/BK3munxZr22gZ9++BKBLV9mGQG77hwMMzEzccePKHRmMl 2eoVTgm6XkDwPl8/kMK2HInwLBdv+sVvawEhAAbxfHQuJ5BoS4XoJTWcgX1n+fPGo/Op tWLQ== 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=yBZbHOlD6VizGIM1DeGRe0RTGa+49mLhN6tQEmZZZvE=; fh=CWfEt6/vd4IsHMc+T8W3bMkH4b5uOoX72TeJSijIGlU=; b=O3nDpdlSnjtDh8d7MCMXD9df48m0Q/1vGzN7R2hJ5F7WbtbN5tYjLZJ/cTAQmzVcSW wrkV1j9gvH0KP5JS8rUD6Aufu8h7CmhRABVwugivg5dQ7XLmXmS1+2PS4K624CrgDpBz tIt6ePbRfsFEUTFye/yISidPQgHsodzzHBk7DW30/TgqBcIyJTqJ4OKJZlJHn3Z0kNLL 76pdiRn52+abNS5ethaFfBXQRMFOAhCMFOvujGkafGkhvtfLyf2/dU5D4C4MIVXNUlua bHch6arc2qtWhzDSb1ScEfRNAC3kbTxHlxscbJfE2es5ckMsiixtoPalkRsxienytGlc +1xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dkGOw8BS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a1-20020a1709065f8100b00992e94c0d25si9900458eju.781.2023.07.10.09.06.47; Mon, 10 Jul 2023 09:07:35 -0700 (PDT) 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; dkim=pass header.i=@intel.com header.s=Intel header.b=dkGOw8BS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232860AbjGJPuW (ORCPT + 99 others); Mon, 10 Jul 2023 11:50:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233600AbjGJPty (ORCPT ); Mon, 10 Jul 2023 11:49:54 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3C5F19F; Mon, 10 Jul 2023 08:49:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689004193; x=1720540193; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iFM79YydR4MNlFIdl2NOHjMiuF+oxhq3YQtKaR8hU0E=; b=dkGOw8BSqNgYKRRwGpM3Yhu2OqwWEmJ3SBCvsWf+LarNUrKLz4WaAm/n xhSqbIR3a3EARtoOdvyUDp1nqApvAgC9oVToech6UUcjedf1itsBrN6JO uvSH9Mh6M5PnoeGfZqpXuGHvAAe92nMI9GU7ZfMiWuUxeWKklEDpM4NI0 J/sBa3Rx2wCZwSpG0jkTeXyummVoEf92xUJRHDcTvJZKUCduFdCAebDni 4d4ZfSDCcwpUBnyt4qvtf03+8v/7Wm+BUyNhJJ154UwnoxYrwys3hnr2S 3FQsaykPF3gf4Ksmn7Yx/r7eSpFxro7AZ6CEGgPivNr0nBqXNoPUoqbgv A==; X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="361842544" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="361842544" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2023 08:49:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="720743961" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="720743961" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 10 Jul 2023 08:49:37 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id B9DAD718; Mon, 10 Jul 2023 18:49:34 +0300 (EEST) From: Andy Shevchenko To: Mark Brown , Cristian Ciocaltea , Yang Yingliang , Andy Shevchenko , Amit Kumar Mahapatra via Alsa-devel , Neil Armstrong , Tharun Kumar P , Vijaya Krishna Nivarthi , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-riscv@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-trace-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Sanjay R Mehta , Radu Pirea , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Tudor Ambarus , Serge Semin , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Matthias Brugger , AngeloGioacchino Del Regno , Andy Gross , Bjorn Andersson , Konrad Dybcio , Heiko Stuebner , Palmer Dabbelt , Paul Walmsley , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Maxime Coquelin , Alexandre Torgue , Max Filippov , Steven Rostedt , Masami Hiramatsu , Richard Cochran Subject: [PATCH v2 10/15] spi: Use predefined constants from bits.h and units.h Date: Mon, 10 Jul 2023 18:49:27 +0300 Message-Id: <20230710154932.68377-11-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230710154932.68377-1-andriy.shevchenko@linux.intel.com> References: <20230710154932.68377-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Instead of hard coded numbers, use predefined constancts, such as BITS_PER_BYTE. Signed-off-by: Andy Shevchenko --- include/linux/spi/spi.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 9fb8efb068c6..10265184ea02 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -1294,9 +1295,9 @@ static inline bool spi_is_bpw_supported(struct spi_device *spi, u32 bpw) static inline unsigned int spi_controller_xfer_timeout(struct spi_controller *ctlr, struct spi_transfer *xfer) { - u32 speed_hz = xfer->speed_hz ?: 100000; + u32 speed_hz = xfer->speed_hz ?: 100 * HZ_PER_KHZ; - return max(xfer->len * 8 * 2 / (speed_hz / 1000), 500U); + return max(xfer->len * BITS_PER_BYTE * 2 / (speed_hz / MILLI), 500UL); } /*---------------------------------------------------------------------------*/ -- 2.40.0.1.gaa8946217a0b