aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2013-05-08 17:37:45 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2013-05-16 13:14:06 -0400
commitc34924b9503ca73ae36573d6ce08a34677c05081 (patch)
treeaad1bd2072e35b5a41bc069142dd893a0ca1efcb /drivers/mfd
parentb0222afa5bab555c378d2ab82b32078c9e942b3a (diff)
mfd: cros_ec_spi: Use %z to format pointer differences
Before commit 5c29e47e6ac55b63c76999eb5b283a80208726c5 ("mfd: cros_ec_spi: Warnings fix"), 64-bit compiles gave the following warnings: drivers/mfd/cros_ec_spi.c: In function 'cros_ec_spi_receive_response': drivers/mfd/cros_ec_spi.c:123:5: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long int' [-Wformat] drivers/mfd/cros_ec_spi.c:157:3: warning: format '%d' expects argument of type 'int', but argument 6 has type 'long int' [-Wformat] drivers/mfd/cros_ec_spi.c:181:2: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long int' [-Wformat] After that commit, 32-bit compiles give: drivers/mfd/cros_ec_spi.c: In function ‘cros_ec_spi_receive_response’: drivers/mfd/cros_ec_spi.c:123: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘int’ drivers/mfd/cros_ec_spi.c:157: warning: format ‘%ld’ expects type ‘long int’, but argument 6 has type ‘int’ drivers/mfd/cros_ec_spi.c:181: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘int’ Use %z to format pointer differences to kill the warnings on both 32-bit and 64-bit. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/cros_ec_spi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mfd/cros_ec_spi.c b/drivers/mfd/cros_ec_spi.c
index 19193cf1e7a1..367ccb58ecb1 100644
--- a/drivers/mfd/cros_ec_spi.c
+++ b/drivers/mfd/cros_ec_spi.c
@@ -120,7 +120,7 @@ static int cros_ec_spi_receive_response(struct cros_ec_device *ec_dev,
120 120
121 for (end = ptr + EC_MSG_PREAMBLE_COUNT; ptr != end; ptr++) { 121 for (end = ptr + EC_MSG_PREAMBLE_COUNT; ptr != end; ptr++) {
122 if (*ptr == EC_MSG_HEADER) { 122 if (*ptr == EC_MSG_HEADER) {
123 dev_dbg(ec_dev->dev, "msg found at %ld\n", 123 dev_dbg(ec_dev->dev, "msg found at %zd\n",
124 ptr - ec_dev->din); 124 ptr - ec_dev->din);
125 break; 125 break;
126 } 126 }
@@ -154,7 +154,7 @@ static int cros_ec_spi_receive_response(struct cros_ec_device *ec_dev,
154 * maximum-supported transfer size. 154 * maximum-supported transfer size.
155 */ 155 */
156 todo = min(need_len, 256); 156 todo = min(need_len, 256);
157 dev_dbg(ec_dev->dev, "loop, todo=%d, need_len=%d, ptr=%ld\n", 157 dev_dbg(ec_dev->dev, "loop, todo=%d, need_len=%d, ptr=%zd\n",
158 todo, need_len, ptr - ec_dev->din); 158 todo, need_len, ptr - ec_dev->din);
159 159
160 memset(&trans, '\0', sizeof(trans)); 160 memset(&trans, '\0', sizeof(trans));
@@ -178,7 +178,7 @@ static int cros_ec_spi_receive_response(struct cros_ec_device *ec_dev,
178 need_len -= todo; 178 need_len -= todo;
179 } 179 }
180 180
181 dev_dbg(ec_dev->dev, "loop done, ptr=%ld\n", ptr - ec_dev->din); 181 dev_dbg(ec_dev->dev, "loop done, ptr=%zd\n", ptr - ec_dev->din);
182 182
183 return 0; 183 return 0;
184} 184}