OSDN Git Service

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 eaf5905..9908334 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 6bc712f..d426b86 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 57adefa..ca9ed3d 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);                \