Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp891212ybi; Fri, 14 Jun 2019 05:12:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIyvZhP3XqrmyvMf/3v1lbwh9Z6aYcoh+BTjR0s44dqUy8Ez+r4ZfkIXFnj1DJySCeMXGp X-Received: by 2002:a63:e250:: with SMTP id y16mr34591594pgj.392.1560514328037; Fri, 14 Jun 2019 05:12:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560514328; cv=none; d=google.com; s=arc-20160816; b=OMdEyUBX1QBAsxUbySmWoxBTObxndXtjQXFiTGZlgqO24qBVp1mSlEVjy+1flLa+mN 4ssuhZGNt5oh4Vtj6htoW4NOa33HQ1aNX4Jbv/v5304piQQ1e7701g77oAPPPO/p9GhN jeAA2z3eitbHLpLmMDwu7tevCNYeHib8YEeFSnIz1R2u4lVBahIk+otjElfFaDzlIJtz 0P2SVXIwTqEJVzT7xipdRiGpADDxgN67G49N272cl1gUPxU31JyDWyDK5X8zI8NCjTwP 5T8txRH/1H4UpqsgJp4cqf7+F6sJQ/yaU6LPyNScS+/zKS5Bi1lfo/i4OQrnXVlbPXap 7UoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=IRGhhrcLh2zdm/WpVH5M0RLiKJZm5sck1c0mX1AozMc=; b=AfJyKjYzbiX239LJLWBKJ1E5mAMTbM0CyrmVGBgylb8EBPJGPzZ6XO500I+sOnymDQ 3YeJuY5KFFgeKeSLdV809G7B0NjPXabpMRVr29G5cgld9NadiKlFj1QdrR1AAn9f5KUw G483ZNmOkisxU4diUbzGb8X8kTVAl9FxoSLyKHkJCd72kppve6oNIRemrs057yydJA8n NAXyLZG0KviwpLkoDO7LfOof/z8Sjuoc+nuD81EfVK3w2jqkEW7wrHOL1Wk/CKs9dh/V PN3Ljq835Z0evxwV9aQL2krTgW+PbAu5EhdqnjWMQnKsC1m3/P/O3sOsnAoAXdCUBaKP 97nA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si2184759pfh.175.2019.06.14.05.11.51; Fri, 14 Jun 2019 05:12:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727801AbfFNML2 (ORCPT + 99 others); Fri, 14 Jun 2019 08:11:28 -0400 Received: from smtp05.smtpout.orange.fr ([80.12.242.127]:53912 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727544AbfFNML2 (ORCPT ); Fri, 14 Jun 2019 08:11:28 -0400 Received: from [192.168.1.41] ([92.148.209.44]) by mwinf5d40 with ME id QcBN2000a0y1A8U03cBNc2; Fri, 14 Jun 2019 14:11:26 +0200 X-ME-Helo: [192.168.1.41] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 14 Jun 2019 14:11:26 +0200 X-ME-IP: 92.148.209.44 Subject: Re: [PATCH net-next] hinic: Use devm_kasprintf instead of hard coding it To: aviad.krawczyk@huawei.com, davem@davemloft.net Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <20190613195412.1702-1-christophe.jaillet@wanadoo.fr> From: Christophe JAILLET Message-ID: Date: Fri, 14 Jun 2019 14:11:22 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190613195412.1702-1-christophe.jaillet@wanadoo.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: fr Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I got a: : host huawei.com[103.218.216.136] said: 550 5.1.1 Error: invalid recipients is found from 80.12.242.127 However, MAINTAINERS has: HUAWEI ETHERNET DRIVER M: Aviad Krawczyk L: netdev@vger.kernel.org S: Supported F: Documentation/networking/hinic.txt F: drivers/net/ethernet/huawei/hinic/ I don't know how this should be fixed (neither if it should be...), so if s.o. knows, please do. Best regards, Christophe Jaillet Le 13/06/2019 à 21:54, Christophe JAILLET a écrit : > 'devm_kasprintf' is less verbose than: > snprintf(NULL, 0, ...); > devm_kzalloc(...); > sprintf > so use it instead. > > Signed-off-by: Christophe JAILLET > --- > drivers/net/ethernet/huawei/hinic/hinic_rx.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/ethernet/huawei/hinic/hinic_rx.c b/drivers/net/ethernet/huawei/hinic/hinic_rx.c > index 9b4082557ad5..95b09fd110d3 100644 > --- a/drivers/net/ethernet/huawei/hinic/hinic_rx.c > +++ b/drivers/net/ethernet/huawei/hinic/hinic_rx.c > @@ -493,7 +493,7 @@ int hinic_init_rxq(struct hinic_rxq *rxq, struct hinic_rq *rq, > struct net_device *netdev) > { > struct hinic_qp *qp = container_of(rq, struct hinic_qp, rq); > - int err, pkts, irqname_len; > + int err, pkts; > > rxq->netdev = netdev; > rxq->rq = rq; > @@ -502,13 +502,11 @@ int hinic_init_rxq(struct hinic_rxq *rxq, struct hinic_rq *rq, > > rxq_stats_init(rxq); > > - irqname_len = snprintf(NULL, 0, "hinic_rxq%d", qp->q_id) + 1; > - rxq->irq_name = devm_kzalloc(&netdev->dev, irqname_len, GFP_KERNEL); > + rxq->irq_name = devm_kasprintf(&netdev->dev, GFP_KERNEL, > + "hinic_rxq%d", qp->q_id); > if (!rxq->irq_name) > return -ENOMEM; > > - sprintf(rxq->irq_name, "hinic_rxq%d", qp->q_id); > - > pkts = rx_alloc_pkts(rxq); > if (!pkts) { > err = -ENOMEM;