From patchwork Fri Dec 29 14:50:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 183917 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp2615117dyb; Fri, 29 Dec 2023 06:51:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IHnqI/Of0RdW+N0O/ewtJFu3SfdM60b/4G1ipeabQztIUDJnsnbB75JOTxczyqx/bWdM4yl X-Received: by 2002:a2e:9883:0:b0:2cc:9789:3d4c with SMTP id b3-20020a2e9883000000b002cc97893d4cmr4201849ljj.37.1703861488296; Fri, 29 Dec 2023 06:51:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703861488; cv=none; d=google.com; s=arc-20160816; b=CDraOHzdTK2MadznDrUeUXk2q3J1bfSS8WVYw0O2R73ZBCgUWFmowYMfvBR8OSEfQg lcR+zqp7B4dKC+RYwoZW2te4Y8gv1GWU9rZRqnMUIjsK717jvgxAtciy9H3liu8yViFP IPIPHqttLcdjm90ayQ9nLyyG5+1xfF2NgH58ezMYMzD6vavpcgNzLizVItTc7bUSoMcz k57TLW7+myIhnhPtyG2LlFu6wFC4lLjQsgsLIJWYaVvO+JZdQYRtBnjhxJRnfEt07op+ QcQY0Dt9c/wvHocKF7pdynqqoI7OeH+GtIsefSFLQyDV9okDC/+jh2Jxo7hWO8pxT/GZ JWJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=YKa45nZApGLI1oHRhJDV4+z0Whl/jFWXeTFLKCmk5tE=; fh=tZUGqPWM9NzuekPiTOV6K/dqMWBJuHYOP+uZxIFLuv0=; b=x2FBTBmVTu2IZ5uznHz4CjA4hxl313vPR9OdbZySpk/4WShSBlc3wDovKCseG9g8G7 MYfNWiLkDnFWezaRp2wfR29iwv9vnQLp/oCyettPPIjZ8KlLLQc97xCTLqg64xgS7Jn6 YrXMBJotbH4S3RJsEJpnZYx2G+DRzCMYgMwjpiMP6vXbNQ5PHprdsFyDNVRJXUF9bYVc 2WIgsoJRWbgUuAvumI5t9NAMqpcLckFvY2AGQTsUPLToGVJVl0CnVXhMtgKuTTZBWr+Y IQpBqVCZfTRxKIPsVm/rpP3xiGOXUj9edehCSNyqHJwXMr9d4bULyAk7IXukC2lu7x5k YllQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=epBXIWDp; spf=pass (google.com: domain of linux-kernel+bounces-13123-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13123-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h22-20020a50cdd6000000b005541fd46b8csi7909321edj.115.2023.12.29.06.51.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 06:51:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13123-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=epBXIWDp; spf=pass (google.com: domain of linux-kernel+bounces-13123-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13123-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DF1F01F21AC5 for ; Fri, 29 Dec 2023 14:51:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 360E311CAD; Fri, 29 Dec 2023 14:51:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="epBXIWDp" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (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 9B51F11C81 for ; Fri, 29 Dec 2023 14:51:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703861469; x=1735397469; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dvIUAGYDbpNOrkJuEoFIYV3Hi7P1WdKlCDuxuKOr/z0=; b=epBXIWDpUHuANL1KjiLA9vvuW+Pz4fjdJFrXtXIzRpS52jvrmvGC9umm S/Hv/BxNecmSSGdeC+8Ir50/uYXitKtUNjGK0qpfxFcBr26EyKD+rv5Zi jcsQq6yEQPVyEE4ty6DLXnPrDYYjhKiN2aL/z1FMVJVAV2EHA/pXmCdkb KeTJOmNxEDjiX22+MuaYXewkmqN4T5k8ZcyZv8yhsHG4aesmv9ZNoW9z3 Yh2cKJDRZdus8j2uoSEQRfdMZwJi44vuTxDA/IUIU8HtYEbgyCP4S/2xM Kh56/zt20rFgPz+Yj+hLkQ9QLzwK1/AAKTLnshH3rca7CQ+MgtmwYe+yT A==; X-IronPort-AV: E=McAfee;i="6600,9927,10938"; a="3727766" X-IronPort-AV: E=Sophos;i="6.04,315,1695711600"; d="scan'208";a="3727766" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2023 06:51:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,315,1695711600"; d="scan'208";a="13303267" Received: from ijarvine-desk1.ger.corp.intel.com (HELO localhost) ([10.246.48.133]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2023 06:51:05 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: Peter Tyser , Lee Jones , linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 1/1] mfd: lpc_ich: Use ALIGN_DOWN() Date: Fri, 29 Dec 2023 16:50:59 +0200 Message-Id: <20231229145059.6138-1-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786628264069397975 X-GMAIL-MSGID: 1786628264069397975 Instead of open coding, use ALIGN_DOWN() for alignment. Signed-off-by: Ilpo Järvinen --- drivers/mfd/lpc_ich.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c index 73a0e7f9bd31..f14901660147 100644 --- a/drivers/mfd/lpc_ich.c +++ b/drivers/mfd/lpc_ich.c @@ -38,6 +38,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include #include @@ -1321,7 +1322,7 @@ static int lpc_ich_init_spi(struct pci_dev *dev) case INTEL_SPI_BYT: pci_read_config_dword(dev, SPIBASE_BYT, &spi_base); if (spi_base & SPIBASE_BYT_EN) { - res->start = spi_base & ~(SPIBASE_BYT_SZ - 1); + res->start = ALIGN_DOWN(spi_base, SPIBASE_BYT_SZ); res->end = res->start + SPIBASE_BYT_SZ - 1; info->set_writeable = lpc_ich_byt_set_writeable;