Skip to contentSkip to conversation

drm/nouveau: Rename bit_table()

PATCH In review Emil Velikov 2 participants 2 messages Apr 18, 2011 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau: Rename bit_table()

Rename bit_table() to find_bit_table() to make the if easier on the eyes, as well as to remove duplication i.e. existing struct already has the same name

---
 drivers/gpu/drm/nouveau/nouveau_bios.c |    4 ++--
 drivers/gpu/drm/nouveau/nouveau_bios.h |    2 +-
 drivers/gpu/drm/nouveau/nouveau_mem.c  |    2 +-
 drivers/gpu/drm/nouveau/nouveau_perf.c |    2 +-
 drivers/gpu/drm/nouveau/nouveau_temp.c |    2 +-
 drivers/gpu/drm/nouveau/nouveau_volt.c |    2 +-
 drivers/gpu/drm/nouveau/nv50_pm.c      |    2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/nouveau/nouveau_bios.c +2 -2
index 8486dc6..9cb09ee 100644
@@ -5493,7 +5493,7 @@ struct bit_table {
 #define BIT_TABLE(id, funcid) ((struct bit_table){ id, parse_bit_##funcid##_tbl_entry })
 
 int
-bit_table(struct drm_device *dev, u8 id, struct bit_entry *bit)
+find_bit_table(struct drm_device *dev, u8 id, struct bit_entry *bit)
 {
 	struct drm_nouveau_private *dev_priv = dev->dev_private;
 	struct nvbios *bios = &dev_priv->vbios;
@@ -5524,7 +5524,7 @@ parse_bit_table(struct nvbios *bios, const uint16_t bitoffset,
 	struct drm_device *dev = bios->dev;
 	struct bit_entry bitentry;
 
-	if (bit_table(dev, table->id, &bitentry) == 0)
+	if (find_bit_table(dev, table->id, &bitentry) == 0)
 		return table->parse_fn(dev, bios, &bitentry);
 
 	NV_INFO(dev, "BIT table '%c' not found\n", table->id);
drivers/gpu/drm/nouveau/nouveau_bios.h +1 -1
index 8a54fa7..2516ac4 100644
@@ -46,7 +46,7 @@ struct bit_entry {
 	uint8_t *data;
 };
 
-int bit_table(struct drm_device *, u8 id, struct bit_entry *);
+int find_bit_table(struct drm_device *, u8 id, struct bit_entry *);
 
 struct dcb_i2c_entry {
 	uint32_t entry;
drivers/gpu/drm/nouveau/nouveau_mem.c +1 -1
index ce3cb5e..b424218 100644
@@ -557,7 +557,7 @@ nouveau_mem_timing_init(struct drm_device *dev)
 	int i, recordlen, entries;
 
 	if (bios->type == NVBIOS_BIT) {
-		if (bit_table(dev, 'P', &P))
+		if (find_bit_table(dev, 'P', &P))
 			return;
 
 		if (P.version == 1)
drivers/gpu/drm/nouveau/nouveau_perf.c +1 -1
index 670e3cb..0457ae7 100644
@@ -84,7 +84,7 @@ nouveau_perf_init(struct drm_device *dev)
 	int vid, i;
 
 	if (bios->type == NVBIOS_BIT) {
-		if (bit_table(dev, 'P', &P))
+		if (find_bit_table(dev, 'P', &P))
 			return;
 
 		if (P.version != 1 && P.version != 2) {
drivers/gpu/drm/nouveau/nouveau_temp.c +1 -1
index 649b041..db6a091 100644
@@ -284,7 +284,7 @@ nouveau_temp_init(struct drm_device *dev)
 	u8 *temp = NULL;
 
 	if (bios->type == NVBIOS_BIT) {
-		if (bit_table(dev, 'P', &P))
+		if (find_bit_table(dev, 'P', &P))
 			return;
 
 		if (P.version == 1)
drivers/gpu/drm/nouveau/nouveau_volt.c +1 -1
index 75e8727..49b100d 100644
@@ -113,7 +113,7 @@ nouveau_volt_init(struct drm_device *dev)
 	int i, headerlen, recordlen, entries, vidmask, vidshift;
 
 	if (bios->type == NVBIOS_BIT) {
-		if (bit_table(dev, 'P', &P))
+		if (find_bit_table(dev, 'P', &P))
 			return;
 
 		if (P.version == 1)
drivers/gpu/drm/nouveau/nv50_pm.c +1 -1
index 8a28100..424361e 100644
@@ -111,7 +111,7 @@ nv50_pm_clock_set(struct drm_device *dev, void *pre_state)
 	int P = state->P;
 
 	if (state->type == PLL_MEMORY && perflvl->memscript &&
-	    bit_table(dev, 'M', &BIT_M) == 0 &&
+	    find_bit_table(dev, 'M', &BIT_M) == 0 &&
 	    BIT_M.version == 1 && BIT_M.length >= 0x0b) {
 		script = ROM16(BIT_M.data[0x05]);
 		if (script)
Signature · 1 line
1.7.1

A message that is not in the archive (sent off-list or not yet received): 1303090182-5218-1-git-send-email-emil.l.velikov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw

Sorry for the top post, sent from in bed, on a mobile phone.

Personally, I prefer how it is now. If people want it changed, I guess that's ok, but, bit_table_find() instead maybe?

Ben.

Sent from my iPhone

Quoted 122 lines · Emil Velikov

Rename bit_table() to find_bit_table() to make the if easier on the eyes, as well as to remove duplication i.e. existing struct already has the same name

---

drivers/gpu/drm/nouveau/nouveau_bios.c |    4 ++--
drivers/gpu/drm/nouveau/nouveau_bios.h |    2 +-
drivers/gpu/drm/nouveau/nouveau_mem.c  |    2 +-
drivers/gpu/drm/nouveau/nouveau_perf.c |    2 +-
drivers/gpu/drm/nouveau/nouveau_temp.c |    2 +-
drivers/gpu/drm/nouveau/nouveau_volt.c |    2 +-
drivers/gpu/drm/nouveau/nv50_pm.c      |    2 +-
7 files changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/nouveau/nouveau_bios.c +0 -0
index 8486dc6..9cb09ee 100644
@@ -5493,7 +5493,7 @@ struct bit_table {
 #define BIT_TABLE(id, funcid) ((struct bit_table){ id, parse_bit_##funcid##_tbl_entry })
 

int

drivers/gpu/drm/nouveau/nouveau_bios.c +1 -1
-bit_table(struct drm_device *dev, u8 id, struct bit_entry *bit)
+find_bit_table(struct drm_device *dev, u8 id, struct bit_entry *bit)
{
   struct drm_nouveau_private *dev_priv = dev->dev_private;
   struct nvbios *bios = &dev_priv->vbios;
drivers/gpu/drm/nouveau/nouveau_bios.c +1 -1
@@ -5524,7 +5524,7 @@ parse_bit_table(struct nvbios *bios, const uint16_t bitoffset,
   struct drm_device *dev = bios->dev;
   struct bit_entry bitentry;
 
-    if (bit_table(dev, table->id, &bitentry) == 0)
+    if (find_bit_table(dev, table->id, &bitentry) == 0)
       return table->parse_fn(dev, bios, &bitentry);
 
   NV_INFO(dev, "BIT table '%c' not found\n", table->id);
drivers/gpu/drm/nouveau/nouveau_bios.h +1 -1
index 8a54fa7..2516ac4 100644
@@ -46,7 +46,7 @@ struct bit_entry {
   uint8_t *data;
 };
 
-int bit_table(struct drm_device *, u8 id, struct bit_entry *);
+int find_bit_table(struct drm_device *, u8 id, struct bit_entry *);
 
 struct dcb_i2c_entry {
   uint32_t entry;
drivers/gpu/drm/nouveau/nouveau_mem.c +1 -1
index ce3cb5e..b424218 100644
@@ -557,7 +557,7 @@ nouveau_mem_timing_init(struct drm_device *dev)
   int i, recordlen, entries;
 
   if (bios->type == NVBIOS_BIT) {
-        if (bit_table(dev, 'P', &P))
+        if (find_bit_table(dev, 'P', &P))
           return;
 
       if (P.version == 1)
drivers/gpu/drm/nouveau/nouveau_perf.c +1 -1
index 670e3cb..0457ae7 100644
@@ -84,7 +84,7 @@ nouveau_perf_init(struct drm_device *dev)
   int vid, i;
 
   if (bios->type == NVBIOS_BIT) {
-        if (bit_table(dev, 'P', &P))
+        if (find_bit_table(dev, 'P', &P))
           return;
 
       if (P.version != 1 && P.version != 2) {
drivers/gpu/drm/nouveau/nouveau_temp.c +1 -1
index 649b041..db6a091 100644
@@ -284,7 +284,7 @@ nouveau_temp_init(struct drm_device *dev)
   u8 *temp = NULL;
 
   if (bios->type == NVBIOS_BIT) {
-        if (bit_table(dev, 'P', &P))
+        if (find_bit_table(dev, 'P', &P))
           return;
 
       if (P.version == 1)
drivers/gpu/drm/nouveau/nouveau_volt.c +1 -1
index 75e8727..49b100d 100644
@@ -113,7 +113,7 @@ nouveau_volt_init(struct drm_device *dev)
   int i, headerlen, recordlen, entries, vidmask, vidshift;
 
   if (bios->type == NVBIOS_BIT) {
-        if (bit_table(dev, 'P', &P))
+        if (find_bit_table(dev, 'P', &P))
           return;
 
       if (P.version == 1)
drivers/gpu/drm/nouveau/nv50_pm.c +1 -1
index 8a28100..424361e 100644
@@ -111,7 +111,7 @@ nv50_pm_clock_set(struct drm_device *dev, void *pre_state)
   int P = state->P;
 
   if (state->type == PLL_MEMORY && perflvl->memscript &&
-        bit_table(dev, 'M', &BIT_M) == 0 &&
+        find_bit_table(dev, 'M', &BIT_M) == 0 &&
       BIT_M.version == 1 && BIT_M.length >= 0x0b) {
       script = ROM16(BIT_M.data[0x05]);
       if (script)
Signature · 6 lines
1.7.1

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau