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

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

 




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.
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

--
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