qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Several fixes for the Pulse Audio driver, and t


From: no-reply
Subject: Re: [Qemu-devel] [PATCH] Several fixes for the Pulse Audio driver, and the HDA device.
Date: Tue, 10 Oct 2017 16:16:01 -0700 (PDT)

Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: address@hidden
Subject: [Qemu-devel] [PATCH] Several fixes for the Pulse Audio driver, and the 
HDA device.

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
e49f94ef7b Several fixes for the Pulse Audio driver, and the HDA device.

=== OUTPUT BEGIN ===
Checking PATCH 1/1: Several fixes for the Pulse Audio driver, and the HDA 
device....
ERROR: open brace '{' following function declarations go on the next line
#34: FILE: audio/audio.c:2070:
+int64_t audio_get_timer_ticks(void) {

ERROR: space prohibited between function name and open parenthesis '('
#146: FILE: audio/paaudio.c:106:
+            *(rerror) = pa_context_errno ((c)->context);        \

ERROR: space prohibited between function name and open parenthesis '('
#161: FILE: audio/paaudio.c:118:
+                *(rerror) = pa_context_errno ((c)->context);            \

ERROR: space prohibited between function name and open parenthesis '('
#266: FILE: audio/paaudio.c:126:
+static int qpa_run_out (HWVoiceOut *hw, int live)

ERROR: space prohibited between function name and open parenthesis '('
#286: FILE: audio/paaudio.c:139:
+    pa_threaded_mainloop_lock (pa->g->mainloop);

ERROR: space prohibited between function name and open parenthesis '('
#287: FILE: audio/paaudio.c:140:
+    CHECK_DEAD_GOTO (pa->g, pa->stream, &error, fail);

ERROR: space prohibited between function name and open parenthesis '('
#300: FILE: audio/paaudio.c:146:
+    samples = (int)(audio_MIN (avail_bytes, max_bytes)) >> hw->info.shift;

ERROR: do not use C99 // comments
#306: FILE: audio/paaudio.c:148:
+//    if (avail_bytes < max_bytes) {

ERROR: unnecessary whitespace before a quoted newline
#307: FILE: audio/paaudio.c:149:
+//        dolog("avail: %d, wanted: %d \n", (int)avail_bytes, (int)max_bytes);

ERROR: do not use C99 // comments
#307: FILE: audio/paaudio.c:149:
+//        dolog("avail: %d, wanted: %d \n", (int)avail_bytes, (int)max_bytes);

ERROR: do not use C99 // comments
#308: FILE: audio/paaudio.c:150:
+//    }

ERROR: line over 90 characters
#312: FILE: audio/paaudio.c:152:
+//    dolog("TRANSFER avail: %d bytes, max %d bytes -> %d samples from %d\n", 
(int)avail_bytes, (int)max_bytes, samples, rpos);

ERROR: do not use C99 // comments
#312: FILE: audio/paaudio.c:152:
+//    dolog("TRANSFER avail: %d bytes, max %d bytes -> %d samples from %d\n", 
(int)avail_bytes, (int)max_bytes, samples, rpos);

ERROR: space prohibited between function name and open parenthesis '('
#324: FILE: audio/paaudio.c:157:
+        int convert_samples = audio_MIN (samples, left_till_end_samples);

WARNING: line over 80 characters
#325: FILE: audio/paaudio.c:158:
+        size_t convert_bytes_wanted = (size_t) convert_samples << 
hw->info.shift;

WARNING: line over 80 characters
#331: FILE: audio/paaudio.c:163:
+        CHECK_SUCCESS_GOTO(pa->g, &error, convert_bytes == 
convert_bytes_wanted, fail);

ERROR: space prohibited between function name and open parenthesis '('
#339: FILE: audio/paaudio.c:166:
+        hw->clip (pa_dst, src, convert_samples);

ERROR: line over 90 characters
#348: FILE: audio/paaudio.c:168:
+        r = pa_stream_write (pa->stream, pa_dst, convert_bytes, NULL, 0LL, 
PA_SEEK_RELATIVE);

ERROR: space prohibited between function name and open parenthesis '('
#348: FILE: audio/paaudio.c:168:
+        r = pa_stream_write (pa->stream, pa_dst, convert_bytes, NULL, 0LL, 
PA_SEEK_RELATIVE);

ERROR: space prohibited between function name and open parenthesis '('
#369: FILE: audio/paaudio.c:177:
+    pa_threaded_mainloop_unlock (pa->g->mainloop);

ERROR: space prohibited between function name and open parenthesis '('
#389: FILE: audio/paaudio.c:183:
+    qpa_logerr (error, "qpa_run_out failed\n");

ERROR: space prohibited between function name and open parenthesis '('
#400: FILE: audio/paaudio.c:192:
+static int qpa_run_in (HWVoiceIn *hw)

ERROR: space prohibited between function name and open parenthesis '('
#415: FILE: audio/paaudio.c:203:
+    pa_threaded_mainloop_lock (pa->g->mainloop);

ERROR: space prohibited between function name and open parenthesis '('
#416: FILE: audio/paaudio.c:204:
+    CHECK_DEAD_GOTO (pa->g, pa->stream, &error, fail);

ERROR: line over 90 characters
#418: FILE: audio/paaudio.c:206:
+    size_t bytes_wanted = ((unsigned int)(hw->samples - 
audio_pcm_hw_get_live_in(hw)) << hw->info.shift);

ERROR: do not use C99 // comments
#420: FILE: audio/paaudio.c:208:
+        // no room

ERROR: do not use C99 // comments
#432: FILE: audio/paaudio.c:214:
+    //dolog("WANT %d, HAVE %d\n", (int)bytes_wanted, (int) bytes_avail);

ERROR: if this code is redundant consider removing it
#442: FILE: audio/paaudio.c:219:
+#if 0

ERROR: space required before the open parenthesis '('
#461: FILE: audio/paaudio.c:232:
+        if(n_dropped) {

WARNING: line over 80 characters
#489: FILE: audio/paaudio.c:250:
+            int chunk = audio_MIN ((int)(pa_avail >> hw->info.shift), 
hw->samples - wpos);

ERROR: space prohibited between function name and open parenthesis '('
#489: FILE: audio/paaudio.c:250:
+            int chunk = audio_MIN ((int)(pa_avail >> hw->info.shift), 
hw->samples - wpos);

ERROR: space prohibited between function name and open parenthesis '('
#490: FILE: audio/paaudio.c:251:
+            hw->conv (hw->conv_buf + wpos, pa_src, chunk);

ERROR: space prohibited between function name and open parenthesis '('
#514: FILE: audio/paaudio.c:263:
+    pa_threaded_mainloop_unlock (pa->g->mainloop);

ERROR: space prohibited between function name and open parenthesis '('
#527: FILE: audio/paaudio.c:269:
+    qpa_logerr (error, "qpa_run_in failed\n");

ERROR: line over 90 characters
#581: FILE: audio/paaudio.c:390:
+                                        | (g->conf.adjust_latency_out ? 
PA_STREAM_ADJUST_LATENCY : 0)

ERROR: line over 90 characters
#589: FILE: audio/paaudio.c:397:
+                                      | (g->conf.adjust_latency_in ? 
PA_STREAM_ADJUST_LATENCY : 0)

WARNING: line over 80 characters
#611: FILE: audio/paaudio.c:431:
+    int64_t timer_tick_duration = audio_MAX(audio_get_timer_ticks(), 1 * 
SCALE_MS);

ERROR: line over 90 characters
#612: FILE: audio/paaudio.c:432:
+    int64_t frames_per_tick_x1000 = ((timer_tick_duration * as->freq * 1000LL) 
/ NANOSECONDS_PER_SECOND);

WARNING: line over 80 characters
#637: FILE: audio/paaudio.c:457:
+    dolog("OUT adjust latency: %s\n", g->conf.adjust_latency_out ? "yes" : 
"no");

ERROR: space prohibited between function name and open parenthesis '('
#647: FILE: audio/paaudio.c:459:
+    pa->ss.format = audfmt_to_pa (as->fmt, as->endianness);

ERROR: space prohibited between function name and open parenthesis '('
#652: FILE: audio/paaudio.c:463:
+    pa->ba.tlength = tlength * pa_frame_size (&pa->ss);

ERROR: space prohibited between function name and open parenthesis '('
#657: FILE: audio/paaudio.c:468:
+    obt_as.fmt = pa_to_audfmt (pa->ss.format, &obt_as.endianness);

WARNING: line over 80 characters
#718: FILE: audio/paaudio.c:503:
+    int64_t timer_tick_duration = audio_MAX(audio_get_timer_ticks(), 1 * 
SCALE_MS);

ERROR: line over 90 characters
#719: FILE: audio/paaudio.c:504:
+    int64_t frames_per_tick_x1000 = ((timer_tick_duration * as->freq * 1000LL) 
/ NANOSECONDS_PER_SECOND);

ERROR: space prohibited between function name and open parenthesis '('
#743: FILE: audio/paaudio.c:527:
+    pa->ss.format = audfmt_to_pa (as->fmt, as->endianness);

ERROR: space prohibited between function name and open parenthesis '('
#747: FILE: audio/paaudio.c:531:
+    pa->ba.fragsize = fragsize * pa_frame_size (&pa->ss);

ERROR: space prohibited between function name and open parenthesis '('
#752: FILE: audio/paaudio.c:536:
+    obt_as.fmt = pa_to_audfmt (pa->ss.format, &obt_as.endianness);

ERROR: space prohibited between function name and open parenthesis '('
#775: FILE: audio/paaudio.c:549:
+        qpa_logerr (error, "pa_simple_new for playback failed\n");

ERROR: switch and case should be at the same indent
#854: FILE: audio/paaudio.c:646:
     switch (cmd) {
+        case VOICE_VOLUME:

WARNING: line over 80 characters
#866: FILE: audio/paaudio.c:663:
+                                                      pa_stream_get_index 
(pa->stream),

ERROR: space prohibited between function name and open parenthesis '('
#866: FILE: audio/paaudio.c:663:
+                                                      pa_stream_get_index 
(pa->stream),

WARNING: line over 80 characters
#877: FILE: audio/paaudio.c:673:
+                                                    pa_stream_get_index 
(pa->stream),

ERROR: space prohibited between function name and open parenthesis '('
#877: FILE: audio/paaudio.c:673:
+                                                    pa_stream_get_index 
(pa->stream),

ERROR: open brace '{' following function declarations go on the next line
#969: FILE: hw/audio/hda-codec.c:183:
+static void hda_audio_input_timer(void *opaque) {

WARNING: line over 80 characters
#982: FILE: hw/audio/hda-codec.c:196:
+    int64_t wanted_rpos = (st->as.freq * 4 * (now - buft_start)) / 
NANOSECONDS_PER_SECOND;

ERROR: do not use C99 // comments
#983: FILE: hw/audio/hda-codec.c:197:
+    wanted_rpos &= -4; // IMPORTANT! clip to frames

ERROR: do not use C99 // comments
#986: FILE: hw/audio/hda-codec.c:200:
+        // we already transmitted the data

ERROR: do not use C99 // comments
#994: FILE: hw/audio/hda-codec.c:208:
+    //dolog("%"PRId64"\n", wpos - rpos);

ERROR: line over 90 characters
#996: FILE: hw/audio/hda-codec.c:210:
+    //dolog("rpos: %"PRId64", wpos: %"PRId64", wanted: %"PRId64"\n", rpos, 
wpos, wanted_wpos);

ERROR: do not use C99 // comments
#996: FILE: hw/audio/hda-codec.c:210:
+    //dolog("rpos: %"PRId64", wpos: %"PRId64", wanted: %"PRId64"\n", rpos, 
wpos, wanted_wpos);

ERROR: line over 90 characters
#1001: FILE: hw/audio/hda-codec.c:215:
+        int rc = hda_codec_xfer(&st->state->hda, st->stream, false, st->buf + 
start, chunk);

ERROR: do not use C99 // comments
#1046: FILE: hw/audio/hda-codec.c:247:
+//    int64_t overflow = wpos - rpos - to_transfer - (B_SIZE >> 3);

ERROR: do not use C99 // comments
#1047: FILE: hw/audio/hda-codec.c:248:
+//    if (overflow > 0) {

ERROR: do not use C99 // comments
#1048: FILE: hw/audio/hda-codec.c:249:
+//        int64_t corr = NANOSECONDS_PER_SECOND * overflow / (4 * st->as.freq);

ERROR: do not use C99 // comments
#1049: FILE: hw/audio/hda-codec.c:250:
+//        //dolog("CORR %"PRId64"\n", corr);

ERROR: do not use C99 // comments
#1050: FILE: hw/audio/hda-codec.c:251:
+//        atomic_fetch_add(&st->buft_start, corr);

ERROR: do not use C99 // comments
#1051: FILE: hw/audio/hda-codec.c:252:
+//    }

ERROR: open brace '{' following function declarations go on the next line
#1074: FILE: hw/audio/hda-codec.c:273:
+static void hda_audio_output_timer(void *opaque) {

WARNING: line over 80 characters
#1087: FILE: hw/audio/hda-codec.c:286:
+    int64_t wanted_wpos = (st->as.freq * 4 * (now - buft_start)) / 
NANOSECONDS_PER_SECOND;

ERROR: do not use C99 // comments
#1088: FILE: hw/audio/hda-codec.c:287:
+    wanted_wpos &= -4; // IMPORTANT! clip to frames

ERROR: do not use C99 // comments
#1091: FILE: hw/audio/hda-codec.c:290:
+        // we already received the data

ERROR: do not use C99 // comments
#1099: FILE: hw/audio/hda-codec.c:298:
+    //dolog("%"PRId64"\n", wpos - rpos);

ERROR: line over 90 characters
#1101: FILE: hw/audio/hda-codec.c:300:
+    //dolog("rpos: %"PRId64", wpos: %"PRId64", wanted: %"PRId64"\n", rpos, 
wpos, wanted_wpos);

ERROR: do not use C99 // comments
#1101: FILE: hw/audio/hda-codec.c:300:
+    //dolog("rpos: %"PRId64", wpos: %"PRId64", wanted: %"PRId64"\n", rpos, 
wpos, wanted_wpos);

ERROR: line over 90 characters
#1106: FILE: hw/audio/hda-codec.c:305:
+        int rc = hda_codec_xfer(&st->state->hda, st->stream, true, st->buf + 
start, chunk);

ERROR: do not use C99 // comments
#1159: FILE: hw/audio/hda-codec.c:339:
+        //dolog("CORR %"PRId64"\n", corr);

ERROR: space prohibited between function name and open parenthesis '('
#1192: FILE: hw/audio/hda-codec.c:376:
+        timer_del (st->buft);

ERROR: space prohibited between function name and open parenthesis '('
#1223: FILE: hw/audio/hda-codec.c:676:
+            timer_del (st->buft);

ERROR: do not use C99 // comments
#1265: FILE: hw/audio/intel-hda.c:410:
+//    if (st->ctl & (1 << 26)) {

ERROR: do not use C99 // comments
#1266: FILE: hw/audio/intel-hda.c:411:
+//        /*

ERROR: do not use C99 // comments
#1267: FILE: hw/audio/intel-hda.c:412:
+//         * Wait with the next DMA xfer until the guest

ERROR: do not use C99 // comments
#1268: FILE: hw/audio/intel-hda.c:413:
+//         * has acked the buffer completion interrupt

ERROR: do not use C99 // comments
#1269: FILE: hw/audio/intel-hda.c:414:
+//         */

ERROR: do not use C99 // comments
#1270: FILE: hw/audio/intel-hda.c:415:
+//        return false;

ERROR: do not use C99 // comments
#1271: FILE: hw/audio/intel-hda.c:416:
+//    }

total: 75 errors, 10 warnings, 1200 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]