diff options
| author | kartik <kkartik@nvidia.com> | 2018-09-03 05:34:02 -0400 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-05 01:16:18 -0400 |
| commit | 5f341d3864979e8694b88234f9c43b881484b5d9 (patch) | |
| tree | 2213d87bfef9a1ca4917217930a13614d5e7e532 /drivers/i2c | |
| parent | 233d8c34db47629c78f863ad29320dc4d404d005 (diff) | |
i2c: tegra: use compatible base types
__le32 is an unsigned int with bitwise attribute, which is used by
sparse utility to make sure that the variable is converted to local
processor type. That's why typecasting from unsigned int to __le32
or vice versa is throwing a warning.
Bug 200434802
Change-Id: I91f5e2734666c358b1ecb58e4ca99003e15b84bd
Signed-off-by: kartik <kkartik@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1811817
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/i2c')
| -rw-r--r-- | drivers/i2c/busses/i2c-tegra-vi.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-tegra-vi.c b/drivers/i2c/busses/i2c-tegra-vi.c index e7d41d1bc..e39d7a41d 100644 --- a/drivers/i2c/busses/i2c-tegra-vi.c +++ b/drivers/i2c/busses/i2c-tegra-vi.c | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | * Copyright (C) 2015 Google, Inc. | 7 | * Copyright (C) 2015 Google, Inc. |
| 8 | * Author: Tomasz Figa <tfiga@chromium.org> | 8 | * Author: Tomasz Figa <tfiga@chromium.org> |
| 9 | * | 9 | * |
| 10 | * Copyright (C) 2010-2017 NVIDIA Corporation. All rights reserved. | 10 | * Copyright (C) 2010-2018 NVIDIA Corporation. All rights reserved. |
| 11 | * | 11 | * |
| 12 | * This software is licensed under the terms of the GNU General Public | 12 | * This software is licensed under the terms of the GNU General Public |
| 13 | * License version 2, as published by the Free Software Foundation, and | 13 | * License version 2, as published by the Free Software Foundation, and |
| @@ -666,6 +666,7 @@ static int tegra_i2c_flush_fifos(struct tegra_i2c_dev *i2c_dev) | |||
| 666 | static int tegra_i2c_empty_rx_fifo(struct tegra_i2c_dev *i2c_dev) | 666 | static int tegra_i2c_empty_rx_fifo(struct tegra_i2c_dev *i2c_dev) |
| 667 | { | 667 | { |
| 668 | u32 val; | 668 | u32 val; |
| 669 | __le32 val_le; | ||
| 669 | int rx_fifo_avail; | 670 | int rx_fifo_avail; |
| 670 | u8 *buf = i2c_dev->msg_buf; | 671 | u8 *buf = i2c_dev->msg_buf; |
| 671 | size_t buf_remaining = i2c_dev->msg_buf_remaining; | 672 | size_t buf_remaining = i2c_dev->msg_buf_remaining; |
| @@ -693,8 +694,8 @@ static int tegra_i2c_empty_rx_fifo(struct tegra_i2c_dev *i2c_dev) | |||
| 693 | if (rx_fifo_avail > 0 && buf_remaining > 0) { | 694 | if (rx_fifo_avail > 0 && buf_remaining > 0) { |
| 694 | BUG_ON(buf_remaining > 3); | 695 | BUG_ON(buf_remaining > 3); |
| 695 | val = i2c_readl(i2c_dev, I2C_RX_FIFO); | 696 | val = i2c_readl(i2c_dev, I2C_RX_FIFO); |
| 696 | val = cpu_to_le32(val); | 697 | val_le = cpu_to_le32(val); |
| 697 | memcpy(buf, &val, buf_remaining); | 698 | memcpy(buf, &val_le, buf_remaining); |
| 698 | buf_remaining = 0; | 699 | buf_remaining = 0; |
| 699 | rx_fifo_avail--; | 700 | rx_fifo_avail--; |
| 700 | } | 701 | } |
| @@ -708,6 +709,7 @@ static int tegra_i2c_empty_rx_fifo(struct tegra_i2c_dev *i2c_dev) | |||
| 708 | static int tegra_i2c_fill_tx_fifo(struct tegra_i2c_dev *i2c_dev) | 709 | static int tegra_i2c_fill_tx_fifo(struct tegra_i2c_dev *i2c_dev) |
| 709 | { | 710 | { |
| 710 | u32 val; | 711 | u32 val; |
| 712 | __le32 val_le; | ||
| 711 | int tx_fifo_avail; | 713 | int tx_fifo_avail; |
| 712 | u8 *buf = i2c_dev->msg_buf; | 714 | u8 *buf = i2c_dev->msg_buf; |
| 713 | size_t buf_remaining = i2c_dev->msg_buf_remaining; | 715 | size_t buf_remaining = i2c_dev->msg_buf_remaining; |
| @@ -752,8 +754,8 @@ static int tegra_i2c_fill_tx_fifo(struct tegra_i2c_dev *i2c_dev) | |||
| 752 | */ | 754 | */ |
| 753 | if (tx_fifo_avail > 0 && buf_remaining > 0) { | 755 | if (tx_fifo_avail > 0 && buf_remaining > 0) { |
| 754 | BUG_ON(buf_remaining > 3); | 756 | BUG_ON(buf_remaining > 3); |
| 755 | memcpy(&val, buf, buf_remaining); | 757 | memcpy(&val_le, buf, buf_remaining); |
| 756 | val = le32_to_cpu(val); | 758 | val = le32_to_cpu(val_le); |
| 757 | 759 | ||
| 758 | /* Again update before writing to FIFO to make sure isr sees. */ | 760 | /* Again update before writing to FIFO to make sure isr sees. */ |
| 759 | i2c_dev->msg_buf_remaining = 0; | 761 | i2c_dev->msg_buf_remaining = 0; |
