Skip to contentSkip to conversation

sound: It seems that the code format could be cleaner

PATCH In review Li kunyu 2 participants 2 messages Jun 27, 2022 – Jul 4, 2022 Sound

lore
Share & tools
lore

Li kunyu

author
#0 lore raw

PATCH 1/1 sound: It seems that the code format could be cleaner

It seems that the condition statement and return statement could be tidied up by adding blank lines.

---
 sound/pci/emu10k1/p16v.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
sound/pci/emu10k1/p16v.c +8 -3
index 18a1b0740e6b..d594c874f61a 100644
@@ -510,7 +510,9 @@ snd_p16v_pcm_pointer_playback(struct snd_pcm_substream *substream)
 	ptr3 = snd_emu10k1_ptr20_read(emu, PLAYBACK_LIST_PTR, channel);
 	ptr1 = snd_emu10k1_ptr20_read(emu, PLAYBACK_POINTER, channel);
 	ptr4 = snd_emu10k1_ptr20_read(emu, PLAYBACK_LIST_PTR, channel);
-	if (ptr3 != ptr4) ptr1 = snd_emu10k1_ptr20_read(emu, PLAYBACK_POINTER, channel);
+	if (ptr3 != ptr4)
+		ptr1 = snd_emu10k1_ptr20_read(emu, PLAYBACK_POINTER, channel);
+
 	ptr2 = bytes_to_frames(runtime, ptr1);
 	ptr2+= (ptr4 >> 3) * runtime->period_size;
 	ptr=ptr2;
@@ -703,9 +705,10 @@ static int snd_p16v_capture_source_put(struct snd_kcontrol *kcontrol,
 	u32 mask;
 	u32 source;
 
-	val = ucontrol->value.enumerated.item[0] ;
+	val = ucontrol->value.enumerated.item[0];
 	if (val > 7)
 		return -EINVAL;
+
 	change = (emu->p16v_capture_source != val);
 	if (change) {
 		emu->p16v_capture_source = val;
@@ -741,9 +744,10 @@ static int snd_p16v_capture_channel_put(struct snd_kcontrol *kcontrol,
 	int change = 0;
 	u32 tmp;
 
-	val = ucontrol->value.enumerated.item[0] ;
+	val = ucontrol->value.enumerated.item[0];
 	if (val > 3)
 		return -EINVAL;
+
 	change = (emu->p16v_capture_channel != val);
 	if (change) {
 		emu->p16v_capture_channel = val;
@@ -813,6 +817,7 @@ int snd_p16v_alloc_pm_buffer(struct snd_emu10k1 *emu)
 	emu->p16v_saved = vmalloc(array_size(NUM_CHS * 4, 0x80));
 	if (! emu->p16v_saved)
 		return -ENOMEM;
+
 	return 0;
 }
 
Signature · 1 line
2.18.2
#1 lore raw
Quoted 5 lines · Li kunyu

It seems that the condition statement and return statement could be tidied up by adding blank lines.

Thanks for the patch.

But in general we don't take such white-space only changes alone, unless it's a cleanup work for the other real changes.

i.e. if you really work on the code to fix or enhance something, we are glad to take such a white-space patch as prerequisite.

Takashi