aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/misc/mei/hw-txe.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2018-07-23 13:21:22 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-24 14:16:57 +0200
commit9fc5f0f8ad28405145b30fd3b905e368063ee14c (patch)
tree27822d572c0e2844039967fe38046a606d49df06 /drivers/misc/mei/hw-txe.c
parentMerge tag 'fsi-updates-2018-07-24' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/linux-fsi into char-misc-testing (diff)
downloadwireguard-linux-9fc5f0f8ad28405145b30fd3b905e368063ee14c.tar.xz
wireguard-linux-9fc5f0f8ad28405145b30fd3b905e368063ee14c.zip
mei: cleanup slots to data conversions
Cleanup conversions between slots and data. Define MEI_SLOT_SIZE instead of using 4 or sizeof(u32) across the source code. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/hw-txe.c')
-rw-r--r--drivers/misc/mei/hw-txe.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/misc/mei/hw-txe.c b/drivers/misc/mei/hw-txe.c
index a5e551ffb2dd..0facd823634e 100644
--- a/drivers/misc/mei/hw-txe.c
+++ b/drivers/misc/mei/hw-txe.c
@@ -682,7 +682,7 @@ static void mei_txe_hw_config(struct mei_device *dev)
struct mei_txe_hw *hw = to_txe_hw(dev);
/* Doesn't change in runtime */
- dev->hbuf_depth = PAYLOAD_SIZE / 4;
+ dev->hbuf_depth = PAYLOAD_SIZE / MEI_SLOT_SIZE;
hw->aliveness = mei_txe_aliveness_get(dev);
hw->readiness = mei_txe_readiness_get(dev);
@@ -766,7 +766,7 @@ static int mei_txe_write(struct mei_device *dev,
*
* @dev: the device structure
*
- * Return: the PAYLOAD_SIZE - 4
+ * Return: the PAYLOAD_SIZE - header size
*/
static size_t mei_txe_hbuf_max_len(const struct mei_device *dev)
{
@@ -797,7 +797,7 @@ static int mei_txe_hbuf_empty_slots(struct mei_device *dev)
static int mei_txe_count_full_read_slots(struct mei_device *dev)
{
/* read buffers has static size */
- return PAYLOAD_SIZE / 4;
+ return PAYLOAD_SIZE / MEI_SLOT_SIZE;
}
/**
@@ -839,7 +839,7 @@ static int mei_txe_read(struct mei_device *dev,
dev_dbg(dev->dev, "buffer-length = %lu buf[0]0x%08X\n",
len, mei_txe_out_data_read(dev, 0));
- for (i = 0; i < len / 4; i++) {
+ for (i = 0; i < len / MEI_SLOT_SIZE; i++) {
/* skip header: index starts from 1 */
reg = mei_txe_out_data_read(dev, i + 1);
dev_dbg(dev->dev, "buf[%d] = 0x%08X\n", i, reg);