From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AAFD0C282CB for ; Tue, 5 Feb 2019 23:00:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6CDD620844 for ; Tue, 5 Feb 2019 23:00:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uCynKUzE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730606AbfBEW77 (ORCPT ); Tue, 5 Feb 2019 17:59:59 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:34456 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730111AbfBEW76 (ORCPT ); Tue, 5 Feb 2019 17:59:58 -0500 Received: by mail-pl1-f193.google.com with SMTP id w4so2216745plz.1 for ; Tue, 05 Feb 2019 14:59:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=37OgdK+TCXnzZWL7ZQUadLzV5FskMXDCmFcraiyqxNs=; b=uCynKUzERfjZ+r+lmUko1Df2DQP0+KnTMTrgFvWv2dNc6eZFVeBlTXtXfLQM4buyJY Is9elGDlHDLxPKsXCzbjr9X6iCpqJVVi3xqGx3ArkNFHRcEr+/iKHgNDHIsbV7eIRFU0 wp97QNULykeMrWymCIGTjloFsp8VmThyuNOGvpQDPu/lbYyptfUgEjPMk4x9+YeoNKK+ X8oulzpuu3/mpLP6nvTypNlgh6Q0nDR8Eju56KWFhNG90ReAFfErMwBnZKpSzW4v0WlL yI8dY667Yy/o213t5gtzoa60VFK3RCvwaBFnJX9xbynIJp/zwVJXUIqGboCA4egBARTN AikQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=37OgdK+TCXnzZWL7ZQUadLzV5FskMXDCmFcraiyqxNs=; b=PB2XHCEewD/xz6tDyzOTw/TTiNjNlHQekLz/AkVU3VdWf4nqycw2ZKfDEiBb8r2+bK P3Eg/QTdfY2fd/HPU+dvu0CAnlWf7B3KicDbxvghsAKMX+vAfmEL/a2W6z+eyPP1LKzi SaxMkP9K97hXzBc97b7W+ddnbL5Zp/TkjTSBD+OFX1OKPZNwRVD3K6MlSVKtTeJLwtem xu36KZ2V5MPYvjl2gaSLkvARUSTL3w2IDhpa8AKiqq3LRrqCbBH3yoXJgcyJeLMLJyom mvNP3doItD55vetCWDZbco27GWXJcZM/hUGxxS5TNltk5xzGJ1AO3X01nNr2ZcoSsXzp zjkg== X-Gm-Message-State: AHQUAuZEAupbDAfZVGBd9zCINXxRD7RtUJjvlfMEsKvYyv7GQqIP0Yip vNPPY7gi2iolhbvFLQoE9boHY8Pt X-Google-Smtp-Source: AHgI3IajLAdUi5LMMfVGWmpQhubRAQzVtbZFckTqnOfpXedac379rqUSQfIeL0mQJBIbMO+yCXfVRw== X-Received: by 2002:a17:902:a5c3:: with SMTP id t3mr7438159plq.117.1549407597887; Tue, 05 Feb 2019 14:59:57 -0800 (PST) Received: from [10.40.10.124] (fw.cumulusnetworks.com. [216.129.126.126]) by smtp.googlemail.com with ESMTPSA id b7sm5438543pfa.52.2019.02.05.14.59.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Feb 2019 14:59:56 -0800 (PST) Subject: Re: [PATCH iproute2-next] tc: full JSON support for 'bpf' actions To: Stephen Hemminger , Davide Caratti Cc: netdev@vger.kernel.org References: <20190205145359.74508b0e@hermes.lan> From: David Ahern Message-ID: Date: Tue, 5 Feb 2019 14:59:55 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190205145359.74508b0e@hermes.lan> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2/5/19 2:53 PM, Stephen Hemminger wrote: > On Thu, 31 Jan 2019 18:58:09 +0100 > Davide Caratti wrote: > >> + print_uint(PRINT_ANY, "code", "%hu ", ops[i].code); >> + print_uint(PRINT_ANY, "jt", "%hhu ", ops[i].jt); >> + print_uint(PRINT_ANY, "jf", "%hhu ", ops[i].jf); > > Did you know that print_uint promotes the argument to unsigned int > then you are printing it with %hhu which expects only a u8. > I did look at the print_hhu option and it seems really weird that you use "print_hhu(..., "%hhu", ...)" which is why I took the patch as is. There are existing examples of print_uint with '%hu' too. The print_ functions really should be renamed (print_uchar, print_ushort, etc).