Ignore:
Timestamp:
Jan 3, 2021, 7:20:20 AM (5 years ago)
Author:
Paul Smedley
Message:

Code cleanups to simplify future maintenance, update regmap/regcache/rbtree to linux 4.19.163 level

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-next/lib32/regcache-flat.c

    r615 r625  
    1010 * published by the Free Software Foundation.
    1111 */
    12 /* from 4.14.202 */
     12/* from 4.19.163 */
    1313
    1414#include <linux/device.h>
    1515#include <linux/seq_file.h>
    1616#include <linux/slab.h>
    17 #include <linux/module.h>
    18 #include <linux/workqueue.h>
    19 #include <linux/byteorder/little_endian.h>
    20 #include <linux/printk.h>
    2117
    2218#include "internal.h"
     
    4339        cache = map->cache;
    4440
    45         for (i = 0; i < map->num_reg_defaults; i++)
    46                 cache[regcache_flat_get_index(map, map->reg_defaults[i].reg)] =
    47                                 map->reg_defaults[i].def;
     41        for (i = 0; i < map->num_reg_defaults; i++) {
     42                unsigned int reg = map->reg_defaults[i].reg;
     43                unsigned int index = regcache_flat_get_index(map, reg);
     44
     45                cache[index] = map->reg_defaults[i].def;
     46        }
    4847
    4948        return 0;
     
    6261{
    6362        unsigned int *cache = map->cache;
     63        unsigned int index = regcache_flat_get_index(map, reg);
    6464
    65         *value = cache[regcache_flat_get_index(map, reg)];
     65        *value = cache[index];
    6666
    6767        return 0;
     
    7272{
    7373        unsigned int *cache = map->cache;
     74        unsigned int index = regcache_flat_get_index(map, reg);
    7475
    75         cache[regcache_flat_get_index(map, reg)] = value;
     76        cache[index] = value;
    7677
    7778        return 0;
Note: See TracChangeset for help on using the changeset viewer.