瀏覽代碼

[DM/FIXUP] Fixup NVME build

1. Fixup Kconfig show order.
2. Fix `RT_DECLARE_IRQ_AFFINITY` to `RT_IRQ_AFFINITY_DECLARE`
3. Remove warning.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
GuEe-GUI 4 月之前
父節點
當前提交
0ede1d6c65
共有 2 個文件被更改,包括 6 次插入6 次删除
  1. 1 1
      components/drivers/Kconfig
  2. 5 5
      components/drivers/nvme/nvme.c

+ 1 - 1
components/drivers/Kconfig

@@ -25,8 +25,8 @@ rsource "led/Kconfig"
 rsource "mailbox/Kconfig"
 rsource "phye/Kconfig"
 rsource "ata/Kconfig"
-rsource "block/Kconfig"
 rsource "nvme/Kconfig"
+rsource "block/Kconfig"
 rsource "scsi/Kconfig"
 rsource "regulator/Kconfig"
 rsource "reset/Kconfig"

+ 5 - 5
components/drivers/nvme/nvme.c

@@ -578,7 +578,7 @@ static rt_err_t nvme_blk_sync(struct rt_blk_disk *disk)
 
 static rt_err_t nvme_blk_erase(struct rt_blk_disk *disk)
 {
-    rt_err_t err;
+    rt_err_t err = RT_EOK;
     rt_ssize_t slba, lbas, max_lbas;
     struct rt_nvme_command cmd;
     struct rt_nvme_device *ndev = rt_disk_to_nvme_device(disk);
@@ -955,7 +955,7 @@ static rt_err_t nvme_setup_io_queues(struct rt_nvme_controller *nvme)
     int irq, cpuid = 0;
     char name[RT_NAME_MAX];
     rt_bool_t affinity_fixup = RT_FALSE;
-    RT_DECLARE_IRQ_AFFINITY(affinity) = { 0 };
+    RT_IRQ_AFFINITY_DECLARE(affinity) = { 0 };
     struct rt_nvme_queue *queue;
 
     nvme->io_queue_max = nvme->irqs_nr > 1 ? nvme->irqs_nr - 1 : 1;
@@ -1052,7 +1052,7 @@ static void nvme_remove_devices(struct rt_nvme_controller *nvme)
 static rt_err_t nvme_scan_device(struct rt_nvme_controller *nvme,
         rt_size_t number_of_ns)
 {
-    rt_err_t err;
+    rt_err_t err = RT_EOK;
     rt_uint32_t lbaf;
     struct rt_nvme_id_ns *id = RT_NULL;
 
@@ -1272,8 +1272,8 @@ static int nvme_queue_affinify_fixup(void)
 {
     int cpuid = rt_hw_cpu_id();
     struct rt_nvme_controller *nvme;
-    RT_DECLARE_IRQ_AFFINITY(affinity) = { 0 };
-    RT_DECLARE_IRQ_AFFINITY(current_affinity) = { 0 };
+    RT_IRQ_AFFINITY_DECLARE(affinity) = { 0 };
+    RT_IRQ_AFFINITY_DECLARE(current_affinity) = { 0 };
 
     RT_IRQ_AFFINITY_SET(affinity, cpuid);