Re: [PATCH v3] Add TI CDCE925 I2C controlled clock synthesizer driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 02-06-15 09:50, Paul Bolle wrote:
On Mon, 2015-06-01 at 12:13 +0200, Mike Looijmans wrote:
--- /dev/null
+++ b/drivers/clk/clk-cdce925.c

+static int cdce925_regmap_i2c_write(
+	void *context, const void *data, size_t count)

+	dev_dbg(&i2c->dev, "%s(%u) %#x %#x\n", __func__, count,
+			reg_data[0], reg_data[1]);

For some silly reason (ie, I mistakenly thought I spotted an issue) I
did a quick build of this file. That triggered some noise on x86_64.

Indeed, I hadn't verified building on a 64-bit platform, and the format string is incorrect.

Thanks for spotting it and suggesting a fix, I'll integrate it in a v4 patch.

Out of curiousity, I did try a compile on the x86 host, but couldn't select the driver because it depends on CONFIG_OF, so I just compiled if for the ARM target to verify that it still compiles in kernel 4.1. How did you manage to compile the driver on the x86?


Excerpt:

drivers/clk/clk-cdce925.c: In function ‘cdce925_regmap_i2c_write’:
include/linux/dynamic_debug.h:64:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘size_t’ [-Wformat=]
   static struct _ddebug  __aligned(8)   \
                 ^
[...]
drivers/clk/clk-cdce925.c:505:2: note: in expansion of macro ‘dev_dbg’
   dev_dbg(&i2c->dev, "%s(%u) %#x %#x\n", __func__, count,
   ^

A quick look at Documentation/printk-formats.txt suggested this (very
lightly tested) fix:
@@ -502,7 +502,7 @@ static int cdce925_regmap_i2c_write(
         reg_data[0] = CDCE925_I2C_COMMAND_BYTE_TRANSFER | ((u8 *)data)[0];
         reg_data[1] = ((u8 *)data)[1];

-       dev_dbg(&i2c->dev, "%s(%u) %#x %#x\n", __func__, count,
+       dev_dbg(&i2c->dev, "%s(%zu) %#x %#x\n", __func__, count,
                         reg_data[0], reg_data[1]);

         ret = i2c_master_send(i2c, reg_data, count);

+static int cdce925_regmap_i2c_read(void *context,
+	   const void *reg, size_t reg_size, void *val, size_t val_size)

+		dev_dbg(&i2c->dev, "%s(%u, %u) %#x %#x\n", __func__,
+				reg_size, val_size, reg_data[0], *((u8 *)val));

Likewise:
@@ -547,7 +547,7 @@ static int cdce925_regmap_i2c_read(void *context,

         ret = i2c_transfer(i2c->adapter, xfer, 2);
         if (likely(ret == 2)) {
-               dev_dbg(&i2c->dev, "%s(%u, %u) %#x %#x\n", __func__,
+               dev_dbg(&i2c->dev, "%s(%zu, %zu) %#x %#x\n", __func__,
                                 reg_size, val_size, reg_data[0], *((u8 *)val));
                 return 0;
         } else if (ret < 0)

Thanks,


Paul Bolle




Kind regards,

Mike Looijmans
System Expert

TOPIC Embedded Products
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
Telefax: +31 (0) 499 33 69 70
E-mail: mike.looijmans@xxxxxxxxxxxxxxxxx
Website: www.topicproducts.com

Please consider the environment before printing this e-mail





--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux