| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 3 | | - * it under the terms of the GNU General Public License, version 2, as |
|---|
| 4 | | - * published by the Free Software Foundation. |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 7 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 8 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 9 | | - * GNU General Public License for more details. |
|---|
| 10 | | - * |
|---|
| 11 | | - * You should have received a copy of the GNU General Public License |
|---|
| 12 | | - * along with this program; if not, write to the Free Software |
|---|
| 13 | | - * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|---|
| 14 | 3 | * |
|---|
| 15 | 4 | * Copyright IBM Corp. 2008 |
|---|
| 16 | 5 | * |
|---|
| .. | .. |
|---|
| 222 | 211 | |
|---|
| 223 | 212 | snprintf(dbg_fname, sizeof(dbg_fname), "vm%u_vcpu%u_timing", |
|---|
| 224 | 213 | current->pid, id); |
|---|
| 225 | | - debugfs_file = debugfs_create_file(dbg_fname, 0666, |
|---|
| 226 | | - kvm_debugfs_dir, vcpu, |
|---|
| 227 | | - &kvmppc_exit_timing_fops); |
|---|
| 228 | | - |
|---|
| 229 | | - if (!debugfs_file) { |
|---|
| 230 | | - printk(KERN_ERR"%s: error creating debugfs file %s\n", |
|---|
| 231 | | - __func__, dbg_fname); |
|---|
| 232 | | - return; |
|---|
| 233 | | - } |
|---|
| 214 | + debugfs_file = debugfs_create_file(dbg_fname, 0666, kvm_debugfs_dir, |
|---|
| 215 | + vcpu, &kvmppc_exit_timing_fops); |
|---|
| 234 | 216 | |
|---|
| 235 | 217 | vcpu->arch.debugfs_exit_timing = debugfs_file; |
|---|
| 236 | 218 | } |
|---|
| 237 | 219 | |
|---|
| 238 | 220 | void kvmppc_remove_vcpu_debugfs(struct kvm_vcpu *vcpu) |
|---|
| 239 | 221 | { |
|---|
| 240 | | - if (vcpu->arch.debugfs_exit_timing) { |
|---|
| 241 | | - debugfs_remove(vcpu->arch.debugfs_exit_timing); |
|---|
| 242 | | - vcpu->arch.debugfs_exit_timing = NULL; |
|---|
| 243 | | - } |
|---|
| 222 | + debugfs_remove(vcpu->arch.debugfs_exit_timing); |
|---|
| 223 | + vcpu->arch.debugfs_exit_timing = NULL; |
|---|
| 244 | 224 | } |
|---|