Message ID | 20220227071253.28193-2-tangmeng@uniontech.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [1/2] ALSA: core: remove initialise static variables to 0 | expand |
diff --git a/sound/sound_core.c b/sound/sound_core.c index 2ee54070b2b5..e7fa820b08be 100644 --- a/sound/sound_core.c +++ b/sound/sound_core.c @@ -586,13 +586,12 @@ static int soundcore_open(struct inode *inode, struct file *file) * We rely upon the fact that we can't be unloaded while the * subdriver is there. */ - int err = 0; replace_fops(file, new_fops); if (file->f_op->open) - err = file->f_op->open(inode,file); + return file->f_op->open(inode, file); - return err; + return 0; } return -ENODEV; }
Return the result from file->f_op->open() directly instead of taking this in another redundant variable. Signed-off-by: Meng Tang <tangmeng@uniontech.com> --- sound/sound_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)