Skip to content

Commit

Permalink
drm/nouveau/core: get rid of math.h, replace log2i with order_base_2
Browse files Browse the repository at this point in the history
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ilia Mirkin authored and Ben Skeggs committed Sep 4, 2013
1 parent ef25bd8 commit 57be046
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 27 deletions.
3 changes: 1 addition & 2 deletions drivers/gpu/drm/nouveau/core/core/ramht.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#include <core/object.h>
#include <core/ramht.h>
#include <core/math.h>

#include <subdev/bar.h>

Expand Down Expand Up @@ -104,6 +103,6 @@ nouveau_ramht_new(struct nouveau_object *parent, struct nouveau_object *pargpu,
if (ret)
return ret;

ramht->bits = log2i(nv_gpuobj(ramht)->size >> 3);
ramht->bits = order_base_2(nv_gpuobj(ramht)->size >> 3);
return 0;
}
3 changes: 1 addition & 2 deletions drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <core/engctx.h>
#include <core/ramht.h>
#include <core/class.h>
#include <core/math.h>

#include <subdev/timer.h>
#include <subdev/bar.h>
Expand Down Expand Up @@ -278,7 +277,7 @@ nv50_fifo_chan_ctor_ind(struct nouveau_object *parent,
return ret;

ioffset = args->ioffset;
ilength = log2i(args->ilength / 8);
ilength = order_base_2(args->ilength / 8);

nv_wo32(base->ramfc, 0x3c, 0x403f6078);
nv_wo32(base->ramfc, 0x44, 0x01003fff);
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <core/ramht.h>
#include <core/event.h>
#include <core/class.h>
#include <core/math.h>

#include <subdev/timer.h>
#include <subdev/bar.h>
Expand Down Expand Up @@ -258,7 +257,7 @@ nv84_fifo_chan_ctor_ind(struct nouveau_object *parent,
nv_parent(chan)->object_detach = nv50_fifo_object_detach;

ioffset = args->ioffset;
ilength = log2i(args->ilength / 8);
ilength = order_base_2(args->ilength / 8);

nv_wo32(base->ramfc, 0x3c, 0x403f6078);
nv_wo32(base->ramfc, 0x44, 0x01003fff);
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <core/engctx.h>
#include <core/event.h>
#include <core/class.h>
#include <core/math.h>
#include <core/enum.h>

#include <subdev/timer.h>
Expand Down Expand Up @@ -200,7 +199,7 @@ nvc0_fifo_chan_ctor(struct nouveau_object *parent,

usermem = chan->base.chid * 0x1000;
ioffset = args->ioffset;
ilength = log2i(args->ilength / 8);
ilength = order_base_2(args->ilength / 8);

for (i = 0; i < 0x1000; i += 4)
nv_wo32(priv->user.mem, usermem + i, 0x00000000);
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <core/engctx.h>
#include <core/event.h>
#include <core/class.h>
#include <core/math.h>
#include <core/enum.h>

#include <subdev/timer.h>
Expand Down Expand Up @@ -240,7 +239,7 @@ nve0_fifo_chan_ctor(struct nouveau_object *parent,

usermem = chan->base.chid * 0x200;
ioffset = args->ioffset;
ilength = log2i(args->ilength / 8);
ilength = order_base_2(args->ilength / 8);

for (i = 0; i < 0x200; i += 4)
nv_wo32(priv->user.mem, usermem + i, 0x00000000);
Expand Down
16 changes: 0 additions & 16 deletions drivers/gpu/drm/nouveau/core/include/core/math.h

This file was deleted.

3 changes: 2 additions & 1 deletion drivers/gpu/drm/nouveau/core/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
#include <linux/i2c-algo-bit.h>
#include <linux/delay.h>
#include <linux/io-mapping.h>
#include <linux/vmalloc.h>
#include <linux/acpi.h>
#include <linux/vmalloc.h>
#include <linux/dmi.h>
#include <linux/reboot.h>
#include <linux/interrupt.h>
#include <linux/log2.h>

#include <asm/unaligned.h>

Expand Down

0 comments on commit 57be046

Please sign in to comment.