* [PATCH v2 0/7]Fix some style problems in audio
@ 2021-01-15 1:24 Zhang Han
2021-01-15 1:24 ` [PATCH v2 1/7] audio: Add braces for statements/fix braces' position Zhang Han
` (7 more replies)
0 siblings, 8 replies; 11+ messages in thread
From: Zhang Han @ 2021-01-15 1:24 UTC (permalink / raw)
To: kraxel
Cc: hunongda, zhang.zhanghailiang, qemu-trivial, qemu-devel,
alex.chen, zhanghan64
Some style problems in audio directory are found by checkpatch.pl. Fix these
style problems.
v2:
- fix style problem: redundant spaces between function name and open parenthesis'('
- fix subject of patch[5/7] for email display
Zhang Han (7):
audio: Add braces for statements/fix braces' position
audio: Add spaces around operator/delete redundant spaces
audio: foo* bar" should be "foo *bar".
audio: Fix lines over 90 characters
audio: Don't use '%#' in format strings
audio: Suspect code indent for conditional statements
audio: space prohibited between function name and parenthesis'('
audio/alsaaudio.c | 15 +++++--------
audio/audio.c | 26 ++++++++++------------
audio/audio_template.h | 24 +++++++++-----------
audio/coreaudio.c | 17 +++++++-------
audio/dsoundaudio.c | 50 +++++++++++++++++++++++++++---------------
audio/jackaudio.c | 2 +-
audio/ossaudio.c | 12 ++++------
audio/paaudio.c | 2 +-
8 files changed, 73 insertions(+), 75 deletions(-)
--
2.29.1.59.gf9b6481aed
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 1/7] audio: Add braces for statements/fix braces' position
2021-01-15 1:24 [PATCH v2 0/7]Fix some style problems in audio Zhang Han
@ 2021-01-15 1:24 ` Zhang Han
2021-01-15 1:24 ` [PATCH v2 2/7] audio: Add spaces around operator/delete redundant spaces Zhang Han
` (6 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Zhang Han @ 2021-01-15 1:24 UTC (permalink / raw)
To: kraxel
Cc: hunongda, zhang.zhanghailiang, qemu-trivial, qemu-devel,
alex.chen, zhanghan64
Fix problems about braces:
-braces are necessary for all arms of if/for/while statements
-else should follow close brace '}'
Signed-off-by: Zhang Han <zhanghan64@huawei.com>
---
audio/alsaaudio.c | 15 +++++----------
audio/audio.c | 26 ++++++++++++--------------
audio/audio_template.h | 12 ++++--------
audio/coreaudio.c | 3 +--
audio/dsoundaudio.c | 9 +++------
audio/ossaudio.c | 12 ++++--------
6 files changed, 29 insertions(+), 48 deletions(-)
diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
index a8e62542f9..480b64b4c6 100644
--- a/audio/alsaaudio.c
+++ b/audio/alsaaudio.c
@@ -278,32 +278,28 @@ static snd_pcm_format_t aud_to_alsafmt (AudioFormat fmt, int endianness)
case AUDIO_FORMAT_S16:
if (endianness) {
return SND_PCM_FORMAT_S16_BE;
- }
- else {
+ } else {
return SND_PCM_FORMAT_S16_LE;
}
case AUDIO_FORMAT_U16:
if (endianness) {
return SND_PCM_FORMAT_U16_BE;
- }
- else {
+ } else {
return SND_PCM_FORMAT_U16_LE;
}
case AUDIO_FORMAT_S32:
if (endianness) {
return SND_PCM_FORMAT_S32_BE;
- }
- else {
+ } else {
return SND_PCM_FORMAT_S32_LE;
}
case AUDIO_FORMAT_U32:
if (endianness) {
return SND_PCM_FORMAT_U32_BE;
- }
- else {
+ } else {
return SND_PCM_FORMAT_U32_LE;
}
@@ -722,8 +718,7 @@ static int alsa_voice_ctl (snd_pcm_t *handle, const char *typ, int ctl)
alsa_logerr (err, "Could not stop %s\n", typ);
return -1;
}
- }
- else {
+ } else {
err = snd_pcm_prepare (handle);
if (err < 0) {
alsa_logerr (err, "Could not prepare handle for %s\n", typ);
diff --git a/audio/audio.c b/audio/audio.c
index b48471bb3f..55834ac8c8 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -344,8 +344,7 @@ void audio_pcm_info_clear_buf (struct audio_pcm_info *info, void *buf, int len)
if (info->is_signed || info->is_float) {
memset(buf, 0x00, len * info->bytes_per_frame);
- }
- else {
+ } else {
switch (info->bits) {
case 8:
memset(buf, 0x80, len * info->bytes_per_frame);
@@ -584,8 +583,7 @@ static size_t audio_pcm_sw_get_rpos_in(SWVoiceIn *sw)
rpos = hw->conv_buf->pos - live;
if (rpos >= 0) {
return rpos;
- }
- else {
+ } else {
return hw->conv_buf->size + rpos;
}
}
@@ -788,10 +786,14 @@ static int audio_is_timer_needed(AudioState *s)
HWVoiceOut *hwo = NULL;
while ((hwo = audio_pcm_hw_find_any_enabled_out(s, hwo))) {
- if (!hwo->poll_mode) return 1;
+ if (!hwo->poll_mode) {
+ return 1;
+ }
}
while ((hwi = audio_pcm_hw_find_any_enabled_in(s, hwi))) {
- if (!hwi->poll_mode) return 1;
+ if (!hwi->poll_mode) {
+ return 1;
+ }
}
return 0;
}
@@ -908,8 +910,7 @@ void AUD_set_active_out (SWVoiceOut *sw, int on)
audio_reset_timer (s);
}
}
- }
- else {
+ } else {
if (hw->enabled) {
int nb_active = 0;
@@ -956,8 +957,7 @@ void AUD_set_active_in (SWVoiceIn *sw, int on)
}
}
sw->total_hw_samples_acquired = hw->total_samples_captured;
- }
- else {
+ } else {
if (hw->enabled) {
int nb_active = 0;
@@ -1540,8 +1540,7 @@ static int audio_driver_init(AudioState *s, struct audio_driver *drv,
audio_init_nb_voices_in(s, drv);
s->drv = drv;
return 0;
- }
- else {
+ } else {
if (msg) {
dolog("Could not init `%s' audio driver\n", drv->name);
}
@@ -1856,8 +1855,7 @@ CaptureVoiceOut *AUD_add_capture(
if (cap) {
QLIST_INSERT_HEAD (&cap->cb_head, cb, entries);
return cap;
- }
- else {
+ } else {
HWVoiceOut *hw;
CaptureVoiceOut *cap;
diff --git a/audio/audio_template.h b/audio/audio_template.h
index 8dd48ce14e..236db7136b 100644
--- a/audio/audio_template.h
+++ b/audio/audio_template.h
@@ -47,8 +47,7 @@ static void glue(audio_init_nb_voices_, TYPE)(AudioState *s,
#ifdef DAC
dolog ("Driver `%s' does not support " NAME "\n", drv->name);
#endif
- }
- else {
+ } else {
dolog ("Driver `%s' does not support %d " NAME " voices, max %d\n",
drv->name,
glue (s->nb_hw_voices_, TYPE),
@@ -387,8 +386,7 @@ static SW *glue(audio_pcm_create_voice_pair_, TYPE)(
if (pdo->fixed_settings) {
hw_as = audiodev_to_audsettings(pdo);
- }
- else {
+ } else {
hw_as = *as;
}
@@ -498,8 +496,7 @@ SW *glue (AUD_open_, TYPE) (
if (glue (audio_pcm_sw_init_, TYPE) (sw, hw, name, as)) {
goto fail;
}
- }
- else {
+ } else {
sw = glue(audio_pcm_create_voice_pair_, TYPE)(s, name, as);
if (!sw) {
dolog ("Failed to create voice `%s'\n", name);
@@ -553,8 +550,7 @@ uint64_t glue (AUD_get_elapsed_usec_, TYPE) (SW *sw, QEMUAudioTimeStamp *ts)
if (cur_ts >= old_ts) {
delta = cur_ts - old_ts;
- }
- else {
+ } else {
delta = UINT64_MAX - old_ts + cur_ts;
}
diff --git a/audio/coreaudio.c b/audio/coreaudio.c
index 79a9d40bf8..408b587126 100644
--- a/audio/coreaudio.c
+++ b/audio/coreaudio.c
@@ -524,8 +524,7 @@ static int coreaudio_init_out(HWVoiceOut *hw, struct audsettings *as,
} else if (frameRange.mMaximum < frames) {
core->audioDevicePropertyBufferFrameSize = (UInt32) frameRange.mMaximum;
dolog ("warning: Downsizing Buffer Frames to %f\n", frameRange.mMaximum);
- }
- else {
+ } else {
core->audioDevicePropertyBufferFrameSize = frames;
}
diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c
index 4cdf19ab67..ba201898e1 100644
--- a/audio/dsoundaudio.c
+++ b/audio/dsoundaudio.c
@@ -404,8 +404,7 @@ static void dsound_enable_out(HWVoiceOut *hw, bool enable)
dsound_logerr (hr, "Could not stop playing buffer\n");
return;
}
- }
- else {
+ } else {
dolog ("warning: Voice is not playing\n");
}
}
@@ -509,8 +508,7 @@ static void dsound_enable_in(HWVoiceIn *hw, bool enable)
dsound_logerr (hr, "Could not stop capturing\n");
return;
}
- }
- else {
+ } else {
dolog ("warning: Voice is not capturing\n");
}
}
@@ -659,8 +657,7 @@ static void *dsound_audio_init(Audiodev *dev)
);
if (FAILED (hr)) {
dsound_logerr (hr, "Could not create DirectSoundCapture instance\n");
- }
- else {
+ } else {
hr = IDirectSoundCapture_Initialize (s->dsound_capture, NULL);
if (FAILED (hr)) {
dsound_logerr (hr, "Could not initialize DirectSoundCapture\n");
diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index a7dcaa31ad..e9f81e9b9c 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -142,16 +142,14 @@ static int aud_to_ossfmt (AudioFormat fmt, int endianness)
case AUDIO_FORMAT_S16:
if (endianness) {
return AFMT_S16_BE;
- }
- else {
+ } else {
return AFMT_S16_LE;
}
case AUDIO_FORMAT_U16:
if (endianness) {
return AFMT_U16_BE;
- }
- else {
+ } else {
return AFMT_U16_LE;
}
@@ -542,16 +540,14 @@ static int oss_init_out(HWVoiceOut *hw, struct audsettings *as,
int trig = 0;
if (ioctl (fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) {
oss_logerr (errno, "SNDCTL_DSP_SETTRIGGER 0 failed\n");
- }
- else {
+ } else {
trig = PCM_ENABLE_OUTPUT;
if (ioctl (fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) {
oss_logerr (
errno,
"SNDCTL_DSP_SETTRIGGER PCM_ENABLE_OUTPUT failed\n"
);
- }
- else {
+ } else {
oss->mmapped = 1;
}
}
--
2.29.1.59.gf9b6481aed
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 2/7] audio: Add spaces around operator/delete redundant spaces
2021-01-15 1:24 [PATCH v2 0/7]Fix some style problems in audio Zhang Han
2021-01-15 1:24 ` [PATCH v2 1/7] audio: Add braces for statements/fix braces' position Zhang Han
@ 2021-01-15 1:24 ` Zhang Han
2021-01-15 9:21 ` Philippe Mathieu-Daudé
2021-01-15 1:24 ` [PATCH v2 3/7] audio: foo* bar" should be "foo *bar" Zhang Han
` (5 subsequent siblings)
7 siblings, 1 reply; 11+ messages in thread
From: Zhang Han @ 2021-01-15 1:24 UTC (permalink / raw)
To: kraxel
Cc: hunongda, zhang.zhanghailiang, qemu-trivial, qemu-devel,
alex.chen, zhanghan64
Fix problems about spaces:
-operator needs spaces around it, add them.
-somespaces are redundant, remove them.
Signed-off-by: Zhang Han <zhanghan64@huawei.com>
---
audio/audio_template.h | 2 +-
audio/coreaudio.c | 2 +-
audio/dsoundaudio.c | 2 +-
audio/jackaudio.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/audio/audio_template.h b/audio/audio_template.h
index 236db7136b..6d42fa7011 100644
--- a/audio/audio_template.h
+++ b/audio/audio_template.h
@@ -208,7 +208,7 @@ static void glue (audio_pcm_hw_gc_, TYPE) (HW **hwp)
QLIST_REMOVE (hw, entries);
glue (hw->pcm_ops->fini_, TYPE) (hw);
glue (s->nb_hw_voices_, TYPE) += 1;
- glue (audio_pcm_hw_free_resources_ ,TYPE) (hw);
+ glue (audio_pcm_hw_free_resources_ , TYPE) (hw);
g_free (hw);
*hwp = NULL;
}
diff --git a/audio/coreaudio.c b/audio/coreaudio.c
index 408b587126..6ca0d79c1f 100644
--- a/audio/coreaudio.c
+++ b/audio/coreaudio.c
@@ -270,7 +270,7 @@ static void coreaudio_logstatus (OSStatus status)
{
const char *str = "BUG";
- switch(status) {
+ switch (status) {
case kAudioHardwareNoError:
str = "kAudioHardwareNoError";
break;
diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c
index ba201898e1..38ae2471f6 100644
--- a/audio/dsoundaudio.c
+++ b/audio/dsoundaudio.c
@@ -133,7 +133,7 @@ static void dsound_log_hresult (HRESULT hr)
break;
#endif
#ifdef DSERR_GENERIC
- case DSERR_GENERIC :
+ case DSERR_GENERIC:
str = "An undetermined error occurred inside the DirectSound subsystem";
break;
#endif
diff --git a/audio/jackaudio.c b/audio/jackaudio.c
index 3b7c18443d..821d4060c0 100644
--- a/audio/jackaudio.c
+++ b/audio/jackaudio.c
@@ -277,7 +277,7 @@ static int qjack_process(jack_nframes_t nframes, void *arg)
if (likely(c->enabled)) {
qjack_buffer_read_l(&c->fifo, buffers, nframes);
} else {
- for(int i = 0; i < c->nchannels; ++i) {
+ for (int i = 0; i < c->nchannels; ++i) {
memset(buffers[i], 0, nframes * sizeof(float));
}
}
--
2.29.1.59.gf9b6481aed
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 3/7] audio: foo* bar" should be "foo *bar".
2021-01-15 1:24 [PATCH v2 0/7]Fix some style problems in audio Zhang Han
2021-01-15 1:24 ` [PATCH v2 1/7] audio: Add braces for statements/fix braces' position Zhang Han
2021-01-15 1:24 ` [PATCH v2 2/7] audio: Add spaces around operator/delete redundant spaces Zhang Han
@ 2021-01-15 1:24 ` Zhang Han
2021-01-15 1:24 ` [PATCH v2 4/7] audio: Fix lines over 90 characters Zhang Han
` (4 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Zhang Han @ 2021-01-15 1:24 UTC (permalink / raw)
To: kraxel
Cc: hunongda, zhang.zhanghailiang, qemu-trivial, qemu-devel,
alex.chen, zhanghan64
transfer "foo* " to "foo *"
Signed-off-by: Zhang Han <zhanghan64@huawei.com>
---
audio/coreaudio.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/audio/coreaudio.c b/audio/coreaudio.c
index 6ca0d79c1f..b7c02e0e51 100644
--- a/audio/coreaudio.c
+++ b/audio/coreaudio.c
@@ -421,12 +421,12 @@ COREAUDIO_WRAPPER_FUNC(write, size_t, (HWVoiceOut *hw, void *buf, size_t size),
/* callback to feed audiooutput buffer */
static OSStatus audioDeviceIOProc(
AudioDeviceID inDevice,
- const AudioTimeStamp* inNow,
- const AudioBufferList* inInputData,
- const AudioTimeStamp* inInputTime,
- AudioBufferList* outOutputData,
- const AudioTimeStamp* inOutputTime,
- void* hwptr)
+ const AudioTimeStamp *inNow,
+ const AudioBufferList *inInputData,
+ const AudioTimeStamp *inInputTime,
+ AudioBufferList *outOutputData,
+ const AudioTimeStamp *inOutputTime,
+ void *hwptr)
{
UInt32 frameCount, pending_frames;
void *out = outOutputData->mBuffers[0].mData;
--
2.29.1.59.gf9b6481aed
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 4/7] audio: Fix lines over 90 characters
2021-01-15 1:24 [PATCH v2 0/7]Fix some style problems in audio Zhang Han
` (2 preceding siblings ...)
2021-01-15 1:24 ` [PATCH v2 3/7] audio: foo* bar" should be "foo *bar" Zhang Han
@ 2021-01-15 1:24 ` Zhang Han
2021-01-15 1:24 ` [PATCH v2 5/7] audio: Don't use '%#' in format strings Zhang Han
` (3 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Zhang Han @ 2021-01-15 1:24 UTC (permalink / raw)
To: kraxel
Cc: hunongda, zhang.zhanghailiang, qemu-trivial, qemu-devel,
alex.chen, zhanghan64
Fix the line width of code.
Signed-off-by: Zhang Han <zhanghan64@huawei.com>
---
audio/dsoundaudio.c | 37 +++++++++++++++++++++++++++----------
1 file changed, 27 insertions(+), 10 deletions(-)
diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c
index 38ae2471f6..1891a38bee 100644
--- a/audio/dsoundaudio.c
+++ b/audio/dsoundaudio.c
@@ -89,7 +89,9 @@ static void dsound_log_hresult (HRESULT hr)
#endif
#ifdef DSERR_ALLOCATED
case DSERR_ALLOCATED:
- str = "The request failed because resources, such as a priority level, were already in use by another caller";
+ str = "The request failed because resources, "
+ "such as a priority level, were already in use "
+ "by another caller";
break;
#endif
#ifdef DSERR_ALREADYINITIALIZED
@@ -104,7 +106,8 @@ static void dsound_log_hresult (HRESULT hr)
#endif
#ifdef DSERR_BADSENDBUFFERGUID
case DSERR_BADSENDBUFFERGUID:
- str = "The GUID specified in an audiopath file does not match a valid mix-in buffer";
+ str = "The GUID specified in an audiopath file "
+ "does not match a valid mix-in buffer";
break;
#endif
#ifdef DSERR_BUFFERLOST
@@ -114,22 +117,31 @@ static void dsound_log_hresult (HRESULT hr)
#endif
#ifdef DSERR_BUFFERTOOSMALL
case DSERR_BUFFERTOOSMALL:
- str = "The buffer size is not great enough to enable effects processing";
+ str = "The buffer size is not great enough to "
+ "enable effects processing";
break;
#endif
#ifdef DSERR_CONTROLUNAVAIL
case DSERR_CONTROLUNAVAIL:
- str = "The buffer control (volume, pan, and so on) requested by the caller is not available. Controls must be specified when the buffer is created, using the dwFlags member of DSBUFFERDESC";
+ str = "The buffer control (volume, pan, and so on) "
+ "requested by the caller is not available. "
+ "Controls must be specified when the buffer is created, "
+ "using the dwFlags member of DSBUFFERDESC";
break;
#endif
#ifdef DSERR_DS8_REQUIRED
case DSERR_DS8_REQUIRED:
- str = "A DirectSound object of class CLSID_DirectSound8 or later is required for the requested functionality. For more information, see IDirectSound8 Interface";
+ str = "A DirectSound object of class CLSID_DirectSound8 or later "
+ "is required for the requested functionality. "
+ "For more information, see IDirectSound8 Interface";
break;
#endif
#ifdef DSERR_FXUNAVAILABLE
case DSERR_FXUNAVAILABLE:
- str = "The effects requested could not be found on the system, or they are in the wrong order or in the wrong location; for example, an effect expected in hardware was found in software";
+ str = "The effects requested could not be found on the system, "
+ "or they are in the wrong order or in the wrong location; "
+ "for example, an effect expected in hardware "
+ "was found in software";
break;
#endif
#ifdef DSERR_GENERIC
@@ -154,7 +166,8 @@ static void dsound_log_hresult (HRESULT hr)
#endif
#ifdef DSERR_NODRIVER
case DSERR_NODRIVER:
- str = "No sound driver is available for use, or the given GUID is not a valid DirectSound device ID";
+ str = "No sound driver is available for use, "
+ "or the given GUID is not a valid DirectSound device ID";
break;
#endif
#ifdef DSERR_NOINTERFACE
@@ -169,12 +182,14 @@ static void dsound_log_hresult (HRESULT hr)
#endif
#ifdef DSERR_OTHERAPPHASPRIO
case DSERR_OTHERAPPHASPRIO:
- str = "Another application has a higher priority level, preventing this call from succeeding";
+ str = "Another application has a higher priority level, "
+ "preventing this call from succeeding";
break;
#endif
#ifdef DSERR_OUTOFMEMORY
case DSERR_OUTOFMEMORY:
- str = "The DirectSound subsystem could not allocate sufficient memory to complete the caller's request";
+ str = "The DirectSound subsystem could not allocate "
+ "sufficient memory to complete the caller's request";
break;
#endif
#ifdef DSERR_PRIOLEVELNEEDED
@@ -189,7 +204,9 @@ static void dsound_log_hresult (HRESULT hr)
#endif
#ifdef DSERR_UNINITIALIZED
case DSERR_UNINITIALIZED:
- str = "The Initialize method has not been called or has not been called successfully before other methods were called";
+ str = "The Initialize method has not been called "
+ "or has not been called successfully "
+ "before other methods were called";
break;
#endif
#ifdef DSERR_UNSUPPORTED
--
2.29.1.59.gf9b6481aed
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 5/7] audio: Don't use '%#' in format strings
2021-01-15 1:24 [PATCH v2 0/7]Fix some style problems in audio Zhang Han
` (3 preceding siblings ...)
2021-01-15 1:24 ` [PATCH v2 4/7] audio: Fix lines over 90 characters Zhang Han
@ 2021-01-15 1:24 ` Zhang Han
2021-01-15 9:20 ` Philippe Mathieu-Daudé
2021-01-15 1:24 ` [PATCH v2 6/7] audio: Suspect code indent for conditional statements Zhang Han
` (2 subsequent siblings)
7 siblings, 1 reply; 11+ messages in thread
From: Zhang Han @ 2021-01-15 1:24 UTC (permalink / raw)
To: kraxel
Cc: hunongda, zhang.zhanghailiang, qemu-trivial, qemu-devel,
alex.chen, zhanghan64
Use '0x' prefix instead of '%#'
Signed-off-by: Zhang Han <zhanghan64@huawei.com>
---
audio/dsoundaudio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c
index 1891a38bee..f7a3351306 100644
--- a/audio/dsoundaudio.c
+++ b/audio/dsoundaudio.c
@@ -215,7 +215,7 @@ static void dsound_log_hresult (HRESULT hr)
break;
#endif
default:
- AUD_log (AUDIO_CAP, "Reason: Unknown (HRESULT %#lx)\n", hr);
+ AUD_log (AUDIO_CAP, "Reason: Unknown (HRESULT 0x%lx)\n", hr);
return;
}
--
2.29.1.59.gf9b6481aed
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 6/7] audio: Suspect code indent for conditional statements
2021-01-15 1:24 [PATCH v2 0/7]Fix some style problems in audio Zhang Han
` (4 preceding siblings ...)
2021-01-15 1:24 ` [PATCH v2 5/7] audio: Don't use '%#' in format strings Zhang Han
@ 2021-01-15 1:24 ` Zhang Han
2021-01-15 1:24 ` [PATCH v2 7/7] audio: space prohibited between function name and parenthesis'(' Zhang Han
2021-01-15 1:54 ` [PATCH v2 0/7]Fix some style problems in audio no-reply
7 siblings, 0 replies; 11+ messages in thread
From: Zhang Han @ 2021-01-15 1:24 UTC (permalink / raw)
To: kraxel
Cc: hunongda, zhang.zhanghailiang, qemu-trivial, qemu-devel,
alex.chen, zhanghan64
Fix code indent.
Signed-off-by: Zhang Han <zhanghan64@huawei.com>
---
audio/paaudio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/audio/paaudio.c b/audio/paaudio.c
index b052084698..7ea9f637c2 100644
--- a/audio/paaudio.c
+++ b/audio/paaudio.c
@@ -437,7 +437,7 @@ static pa_stream *qpa_simple_new (
}
if (r < 0) {
- goto fail;
+ goto fail;
}
pa_threaded_mainloop_unlock(c->mainloop);
--
2.29.1.59.gf9b6481aed
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 7/7] audio: space prohibited between function name and parenthesis'('
2021-01-15 1:24 [PATCH v2 0/7]Fix some style problems in audio Zhang Han
` (5 preceding siblings ...)
2021-01-15 1:24 ` [PATCH v2 6/7] audio: Suspect code indent for conditional statements Zhang Han
@ 2021-01-15 1:24 ` Zhang Han
2021-01-15 1:54 ` [PATCH v2 0/7]Fix some style problems in audio no-reply
7 siblings, 0 replies; 11+ messages in thread
From: Zhang Han @ 2021-01-15 1:24 UTC (permalink / raw)
To: kraxel
Cc: hunongda, zhang.zhanghailiang, qemu-trivial, qemu-devel,
alex.chen, zhanghan64
Delete spaces between function name and open parenthesis'('
Signed-off-by: Zhang Han <zhanghan64@huawei.com>
---
audio/audio_template.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/audio/audio_template.h b/audio/audio_template.h
index 6d42fa7011..05e793f61f 100644
--- a/audio/audio_template.h
+++ b/audio/audio_template.h
@@ -203,13 +203,13 @@ static void glue (audio_pcm_hw_gc_, TYPE) (HW **hwp)
if (!hw->sw_head.lh_first) {
#ifdef DAC
- audio_detach_capture (hw);
+ audio_detach_capture(hw);
#endif
- QLIST_REMOVE (hw, entries);
- glue (hw->pcm_ops->fini_, TYPE) (hw);
- glue (s->nb_hw_voices_, TYPE) += 1;
- glue (audio_pcm_hw_free_resources_ , TYPE) (hw);
- g_free (hw);
+ QLIST_REMOVE(hw, entries);
+ glue(hw->pcm_ops->fini_, TYPE) (hw);
+ glue(s->nb_hw_voices_, TYPE) += 1;
+ glue(audio_pcm_hw_free_resources_ , TYPE) (hw);
+ g_free(hw);
*hwp = NULL;
}
}
--
2.29.1.59.gf9b6481aed
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/7]Fix some style problems in audio
2021-01-15 1:24 [PATCH v2 0/7]Fix some style problems in audio Zhang Han
` (6 preceding siblings ...)
2021-01-15 1:24 ` [PATCH v2 7/7] audio: space prohibited between function name and parenthesis'(' Zhang Han
@ 2021-01-15 1:54 ` no-reply
7 siblings, 0 replies; 11+ messages in thread
From: no-reply @ 2021-01-15 1:54 UTC (permalink / raw)
To: zhanghan64
Cc: hunongda, zhang.zhanghailiang, qemu-trivial, qemu-devel,
alex.chen, kraxel, zhanghan64
Patchew URL: https://patchew.org/QEMU/20210115012431.79533-1-zhanghan64@huawei.com/
Hi,
This series seems to have some coding style problems. See output below for
more information:
Type: series
Message-id: 20210115012431.79533-1-zhanghan64@huawei.com
Subject: [PATCH v2 0/7]Fix some style problems in audio
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
* [new tag] patchew/20210115012431.79533-1-zhanghan64@huawei.com -> patchew/20210115012431.79533-1-zhanghan64@huawei.com
Switched to a new branch 'test'
aa9fd41 audio: space prohibited between function name and parenthesis'('
f36ebe9 audio: Suspect code indent for conditional statements
a5048b4 audio: Don't use '%#' in format strings
136df5d audio: Fix lines over 90 characters
5cfea16 audio: foo* bar" should be "foo *bar".
0f4324f audio: Add spaces around operator/delete redundant spaces
4a9b916 audio: Add braces for statements/fix braces' position
=== OUTPUT BEGIN ===
1/7 Checking commit 4a9b9160f3c9 (audio: Add braces for statements/fix braces' position)
2/7 Checking commit 0f4324ff6333 (audio: Add spaces around operator/delete redundant spaces)
ERROR: space prohibited between function name and open parenthesis '('
#23: FILE: audio/audio_template.h:211:
+ glue (audio_pcm_hw_free_resources_ , TYPE) (hw);
total: 1 errors, 0 warnings, 32 lines checked
Patch 2/7 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
3/7 Checking commit 5cfea163dd87 (audio: foo* bar" should be "foo *bar".)
4/7 Checking commit 136df5d76762 (audio: Fix lines over 90 characters)
5/7 Checking commit a5048b437dad (audio: Don't use '%#' in format strings)
6/7 Checking commit f36ebe97559f (audio: Suspect code indent for conditional statements)
7/7 Checking commit aa9fd41947b4 (audio: space prohibited between function name and parenthesis'(')
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/20210115012431.79533-1-zhanghan64@huawei.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 5/7] audio: Don't use '%#' in format strings
2021-01-15 1:24 ` [PATCH v2 5/7] audio: Don't use '%#' in format strings Zhang Han
@ 2021-01-15 9:20 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 11+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-15 9:20 UTC (permalink / raw)
To: Zhang Han, kraxel
Cc: qemu-trivial, hunongda, alex.chen, zhang.zhanghailiang, qemu-devel
On 1/15/21 2:24 AM, Zhang Han wrote:
> Use '0x' prefix instead of '%#'
>
> Signed-off-by: Zhang Han <zhanghan64@huawei.com>
> ---
> audio/dsoundaudio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/7] audio: Add spaces around operator/delete redundant spaces
2021-01-15 1:24 ` [PATCH v2 2/7] audio: Add spaces around operator/delete redundant spaces Zhang Han
@ 2021-01-15 9:21 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 11+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-15 9:21 UTC (permalink / raw)
To: Zhang Han, kraxel
Cc: qemu-trivial, hunongda, alex.chen, zhang.zhanghailiang, qemu-devel
On 1/15/21 2:24 AM, Zhang Han wrote:
> Fix problems about spaces:
> -operator needs spaces around it, add them.
> -somespaces are redundant, remove them.
>
> Signed-off-by: Zhang Han <zhanghan64@huawei.com>
> ---
> audio/audio_template.h | 2 +-
> audio/coreaudio.c | 2 +-
> audio/dsoundaudio.c | 2 +-
> audio/jackaudio.c | 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2021-01-15 9:24 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15 1:24 [PATCH v2 0/7]Fix some style problems in audio Zhang Han
2021-01-15 1:24 ` [PATCH v2 1/7] audio: Add braces for statements/fix braces' position Zhang Han
2021-01-15 1:24 ` [PATCH v2 2/7] audio: Add spaces around operator/delete redundant spaces Zhang Han
2021-01-15 9:21 ` Philippe Mathieu-Daudé
2021-01-15 1:24 ` [PATCH v2 3/7] audio: foo* bar" should be "foo *bar" Zhang Han
2021-01-15 1:24 ` [PATCH v2 4/7] audio: Fix lines over 90 characters Zhang Han
2021-01-15 1:24 ` [PATCH v2 5/7] audio: Don't use '%#' in format strings Zhang Han
2021-01-15 9:20 ` Philippe Mathieu-Daudé
2021-01-15 1:24 ` [PATCH v2 6/7] audio: Suspect code indent for conditional statements Zhang Han
2021-01-15 1:24 ` [PATCH v2 7/7] audio: space prohibited between function name and parenthesis'(' Zhang Han
2021-01-15 1:54 ` [PATCH v2 0/7]Fix some style problems in audio no-reply
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.