From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B350AA0C40; Tue, 23 Mar 2021 19:22:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9CFD34069E; Tue, 23 Mar 2021 19:22:36 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id B25D040143 for ; Tue, 23 Mar 2021 19:22:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616523754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DUFCy2IfGTdN/BhY50f4zvLkERtfNbt8eYHAflXQQZo=; b=MSjA5rrg2AoBX0tcmxKkrNNeG59tCHpY6LgEX5gEAduYOi8ta6WyBCDzJILa0uaAuPHL/m +Ntah5nuzVuHnCf3P2QeT/X7YQY0TQpaUzPrFBPfZE3WusPEocerFX+hLVDW7PXI2PNlpv lQE933+AQFFDvflWkz4+3AHrKYOvB4I= Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-124-WaqstIJHMe63QMfKYSQpMQ-1; Tue, 23 Mar 2021 14:22:32 -0400 X-MC-Unique: WaqstIJHMe63QMfKYSQpMQ-1 Received: by mail-vk1-f199.google.com with SMTP id n196so815967vkn.23 for ; Tue, 23 Mar 2021 11:22:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DUFCy2IfGTdN/BhY50f4zvLkERtfNbt8eYHAflXQQZo=; b=kmjmKA+YBSDs126ALMGphAmxhsOwLgDQbvr3KWw+X2gi6hH8nDY+WdmX/p1ETedYQG ZVB4qTJ+2yma0rwttQWQInsv2WcwPBCICdyN160t3/eCN+PvtU58PJ69lVQT49AbTqiF ERNLLjAeqpd5K631Npj/3sZNZXyvNnNn93hCH7Wh6FdWiOadzlEtEG89nzLC/mJdWEzY 7pRIBLmzBlsfqSdm2clqvq0XlN/jW++iLp2x5gHfs5s2KUdyzWqDxUeFhOuimZakNn+b MDy7E9ggjgT2+fDhWuAj8rCnmfZ6VzIO+3hHzxZReyqUeAkT1aZ5Kbk97C+yPQ3rH8+F /pJQ== X-Gm-Message-State: AOAM533YKXG2OrwZhoRauWhkhVGQC2YE9DSQehEuPGLqCp8s5v6kzhLe Qjch1gHeUeQjHuj0gf/s/moHvKkk7OtMigd4q9pU0ThCDMnJKwfVuP2iqLcZne5LIoOXkknKqXN jjYCJ/uLoIiowtNclN3Y= X-Received: by 2002:a9f:3591:: with SMTP id t17mr4624589uad.41.1616523751874; Tue, 23 Mar 2021 11:22:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFD+CtomqEbQQox2cg85/b+fkvSianZ4AhfK5OUOrCpWCEYXS/+KxpzlrkMXTbJBZB14HkYznKSY2h8vuARTE= X-Received: by 2002:a9f:3591:: with SMTP id t17mr4624575uad.41.1616523751705; Tue, 23 Mar 2021 11:22:31 -0700 (PDT) MIME-Version: 1.0 References: <20210310140107.2730088-1-thomas@monjalon.net> <20210310140107.2730088-2-thomas@monjalon.net> In-Reply-To: <20210310140107.2730088-2-thomas@monjalon.net> From: David Marchand Date: Tue, 23 Mar 2021 19:22:20 +0100 Message-ID: To: Thomas Monjalon Cc: dev , Andrew Rybchenko Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 1/3] log: choose EAL log type on registration failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Mar 10, 2021 at 3:01 PM Thomas Monjalon wrote: > > In the unlikely case where something goes wrong > while registering a log type, > the fallback is to use the log type 0, assigned to EAL. > > Signed-off-by: Thomas Monjalon > --- > lib/librte_eal/include/rte_log.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lib/librte_eal/include/rte_log.h b/lib/librte_eal/include/rte_log.h > index e6192892c3..178a265c3f 100644 > --- a/lib/librte_eal/include/rte_log.h > +++ b/lib/librte_eal/include/rte_log.h > @@ -392,6 +392,7 @@ RTE_INIT(__##type) \ > { \ > type = rte_log_register_type_and_pick_level(RTE_STR(name), \ > RTE_LOG_##level); \ > + type = RTE_MAX(0, type); \ > } Hard to read and to grep, can we use explicit logtype? if (type < 0) type = RTE_LOGTYPE_EAL; -- David Marchand