Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1349367 > unrolled thread

[PATCH] sound/usb: Use meaninful names for goto labels

Started byShuah Khan <shuahkh@osg.samsung.com>
First post2016-03-03 18:00 +0100
Last post2016-03-04 07:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] sound/usb: Use meaninful names for goto labels Shuah Khan <shuahkh@osg.samsung.com> - 2016-03-03 18:00 +0100
    Re: [PATCH] sound/usb: Use meaninful names for goto labels Dan Carpenter <dan.carpenter@oracle.com> - 2016-03-04 07:50 +0100

#1349367 — [PATCH] sound/usb: Use meaninful names for goto labels

FromShuah Khan <shuahkh@osg.samsung.com>
Date2016-03-03 18:00 +0100
Subject[PATCH] sound/usb: Use meaninful names for goto labels
Message-ID<r8ELw-1ze-33@gated-at.bofh.it>
Fix to use meaningful names instead of numbered goto labels

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 sound/usb/media.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/sound/usb/media.c b/sound/usb/media.c
index b87d5b3..ab6a642 100644
--- a/sound/usb/media.c
+++ b/sound/usb/media.c
@@ -84,21 +84,21 @@ int media_snd_stream_init(struct snd_usb_substream *subs, struct snd_pcm *pcm,
 	ret =  media_device_register_entity(mctl->media_dev,
 					    &mctl->media_entity);
 	if (ret)
-		goto err1;
+		goto free_mctl;
 
 	mctl->intf_devnode = media_devnode_create(mdev, intf_type, 0,
 						  MAJOR(pcm_dev->devt),
 						  MINOR(pcm_dev->devt));
 	if (!mctl->intf_devnode) {
 		ret = -ENOMEM;
-		goto err2;
+		goto unregister_entity;
 	}
 	mctl->intf_link = media_create_intf_link(&mctl->media_entity,
 						 &mctl->intf_devnode->intf,
 						 MEDIA_LNK_FL_ENABLED);
 	if (!mctl->intf_link) {
 		ret = -ENOMEM;
-		goto err3;
+		goto devnode_remove;
 	}
 
 	/* create link between mixer and audio */
@@ -109,7 +109,7 @@ int media_snd_stream_init(struct snd_usb_substream *subs, struct snd_pcm *pcm,
 						    &mctl->media_entity, 0,
 						    MEDIA_LNK_FL_ENABLED);
 			if (ret)
-				goto err4;
+				goto remove_intf_link;
 			break;
 		}
 	}
@@ -117,13 +117,13 @@ int media_snd_stream_init(struct snd_usb_substream *subs, struct snd_pcm *pcm,
 	subs->media_ctl = mctl;
 	return 0;
 
-err4:
+remove_intf_link:
 	media_remove_intf_link(mctl->intf_link);
-err3:
+devnode_remove:
 	media_devnode_remove(mctl->intf_devnode);
-err2:
+unregister_entity:
 	media_device_unregister_entity(&mctl->media_entity);
-err1:
+free_mctl:
 	kfree(mctl);
 	return ret;
 }
-- 
2.5.0

[toc] | [next] | [standalone]


#1349891

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-03-04 07:50 +0100
Message-ID<r8RIK-2AC-9@gated-at.bofh.it>
In reply to#1349367
Thanks!

regards,
dan carpenter

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web