driver: base: Prefer unsigned int to bare use of unsigned
authorJinchao Wang <wjc@cdjrlc.com>
Mon, 28 Jun 2021 17:19:07 +0000 (01:19 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Jul 2021 15:30:09 +0000 (17:30 +0200)
Fix checkpatch warnings:
    WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

Signed-off-by: Jinchao Wang <wjc@cdjrlc.com>
Link: https://lore.kernel.org/r/20210628171907.63646-2-wjc@cdjrlc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/cpu.c
drivers/base/map.c
drivers/base/node.c

index 5ef14db9790478b81979367fecdd94c4eda6f02e..5fc258073bc7575905e64801bb71d464126c66ac 100644 (file)
@@ -388,7 +388,7 @@ int register_cpu(struct cpu *cpu, int num)
        return 0;
 }
 
-struct device *get_cpu_device(unsigned cpu)
+struct device *get_cpu_device(unsigned int cpu)
 {
        if (cpu < nr_cpu_ids && cpu_possible(cpu))
                return per_cpu(cpu_sys_devices, cpu);
@@ -484,7 +484,7 @@ static const struct attribute_group *cpu_root_attr_groups[] = {
        NULL,
 };
 
-bool cpu_is_hotpluggable(unsigned cpu)
+bool cpu_is_hotpluggable(unsigned int cpu)
 {
        struct device *dev = get_cpu_device(cpu);
        return dev && container_of(dev, struct cpu, dev)->hotpluggable;
index 5650ab2b247ada40dc7eb74e2214e444859291d6..83aeb09ca161112192c3a91db2bce7d0e25196b6 100644 (file)
@@ -33,9 +33,9 @@ int kobj_map(struct kobj_map *domain, dev_t dev, unsigned long range,
             struct module *module, kobj_probe_t *probe,
             int (*lock)(dev_t, void *), void *data)
 {
-       unsigned n = MAJOR(dev + range - 1) - MAJOR(dev) + 1;
-       unsigned index = MAJOR(dev);
-       unsigned i;
+       unsigned int n = MAJOR(dev + range - 1) - MAJOR(dev) + 1;
+       unsigned int index = MAJOR(dev);
+       unsigned int i;
        struct probe *p;
 
        if (n > 255)
@@ -67,9 +67,9 @@ int kobj_map(struct kobj_map *domain, dev_t dev, unsigned long range,
 
 void kobj_unmap(struct kobj_map *domain, dev_t dev, unsigned long range)
 {
-       unsigned n = MAJOR(dev + range - 1) - MAJOR(dev) + 1;
-       unsigned index = MAJOR(dev);
-       unsigned i;
+       unsigned int n = MAJOR(dev + range - 1) - MAJOR(dev) + 1;
+       unsigned int index = MAJOR(dev);
+       unsigned int i;
        struct probe *found = NULL;
 
        if (n > 255)
index 4a4ae868ad9f8482285220f97fa3ec8dea2526c9..2bc9089f3e78ba892294de560f81a7cf15c7c514 100644 (file)
@@ -75,7 +75,7 @@ static DEVICE_ATTR_RO(cpulist);
 struct node_access_nodes {
        struct device           dev;
        struct list_head        list_node;
-       unsigned                access;
+       unsigned int            access;
 #ifdef CONFIG_HMEM_REPORTING
        struct node_hmem_attrs  hmem_attrs;
 #endif
@@ -122,7 +122,7 @@ static void node_access_release(struct device *dev)
 }
 
 static struct node_access_nodes *node_init_node_access(struct node *node,
-                                                      unsigned access)
+                                                      unsigned int access)
 {
        struct node_access_nodes *access_node;
        struct device *dev;
@@ -187,7 +187,7 @@ static struct attribute *access_attrs[] = {
  * @access: The access class the for the given attributes
  */
 void node_set_perf_attrs(unsigned int nid, struct node_hmem_attrs *hmem_attrs,
-                        unsigned access)
+                        unsigned int access)
 {
        struct node_access_nodes *c;
        struct node *node;
@@ -711,7 +711,7 @@ int register_cpu_under_node(unsigned int cpu, unsigned int nid)
  */
 int register_memory_node_under_compute_node(unsigned int mem_nid,
                                            unsigned int cpu_nid,
-                                           unsigned access)
+                                           unsigned int access)
 {
        struct node *init_node, *targ_node;
        struct node_access_nodes *initiator, *target;