* This involves a hypercall.
  */
 int hv_post_message(union hv_connection_id connection_id,
-                 enum hv_message_type message_type,
-                 void *payload, size_t payload_size)
+                       enum hv_message_type message_type,
+                       void *payload, size_t payload_size)
 {
        struct hv_input_post_message *aligned_msg;
        unsigned long flags;
                        status = HV_STATUS_INVALID_PARAMETER;
        } else {
                status = hv_do_hypercall(HVCALL_POST_MESSAGE,
-                               aligned_msg, NULL);
+                                        aligned_msg, NULL);
        }
 
        local_irq_restore(flags);
 
        hv_context.hv_numa_map = kcalloc(nr_node_ids, sizeof(struct cpumask),
                                         GFP_KERNEL);
-       if (hv_context.hv_numa_map == NULL) {
+       if (!hv_context.hv_numa_map) {
                pr_err("Unable to allocate NUMA map\n");
                goto err;
        }
                hv_cpu = per_cpu_ptr(hv_context.cpu_context, cpu);
 
                tasklet_init(&hv_cpu->msg_dpc,
-                            vmbus_on_msg_dpc, (unsigned long) hv_cpu);
+                            vmbus_on_msg_dpc, (unsigned long)hv_cpu);
 
                if (ms_hyperv.paravisor_present && hv_isolation_type_tdx()) {
                        hv_cpu->post_msg_page = (void *)get_zeroed_page(GFP_ATOMIC);
-                       if (hv_cpu->post_msg_page == NULL) {
+                       if (!hv_cpu->post_msg_page) {
                                pr_err("Unable to allocate post msg page\n");
                                goto err;
                        }
                if (!ms_hyperv.paravisor_present && !hv_root_partition) {
                        hv_cpu->synic_message_page =
                                (void *)get_zeroed_page(GFP_ATOMIC);
-                       if (hv_cpu->synic_message_page == NULL) {
+                       if (!hv_cpu->synic_message_page) {
                                pr_err("Unable to allocate SYNIC message page\n");
                                goto err;
                        }
 
                        hv_cpu->synic_event_page =
                                (void *)get_zeroed_page(GFP_ATOMIC);
-                       if (hv_cpu->synic_event_page == NULL) {
+                       if (!hv_cpu->synic_event_page) {
                                pr_err("Unable to allocate SYNIC event page\n");
 
                                free_page((unsigned long)hv_cpu->synic_message_page);
        return ret;
 }
 
-
 void hv_synic_free(void)
 {
        int cpu, ret;
 
        for_each_present_cpu(cpu) {
-               struct hv_per_cpu_context *hv_cpu
-                       = per_cpu_ptr(hv_context.cpu_context, cpu);
+               struct hv_per_cpu_context *hv_cpu =
+                       per_cpu_ptr(hv_context.cpu_context, cpu);
 
                /* It's better to leak the page if the encryption fails. */
                if (ms_hyperv.paravisor_present && hv_isolation_type_tdx()) {
  */
 void hv_synic_enable_regs(unsigned int cpu)
 {
-       struct hv_per_cpu_context *hv_cpu
-               = per_cpu_ptr(hv_context.cpu_context, cpu);
+       struct hv_per_cpu_context *hv_cpu =
+               per_cpu_ptr(hv_context.cpu_context, cpu);
        union hv_synic_simp simp;
        union hv_synic_siefp siefp;
        union hv_synic_sint shared_sint;
                /* Mask out vTOM bit. ioremap_cache() maps decrypted */
                u64 base = (simp.base_simp_gpa << HV_HYP_PAGE_SHIFT) &
                                ~ms_hyperv.shared_gpa_boundary;
-               hv_cpu->synic_message_page
-                       = (void *)ioremap_cache(base, HV_HYP_PAGE_SIZE);
+               hv_cpu->synic_message_page =
+                       (void *)ioremap_cache(base, HV_HYP_PAGE_SIZE);
                if (!hv_cpu->synic_message_page)
                        pr_err("Fail to map synic message page.\n");
        } else {
                /* Mask out vTOM bit. ioremap_cache() maps decrypted */
                u64 base = (siefp.base_siefp_gpa << HV_HYP_PAGE_SHIFT) &
                                ~ms_hyperv.shared_gpa_boundary;
-               hv_cpu->synic_event_page
-                       = (void *)ioremap_cache(base, HV_HYP_PAGE_SIZE);
+               hv_cpu->synic_event_page =
+                       (void *)ioremap_cache(base, HV_HYP_PAGE_SIZE);
                if (!hv_cpu->synic_event_page)
                        pr_err("Fail to map synic event page.\n");
        } else {
  */
 void hv_synic_disable_regs(unsigned int cpu)
 {
-       struct hv_per_cpu_context *hv_cpu
-               = per_cpu_ptr(hv_context.cpu_context, cpu);
+       struct hv_per_cpu_context *hv_cpu =
+               per_cpu_ptr(hv_context.cpu_context, cpu);
        union hv_synic_sint shared_sint;
        union hv_synic_simp simp;
        union hv_synic_siefp siefp;
 
  * Begin protocol definitions.
  */
 
-
-
 /*
  * Protocol versions. The low word is the minor version, the high word the major
  * version.
        DYNMEM_PROTOCOL_VERSION_CURRENT = DYNMEM_PROTOCOL_VERSION_WIN10
 };
 
-
-
 /*
  * Message Types
  */
        DM_VERSION_1_MAX                = 12
 };
 
-
 /*
  * Structures defining the dynamic memory management
  * protocol.
        __u32 version;
 } __packed;
 
-
 union dm_caps {
        struct {
                __u64 balloon:1;
        __u64  page_range;
 } __packed;
 
-
-
 /*
  * The header for all dynamic memory messages:
  *
        __u8 data[]; /* enclosed message */
 } __packed;
 
-
 /*
  * Specific message types supporting the dynamic memory protocol.
  */
        __u32 io_diff;
 } __packed;
 
-
 /*
  * Message to ask the guest to allocate memory - balloon up message.
  * This message is sent from the host to the guest. The guest may not be
        __u32 reservedz;
 } __packed;
 
-
 /*
  * Balloon response message; this message is sent from the guest
  * to the host in response to the balloon message.
  *
  * reservedz: Reserved; must be set to zero.
  * more_pages: If FALSE, this is the last message of the transaction.
- * if TRUE there will atleast one more message from the guest.
+ * if TRUE there will be at least one more message from the guest.
  *
  * range_count: The number of ranges in the range array.
  *
  * to the guest to give guest more memory.
  *
  * more_pages: If FALSE, this is the last message of the transaction.
- * if TRUE there will atleast one more message from the guest.
+ * if TRUE there will be at least one more message from the guest.
  *
  * reservedz: Reserved; must be set to zero.
  *
        struct dm_header hdr;
 } __packed;
 
-
 /*
  * Hot add request message. Message sent from the host to the guest.
  *
        MAX_INFO_TYPE
 };
 
-
 /*
  * Header for the information message.
  */
 
 static int hv_hypercall_multi_failure;
 
-module_param(hot_add, bool, (S_IRUGO | S_IWUSR));
+module_param(hot_add, bool, 0644);
 MODULE_PARM_DESC(hot_add, "If set attempt memory hot_add");
 
-module_param(pressure_report_delay, uint, (S_IRUGO | S_IWUSR));
+module_param(pressure_report_delay, uint, 0644);
 MODULE_PARM_DESC(pressure_report_delay, "Delay in secs in reporting pressure");
 static atomic_t trans_id = ATOMIC_INIT(0);
 
        DM_INIT_ERROR
 };
 
-
 static __u8 recv_buffer[HV_HYP_PAGE_SIZE];
 static __u8 balloon_up_send_buffer[HV_HYP_PAGE_SIZE];
 
        struct hv_hotadd_gap *gap;
 
        /* The page is not backed. */
-       if ((pfn < has->covered_start_pfn) || (pfn >= has->covered_end_pfn))
+       if (pfn < has->covered_start_pfn || pfn >= has->covered_end_pfn)
                return false;
 
        /* Check for gaps. */
        list_for_each_entry(gap, &has->gap_list, list) {
-               if ((pfn >= gap->start_pfn) && (pfn < gap->end_pfn))
+               if (pfn >= gap->start_pfn && pfn < gap->end_pfn)
                        return false;
        }
 
        guard(spinlock_irqsave)(&dm_device.ha_lock);
        list_for_each_entry(has, &dm_device.ha_region_list, list) {
                /* The page belongs to a different HAS. */
-               if ((pfn < has->start_pfn) ||
-                               (pfn + (1UL << order) > has->end_pfn))
+               if (pfn < has->start_pfn ||
+                   (pfn + (1UL << order) > has->end_pfn))
                        continue;
 
                hv_bring_pgs_online(has, pfn, 1UL << order);
 }
 
 static unsigned long handle_pg_range(unsigned long pg_start,
-                                       unsigned long pg_count)
+                                    unsigned long pg_count)
 {
        unsigned long start_pfn = pg_start;
        unsigned long pfn_cnt = pg_count;
        unsigned long res = 0, flags;
 
        pr_debug("Hot adding %lu pages starting at pfn 0x%lx.\n", pg_count,
-               pg_start);
+                pg_start);
 
        spin_lock_irqsave(&dm_device.ha_lock, flags);
        list_for_each_entry(has, &dm_device.ha_region_list, list) {
                        if (start_pfn > has->start_pfn &&
                            online_section_nr(pfn_to_section_nr(start_pfn)))
                                hv_bring_pgs_online(has, start_pfn, pgs_ol);
-
                }
 
-               if ((has->ha_end_pfn < has->end_pfn) && (pfn_cnt > 0)) {
+               if (has->ha_end_pfn < has->end_pfn && pfn_cnt > 0) {
                        /*
                         * We have some residual hot add range
                         * that needs to be hot added; hot add
        rg_start = dm->ha_wrk.ha_region_range.finfo.start_page;
        rg_sz = dm->ha_wrk.ha_region_range.finfo.page_cnt;
 
-       if ((rg_start == 0) && (!dm->host_specified_ha_region)) {
+       if (rg_start == 0 && !dm->host_specified_ha_region) {
                /*
                 * The host has not specified the hot-add region.
                 * Based on the hot-add page range being specified,
 
        if (do_hot_add)
                resp.page_count = process_hot_add(pg_start, pfn_cnt,
-                                               rg_start, rg_sz);
+                                                 rg_start, rg_sz);
 
        dm->num_pages_added += resp.page_count;
 #endif
                                sizeof(struct dm_status),
                                (unsigned long)NULL,
                                VM_PKT_DATA_INBAND, 0);
-
 }
 
 static void free_balloon_pages(struct hv_dynmem_device *dm,
-                        union dm_mem_page_range *range_array)
+                              union dm_mem_page_range *range_array)
 {
        int num_pages = range_array->finfo.page_cnt;
        __u64 start_frame = range_array->finfo.start_page;
        }
 }
 
-
-
 static unsigned int alloc_balloon_pages(struct hv_dynmem_device *dm,
                                        unsigned int num_pages,
                                        struct dm_balloon_response *bl_resp,
                        page_to_pfn(pg);
                bl_resp->range_array[i].finfo.page_cnt = alloc_unit;
                bl_resp->hdr.size += sizeof(union dm_mem_page_range);
-
        }
 
        return i * alloc_unit;
 
                if (num_ballooned == 0 || num_ballooned == num_pages) {
                        pr_debug("Ballooned %u out of %u requested pages.\n",
-                               num_pages, dm_device.balloon_wrk.num_pages);
+                                num_pages, dm_device.balloon_wrk.num_pages);
 
                        bl_resp->more_pages = 0;
                        done = true;
 
                        for (i = 0; i < bl_resp->range_count; i++)
                                free_balloon_pages(&dm_device,
-                                                &bl_resp->range_array[i]);
+                                                  &bl_resp->range_array[i]);
 
                        done = true;
                }
        }
-
 }
 
 static void balloon_down(struct hv_dynmem_device *dm,
-                       struct dm_unballoon_request *req)
+                        struct dm_unballoon_request *req)
 {
        union dm_mem_page_range *range_array = req->range_array;
        int range_count = req->range_count;
        }
 
        pr_debug("Freed %u ballooned pages.\n",
-               prev_pages_ballooned - dm->num_pages_ballooned);
+                prev_pages_ballooned - dm->num_pages_ballooned);
 
        if (req->more_pages == 1)
                return;
        struct hv_dynmem_device *dm = dm_dev;
 
        while (!kthread_should_stop()) {
-               wait_for_completion_interruptible_timeout(
-                                               &dm_device.config_event, 1*HZ);
+               wait_for_completion_interruptible_timeout(&dm_device.config_event, 1 * HZ);
                /*
                 * The host expects us to post information on the memory
                 * pressure every second.
        return 0;
 }
 
-
 static void version_resp(struct hv_dynmem_device *dm,
-                       struct dm_version_response *vresp)
+                        struct dm_version_response *vresp)
 {
        struct dm_version_request version_req;
        int ret;
 }
 
 static void cap_resp(struct hv_dynmem_device *dm,
-                       struct dm_capabilities_resp_msg *cap_resp)
+                    struct dm_capabilities_resp_msg *cap_resp)
 {
        if (!cap_resp->is_accepted) {
                pr_err("Capabilities not accepted by host\n");
                switch (dm_hdr->type) {
                case DM_VERSION_RESPONSE:
                        version_resp(dm,
-                                (struct dm_version_response *)dm_msg);
+                                    (struct dm_version_response *)dm_msg);
                        break;
 
                case DM_CAPABILITIES_RESPONSE:
 
                        dm->state = DM_BALLOON_DOWN;
                        balloon_down(dm,
-                                (struct dm_unballoon_request *)recv_buffer);
+                                    (struct dm_unballoon_request *)recv_buffer);
                        break;
 
                case DM_MEM_HOT_ADD_REQUEST:
 
                default:
                        pr_warn_ratelimited("Unhandled message: type: %d\n", dm_hdr->type);
-
                }
        }
-
 }
 
 #define HV_LARGE_REPORTING_ORDER       9
 #define HV_LARGE_REPORTING_LEN (HV_HYP_PAGE_SIZE << \
                HV_LARGE_REPORTING_ORDER)
 static int hv_free_page_report(struct page_reporting_dev_info *pr_dev_info,
-                   struct scatterlist *sgl, unsigned int nents)
+                              struct scatterlist *sgl, unsigned int nents)
 {
        unsigned long flags;
        struct hv_memory_hint *hint;
                 */
 
                /* page reporting for pages 2MB or higher */
-               if (order >= HV_LARGE_REPORTING_ORDER ) {
+               if (order >= HV_LARGE_REPORTING_ORDER) {
                        range->page.largepage = 1;
                        range->page_size = HV_GPA_PAGE_RANGE_PAGE_SIZE_2MB;
                        range->base_large_pfn = page_to_hvpfn(
                        range->page.additional_pages =
                                (sg->length / HV_HYP_PAGE_SIZE) - 1;
                }
-
        }
 
        status = hv_do_rep_hypercall(HV_EXT_CALL_MEMORY_HEAT_HINT, nents, 0,
                                     hint, NULL);
        local_irq_restore(flags);
        if (!hv_result_success(status)) {
-
                pr_err("Cold memory discard hypercall failed with status %llx\n",
-                               status);
+                      status);
                if (hv_hypercall_multi_failure > 0)
                        hv_hypercall_multi_failure++;
 
                if (hv_result(status) == HV_STATUS_INVALID_PARAMETER) {
                        pr_err("Underlying Hyper-V does not support order less than 9. Hypercall failed\n");
                        pr_err("Defaulting to page_reporting_order %d\n",
-                                       pageblock_order);
+                              pageblock_order);
                        page_reporting_order = pageblock_order;
                        hv_hypercall_multi_failure++;
                        return -EINVAL;
                pr_err("Failed to enable cold memory discard: %d\n", ret);
        } else {
                pr_info("Cold memory discard hint enabled with order %d\n",
-                               page_reporting_order);
+                       page_reporting_order);
        }
 }
 
        if (ret)
                goto out;
 
-       t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ);
+       t = wait_for_completion_timeout(&dm_device.host_event, 5 * HZ);
        if (t == 0) {
                ret = -ETIMEDOUT;
                goto out;
        if (ret)
                goto out;
 
-       t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ);
+       t = wait_for_completion_timeout(&dm_device.host_event, 5 * HZ);
        if (t == 0) {
                ret = -ETIMEDOUT;
                goto out;
        char *sname;
 
        seq_printf(f, "%-22s: %u.%u\n", "host_version",
-                               DYNMEM_MAJOR_VERSION(dm->version),
-                               DYNMEM_MINOR_VERSION(dm->version));
+                       DYNMEM_MAJOR_VERSION(dm->version),
+                       DYNMEM_MINOR_VERSION(dm->version));
 
        seq_printf(f, "%-22s:", "capabilities");
        if (ballooning_enabled())
        seq_printf(f, "%-22s: %u\n", "pages_ballooned", dm->num_pages_ballooned);
 
        seq_printf(f, "%-22s: %lu\n", "total_pages_committed",
-                               get_pages_committed(dm));
+                  get_pages_committed(dm));
 
        seq_printf(f, "%-22s: %llu\n", "max_dynamic_page_count",
-                               dm->max_dynamic_page_count);
+                  dm->max_dynamic_page_count);
 
        return 0;
 }
 static void  hv_balloon_debugfs_init(struct hv_dynmem_device *b)
 {
        debugfs_create_file("hv-balloon", 0444, NULL, b,
-                       &hv_balloon_debug_fops);
+                           &hv_balloon_debug_fops);
 }
 
 static void  hv_balloon_debugfs_exit(struct hv_dynmem_device *b)
        tasklet_enable(&hv_dev->channel->callback_event);
 
        return 0;
-
 }
 
 static int balloon_resume(struct hv_device *dev)
 
 static int __init init_balloon_drv(void)
 {
-
        return vmbus_driver_register(&balloon_drv);
 }