Commit 950fbfab authored by Marcin Slusarz's avatar Marcin Slusarz Committed by Ben Skeggs

drm/nouveau: mark nv_printk_ as printf-like function

...and fix all warnings
Signed-off-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent a4cea27b
...@@ -127,7 +127,7 @@ nv84_crypt_intr(struct nouveau_subdev *subdev) ...@@ -127,7 +127,7 @@ nv84_crypt_intr(struct nouveau_subdev *subdev)
chid = pfifo->chid(pfifo, engctx); chid = pfifo->chid(pfifo, engctx);
if (stat) { if (stat) {
nv_error(priv, ""); nv_error(priv, "%s", "");
nouveau_bitfield_print(nv84_crypt_intr_mask, stat); nouveau_bitfield_print(nv84_crypt_intr_mask, stat);
pr_cont(" ch %d [0x%010llx %s] mthd 0x%04x data 0x%08x\n", pr_cont(" ch %d [0x%010llx %s] mthd 0x%04x data 0x%08x\n",
chid, (u64)inst << 12, nouveau_client_name(engctx), chid, (u64)inst << 12, nouveau_client_name(engctx),
......
...@@ -1298,7 +1298,7 @@ nv04_graph_intr(struct nouveau_subdev *subdev) ...@@ -1298,7 +1298,7 @@ nv04_graph_intr(struct nouveau_subdev *subdev)
nv_wr32(priv, NV04_PGRAPH_FIFO, 0x00000001); nv_wr32(priv, NV04_PGRAPH_FIFO, 0x00000001);
if (show) { if (show) {
nv_error(priv, ""); nv_error(priv, "%s", "");
nouveau_bitfield_print(nv04_graph_intr_name, show); nouveau_bitfield_print(nv04_graph_intr_name, show);
pr_cont(" nsource:"); pr_cont(" nsource:");
nouveau_bitfield_print(nv04_graph_nsource, nsource); nouveau_bitfield_print(nv04_graph_nsource, nsource);
......
...@@ -1194,7 +1194,7 @@ nv10_graph_intr(struct nouveau_subdev *subdev) ...@@ -1194,7 +1194,7 @@ nv10_graph_intr(struct nouveau_subdev *subdev)
nv_wr32(priv, NV04_PGRAPH_FIFO, 0x00000001); nv_wr32(priv, NV04_PGRAPH_FIFO, 0x00000001);
if (show) { if (show) {
nv_error(priv, ""); nv_error(priv, "%s", "");
nouveau_bitfield_print(nv10_graph_intr_name, show); nouveau_bitfield_print(nv10_graph_intr_name, show);
pr_cont(" nsource:"); pr_cont(" nsource:");
nouveau_bitfield_print(nv04_graph_nsource, nsource); nouveau_bitfield_print(nv04_graph_nsource, nsource);
......
...@@ -225,7 +225,7 @@ nv20_graph_intr(struct nouveau_subdev *subdev) ...@@ -225,7 +225,7 @@ nv20_graph_intr(struct nouveau_subdev *subdev)
nv_wr32(priv, NV04_PGRAPH_FIFO, 0x00000001); nv_wr32(priv, NV04_PGRAPH_FIFO, 0x00000001);
if (show) { if (show) {
nv_error(priv, ""); nv_error(priv, "%s", "");
nouveau_bitfield_print(nv10_graph_intr_name, show); nouveau_bitfield_print(nv10_graph_intr_name, show);
pr_cont(" nsource:"); pr_cont(" nsource:");
nouveau_bitfield_print(nv04_graph_nsource, nsource); nouveau_bitfield_print(nv04_graph_nsource, nsource);
......
...@@ -322,7 +322,7 @@ nv40_graph_intr(struct nouveau_subdev *subdev) ...@@ -322,7 +322,7 @@ nv40_graph_intr(struct nouveau_subdev *subdev)
nv_wr32(priv, NV04_PGRAPH_FIFO, 0x00000001); nv_wr32(priv, NV04_PGRAPH_FIFO, 0x00000001);
if (show) { if (show) {
nv_error(priv, ""); nv_error(priv, "%s", "");
nouveau_bitfield_print(nv10_graph_intr_name, show); nouveau_bitfield_print(nv10_graph_intr_name, show);
pr_cont(" nsource:"); pr_cont(" nsource:");
nouveau_bitfield_print(nv04_graph_nsource, nsource); nouveau_bitfield_print(nv04_graph_nsource, nsource);
......
...@@ -787,7 +787,7 @@ nv50_graph_intr(struct nouveau_subdev *subdev) ...@@ -787,7 +787,7 @@ nv50_graph_intr(struct nouveau_subdev *subdev)
nv_wr32(priv, 0x400500, 0x00010001); nv_wr32(priv, 0x400500, 0x00010001);
if (show) { if (show) {
nv_error(priv, ""); nv_error(priv, "%s", "");
nouveau_bitfield_print(nv50_graph_intr_name, show); nouveau_bitfield_print(nv50_graph_intr_name, show);
pr_cont("\n"); pr_cont("\n");
nv_error(priv, nv_error(priv,
......
...@@ -133,7 +133,7 @@ static inline u8 ...@@ -133,7 +133,7 @@ static inline u8
nv_ro08(void *obj, u64 addr) nv_ro08(void *obj, u64 addr)
{ {
u8 data = nv_ofuncs(obj)->rd08(obj, addr); u8 data = nv_ofuncs(obj)->rd08(obj, addr);
nv_spam(obj, "nv_ro08 0x%08x 0x%02x\n", addr, data); nv_spam(obj, "nv_ro08 0x%08llx 0x%02x\n", addr, data);
return data; return data;
} }
...@@ -141,7 +141,7 @@ static inline u16 ...@@ -141,7 +141,7 @@ static inline u16
nv_ro16(void *obj, u64 addr) nv_ro16(void *obj, u64 addr)
{ {
u16 data = nv_ofuncs(obj)->rd16(obj, addr); u16 data = nv_ofuncs(obj)->rd16(obj, addr);
nv_spam(obj, "nv_ro16 0x%08x 0x%04x\n", addr, data); nv_spam(obj, "nv_ro16 0x%08llx 0x%04x\n", addr, data);
return data; return data;
} }
...@@ -149,28 +149,28 @@ static inline u32 ...@@ -149,28 +149,28 @@ static inline u32
nv_ro32(void *obj, u64 addr) nv_ro32(void *obj, u64 addr)
{ {
u32 data = nv_ofuncs(obj)->rd32(obj, addr); u32 data = nv_ofuncs(obj)->rd32(obj, addr);
nv_spam(obj, "nv_ro32 0x%08x 0x%08x\n", addr, data); nv_spam(obj, "nv_ro32 0x%08llx 0x%08x\n", addr, data);
return data; return data;
} }
static inline void static inline void
nv_wo08(void *obj, u64 addr, u8 data) nv_wo08(void *obj, u64 addr, u8 data)
{ {
nv_spam(obj, "nv_wo08 0x%08x 0x%02x\n", addr, data); nv_spam(obj, "nv_wo08 0x%08llx 0x%02x\n", addr, data);
nv_ofuncs(obj)->wr08(obj, addr, data); nv_ofuncs(obj)->wr08(obj, addr, data);
} }
static inline void static inline void
nv_wo16(void *obj, u64 addr, u16 data) nv_wo16(void *obj, u64 addr, u16 data)
{ {
nv_spam(obj, "nv_wo16 0x%08x 0x%04x\n", addr, data); nv_spam(obj, "nv_wo16 0x%08llx 0x%04x\n", addr, data);
nv_ofuncs(obj)->wr16(obj, addr, data); nv_ofuncs(obj)->wr16(obj, addr, data);
} }
static inline void static inline void
nv_wo32(void *obj, u64 addr, u32 data) nv_wo32(void *obj, u64 addr, u32 data)
{ {
nv_spam(obj, "nv_wo32 0x%08x 0x%08x\n", addr, data); nv_spam(obj, "nv_wo32 0x%08llx 0x%08x\n", addr, data);
nv_ofuncs(obj)->wr32(obj, addr, data); nv_ofuncs(obj)->wr32(obj, addr, data);
} }
......
...@@ -15,7 +15,8 @@ struct nouveau_object; ...@@ -15,7 +15,8 @@ struct nouveau_object;
#define NV_PRINTK_TRACE KERN_DEBUG #define NV_PRINTK_TRACE KERN_DEBUG
#define NV_PRINTK_SPAM KERN_DEBUG #define NV_PRINTK_SPAM KERN_DEBUG
void nv_printk_(struct nouveau_object *, const char *, int, const char *, ...); void __printf(4, 5)
nv_printk_(struct nouveau_object *, const char *, int, const char *, ...);
#define nv_printk(o,l,f,a...) do { \ #define nv_printk(o,l,f,a...) do { \
if (NV_DBG_##l <= CONFIG_NOUVEAU_DEBUG) \ if (NV_DBG_##l <= CONFIG_NOUVEAU_DEBUG) \
......
...@@ -1866,7 +1866,7 @@ init_zm_reg_group(struct nvbios_init *init) ...@@ -1866,7 +1866,7 @@ init_zm_reg_group(struct nvbios_init *init)
u32 addr = nv_ro32(bios, init->offset + 1); u32 addr = nv_ro32(bios, init->offset + 1);
u8 count = nv_ro08(bios, init->offset + 5); u8 count = nv_ro08(bios, init->offset + 5);
trace("ZM_REG_GROUP\tR[0x%06x] =\n"); trace("ZM_REG_GROUP\tR[0x%06x] =\n", addr);
init->offset += 6; init->offset += 6;
while (count--) { while (count--) {
......
...@@ -104,8 +104,8 @@ nouveau_devobj_ctor(struct nouveau_object *parent, ...@@ -104,8 +104,8 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
struct nouveau_device *device; struct nouveau_device *device;
struct nouveau_devobj *devobj; struct nouveau_devobj *devobj;
struct nv_device_class *args = data; struct nv_device_class *args = data;
u64 disable, boot0, strap; u32 boot0, strap;
u64 mmio_base, mmio_size; u64 disable, mmio_base, mmio_size;
void __iomem *map; void __iomem *map;
int ret, i, c; int ret, i, c;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment