Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp21932pxy; Fri, 30 Jul 2021 22:28:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqV94/ya+4XQhq4m2iIb9K4a96b0NyEKp41tXBWN2wyYm36CLiobYwdQThK1e/JRpOm7YV X-Received: by 2002:a05:6e02:1073:: with SMTP id q19mr3473325ilj.110.1627709313130; Fri, 30 Jul 2021 22:28:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627709313; cv=none; d=google.com; s=arc-20160816; b=HFicELMTIZcPaoB/1k1JJMjW6Vc/3hNtS4Xrlu1gYt8GRnUCb9qEH0vvNcBJgMvVB1 7kT0t+nJd38qJPDpbiT1DEj0z1/JTC7WBgdbSeF00MwGlHXC0+wTYaFNRcXrkUbNNaGy EUtlJ13yWxQN9pIZ3DFh6mMC2EMQro/H0tw0iFMncIDSwFPFUewDRIAf7jl1paXNIpNh 9Ez5qcR5shNxLjxlZjXBIUz8d71Pe+MPirQRlACYE6P3vd503xmyRusitEGiF7FG+doR ogiOFTXvWTBCHimziRbztp976c9VTwO/8ZY7cR9Fh/7sSonbNeBVpHcfixKUeYqBUztW oNUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=HPfVir1DPIt5CzfQv1NO5Oj/JyxGNvdRU40LjNBE8gA=; b=pDCsJcN5jDRa2OhqXvCbtXv6bEh+xTS/WlKkpPj9tBLFi5Tsjp9uF7k43DkIu3gp+l xZ7oqa/qQYvs0G5Q6xaHZlbEYBvPoz84PXAqpkpibWWHXM9jY/uxZXiCwZlQwJIMcU64 E65rzMvrluJymNO5zHqd+8yAcbZbg15x/DIokMpcZ8ULxJa3TxapCNGkRzOWfgvrzwS9 943w8woF14AdC19o8BV1FSljurniFonps6pO/c/q57FL4OkIhw3fjReLDYSpxkeXfV+8 rCGsP+mKpTl1UJuiaXCEOnrArka4SbCIlzGtegJHh6tbB8Jol+zdAVvSpWle/4mrgvg+ sJqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n12si4656980ilq.134.2021.07.30.22.28.21; Fri, 30 Jul 2021 22:28:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231558AbhGaF1M (ORCPT + 99 others); Sat, 31 Jul 2021 01:27:12 -0400 Received: from smtpbg587.qq.com ([113.96.223.105]:39806 "EHLO smtpbg587.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229766AbhGaF1L (ORCPT ); Sat, 31 Jul 2021 01:27:11 -0400 X-QQ-mid: bizesmtp38t1627709210t835i70l Received: from ficus.lan (unknown [171.223.99.141]) by esmtp6.qq.com (ESMTP) with id ; Sat, 31 Jul 2021 13:26:48 +0800 (CST) X-QQ-SSF: 01000000002000B0C000B00A0000000 X-QQ-FEAT: s7pJguWOSDAMFImT23sH0iw24VPXGJfxegD2ZKiEalCHy0MMfVGLOoIP/046a Ao3Du8N4vAZuxCxa7MtgTPx//64DMo9ih+6gQ8zO+RApdwPQ1JzqPXifOeWOkaWHlupCNCl C6KiBqj2UAV95IAHcvZ8APHe3UZwUo7ffjP/8nzq6/PDQ02/IlvluXjCB+RI9INv1VqYM/D QWomz7TzdcnGlerPvhdFlZ1+S4gH3pghYK9mQY27Oqpf+pRChmf5Cs7vMip8YyYOIskZjOD ngMTOi8BMN6dL55D1ZKrsKExXDFXg3qtWr2C7BOPSg0GdYSELK4C3K6JXb40PdhQEDqA== X-QQ-GoodBg: 0 From: Jason Wang To: tiwai@suse.com Cc: perex@perex.cz, leon@kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Jason Wang Subject: [PATCH] ALSA: pcxhr: use __func__ to get funcion's name in an output message Date: Sat, 31 Jul 2021 13:26:47 +0800 Message-Id: <20210731052647.141046-1-wangborong@cdjrlc.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:cdjrlc.com:qybgspam:qybgspam3 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Prefer using '"%s...", __func__' to get current function's name in an output message. Signed-off-by: Jason Wang --- sound/pci/pcxhr/pcxhr.c | 47 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index 96b9371c201a..242bd7e04b3e 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c @@ -366,7 +366,7 @@ static int pcxhr_sub_set_clock(struct pcxhr_mgr *mgr, mgr->codec_speed = speed; /* save new codec speed */ } - dev_dbg(&mgr->pci->dev, "pcxhr_sub_set_clock to %dHz (realfreq=%d)\n", + dev_dbg(&mgr->pci->dev, "%s to %dHz (realfreq=%d)\n", __func__, rate, realfreq); return 0; } @@ -499,7 +499,7 @@ static int pcxhr_set_stream_state(struct snd_pcxhr *chip, else { if (stream->status != PCXHR_STREAM_STATUS_SCHEDULE_STOP) { dev_err(chip->card->dev, - "pcxhr_set_stream_state CANNOT be stopped\n"); + "%s CANNOT be stopped\n", __func__); return -EINVAL; } start = 0; @@ -524,7 +524,7 @@ static int pcxhr_set_stream_state(struct snd_pcxhr *chip, err = pcxhr_send_msg(chip->mgr, &rmh); if (err) dev_err(chip->card->dev, - "ERROR pcxhr_set_stream_state err=%x;\n", err); + "ERROR %s err=%x;\n", __func__, err); stream->status = start ? PCXHR_STREAM_STATUS_STARTED : PCXHR_STREAM_STATUS_STOPPED; return err; @@ -570,7 +570,7 @@ static int pcxhr_set_format(struct pcxhr_stream *stream) break; default: dev_err(chip->card->dev, - "error pcxhr_set_format() : unknown format\n"); + "error %s() : unknown format\n", __func__); return -EINVAL; } @@ -615,7 +615,7 @@ static int pcxhr_set_format(struct pcxhr_stream *stream) err = pcxhr_send_msg(chip->mgr, &rmh); if (err) dev_err(chip->card->dev, - "ERROR pcxhr_set_format err=%x;\n", err); + "ERROR %s err=%x;\n", __func__, err); return err; } @@ -630,7 +630,7 @@ static int pcxhr_update_r_buffer(struct pcxhr_stream *stream) stream_num = is_capture ? 0 : subs->number; dev_dbg(chip->card->dev, - "pcxhr_update_r_buffer(pcm%c%d) : addr(%p) bytes(%zx) subs(%d)\n", + "%s(pcm%c%d) : addr(%p) bytes(%zx) subs(%d)\n", __func__, is_capture ? 'c' : 'p', chip->chip_idx, (void *)(long)subs->runtime->dma_addr, subs->runtime->dma_bytes, subs->number); @@ -721,21 +721,20 @@ static void pcxhr_start_linked_stream(struct pcxhr_mgr *mgr) } if (capture_mask == 0 && playback_mask == 0) { mutex_unlock(&mgr->setup_mutex); - dev_err(&mgr->pci->dev, "pcxhr_start_linked_stream : no pipes\n"); + dev_err(&mgr->pci->dev, "%s : no pipes\n", __func__); return; } - dev_dbg(&mgr->pci->dev, "pcxhr_start_linked_stream : " - "playback_mask=%x capture_mask=%x\n", - playback_mask, capture_mask); + dev_dbg(&mgr->pci->dev, "%s : playback_mask=%x capture_mask=%x\n", + __func__, playback_mask, capture_mask); /* synchronous stop of all the pipes concerned */ err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 0); if (err) { mutex_unlock(&mgr->setup_mutex); - dev_err(&mgr->pci->dev, "pcxhr_start_linked_stream : " + dev_err(&mgr->pci->dev, "%s : " "error stop pipes (P%x C%x)\n", - playback_mask, capture_mask); + __func__, playback_mask, capture_mask); return; } @@ -778,9 +777,9 @@ static void pcxhr_start_linked_stream(struct pcxhr_mgr *mgr) err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 1); if (err) { mutex_unlock(&mgr->setup_mutex); - dev_err(&mgr->pci->dev, "pcxhr_start_linked_stream : " + dev_err(&mgr->pci->dev, "%s : " "error start pipes (P%x C%x)\n", - playback_mask, capture_mask); + __func__, playback_mask, capture_mask); return; } @@ -889,7 +888,7 @@ static int pcxhr_hardware_timer(struct pcxhr_mgr *mgr, int start) } err = pcxhr_send_msg(mgr, &rmh); if (err < 0) - dev_err(&mgr->pci->dev, "error pcxhr_hardware_timer err(%x)\n", + dev_err(&mgr->pci->dev, "error %s err(%x)\n", __func__, err); return err; } @@ -904,7 +903,7 @@ static int pcxhr_prepare(struct snd_pcm_substream *subs) int err = 0; dev_dbg(chip->card->dev, - "pcxhr_prepare : period_size(%lx) periods(%x) buffer_size(%lx)\n", + "%s : period_size(%lx) periods(%x) buffer_size(%lx)\n", __func__, subs->runtime->period_size, subs->runtime->periods, subs->runtime->buffer_size); @@ -997,12 +996,12 @@ static int pcxhr_open(struct snd_pcm_substream *subs) runtime->hw = pcxhr_caps; if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK ) { - dev_dbg(chip->card->dev, "pcxhr_open playback chip%d subs%d\n", - chip->chip_idx, subs->number); + dev_dbg(chip->card->dev, "%s playback chip%d subs%d\n", + __func__, chip->chip_idx, subs->number); stream = &chip->playback_stream[subs->number]; } else { - dev_dbg(chip->card->dev, "pcxhr_open capture chip%d subs%d\n", - chip->chip_idx, subs->number); + dev_dbg(chip->card->dev, "%s capture chip%d subs%d\n", + __func__, chip->chip_idx, subs->number); if (mgr->mono_capture) runtime->hw.channels_max = 1; else @@ -1011,8 +1010,8 @@ static int pcxhr_open(struct snd_pcm_substream *subs) } if (stream->status != PCXHR_STREAM_STATUS_FREE){ /* streams in use */ - dev_err(chip->card->dev, "pcxhr_open chip%d subs%d in use\n", - chip->chip_idx, subs->number); + dev_err(chip->card->dev, "%s chip%d subs%d in use\n", + __func__, chip->chip_idx, subs->number); mutex_unlock(&mgr->setup_mutex); return -EBUSY; } @@ -1077,7 +1076,7 @@ static int pcxhr_close(struct snd_pcm_substream *subs) mutex_lock(&mgr->setup_mutex); - dev_dbg(chip->card->dev, "pcxhr_close chip%d subs%d\n", + dev_dbg(chip->card->dev, "%s chip%d subs%d\n", __func__, chip->chip_idx, subs->number); /* sample rate released */ @@ -1572,7 +1571,7 @@ static int pcxhr_probe(struct pci_dev *pci, /* init setup mutex*/ mutex_init(&mgr->setup_mutex); - mgr->prmh = kmalloc(sizeof(*mgr->prmh) + + mgr->prmh = kmalloc(sizeof(*mgr->prmh) + sizeof(u32) * (PCXHR_SIZE_MAX_LONG_STATUS - PCXHR_SIZE_MAX_STATUS), GFP_KERNEL); -- 2.32.0