drm/nouveau/core: constify nv*_printk macros
authorAlexandre Courbot <acourbot@nvidia.com>
Tue, 13 Dec 2016 08:11:17 +0000 (17:11 +0900)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 17 Feb 2017 05:14:30 +0000 (15:14 +1000)
Constify the local variables declared in these macros so we can pass
const pointers to them.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/include/nvkm/core/client.h
drivers/gpu/drm/nouveau/include/nvkm/core/device.h
drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h

index eaf5905a87a3264ba2b5e533dddf71e48e2579f3..99083349c3d41433a9564f310b75fed44257469d 100644 (file)
@@ -37,8 +37,8 @@ int nvkm_client_notify_put(struct nvkm_client *, int index);
 
 /* logging for client-facing objects */
 #define nvif_printk(o,l,p,f,a...) do {                                         \
-       struct nvkm_object *_object = (o);                                     \
-       struct nvkm_client *_client = _object->client;                         \
+       const struct nvkm_object *_object = (o);                               \
+       const struct nvkm_client *_client = _object->client;                   \
        if (_client->debug >= NV_DBG_##l)                                      \
                printk(KERN_##p "nouveau: %s:%08x:%08x: "f, _client->name,     \
                       _object->handle, _object->oclass, ##a);                 \
index 6bc712f32c8b4a0850e7445c7bb2a096464cf90d..d426b86e27128f06b1a0d7844562a9ac03bd9983 100644 (file)
@@ -262,7 +262,7 @@ extern const struct nvkm_sclass nvkm_udevice_sclass;
 
 /* device logging */
 #define nvdev_printk_(d,l,p,f,a...) do {                                       \
-       struct nvkm_device *_device = (d);                                     \
+       const struct nvkm_device *_device = (d);                               \
        if (_device->debug >= (l))                                             \
                dev_##p(_device->dev, f, ##a);                                 \
 } while(0)
index 57adefa8b08ef44337c0e62335d448a4799c926f..ca9ed3d68f44eeaa77fb4909d75747a8aa2576fb 100644 (file)
@@ -32,7 +32,7 @@ void nvkm_subdev_intr(struct nvkm_subdev *);
 
 /* subdev logging */
 #define nvkm_printk_(s,l,p,f,a...) do {                                        \
-       struct nvkm_subdev *_subdev = (s);                                     \
+       const struct nvkm_subdev *_subdev = (s);                               \
        if (_subdev->debug >= (l)) {                                           \
                dev_##p(_subdev->device->dev, "%s: "f,                         \
                        nvkm_subdev_name[_subdev->index], ##a);                \