forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/scsi/snic/snic_trc.c
....@@ -126,7 +126,7 @@
126126 int tbuf_sz = 0, ret;
127127
128128 tbuf_sz = (snic_trace_max_pages * PAGE_SIZE);
129
- tbuf = vmalloc(tbuf_sz);
129
+ tbuf = vzalloc(tbuf_sz);
130130 if (!tbuf) {
131131 SNIC_ERR("Failed to Allocate Trace Buffer Size. %d\n", tbuf_sz);
132132 SNIC_ERR("Trace Facility not enabled.\n");
....@@ -135,16 +135,10 @@
135135 return ret;
136136 }
137137
138
- memset(tbuf, 0, tbuf_sz);
139138 trc->buf = (struct snic_trc_data *) tbuf;
140139 spin_lock_init(&trc->lock);
141140
142
- ret = snic_trc_debugfs_init();
143
- if (ret) {
144
- SNIC_ERR("Failed to create Debugfs Files.\n");
145
-
146
- goto error;
147
- }
141
+ snic_trc_debugfs_init();
148142
149143 trc->max_idx = (tbuf_sz / SNIC_TRC_ENTRY_SZ);
150144 trc->rd_idx = trc->wr_idx = 0;
....@@ -152,11 +146,6 @@
152146 SNIC_INFO("Trace Facility Enabled.\n Trace Buffer SZ %lu Pages.\n",
153147 tbuf_sz / PAGE_SIZE);
154148 ret = 0;
155
-
156
- return ret;
157
-
158
-error:
159
- snic_trc_free();
160149
161150 return ret;
162151 } /* end of snic_trc_init */