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=-2.5 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT 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 79FBDC43381 for ; Thu, 21 Feb 2019 07:12:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48F9020675 for ; Thu, 21 Feb 2019 07:12:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20150623.gappssmtp.com header.i=@resnulli-us.20150623.gappssmtp.com header.b="IV5/+UDT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726737AbfBUHMj (ORCPT ); Thu, 21 Feb 2019 02:12:39 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:52615 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726354AbfBUHMi (ORCPT ); Thu, 21 Feb 2019 02:12:38 -0500 Received: by mail-wm1-f65.google.com with SMTP id m1so9116782wml.2 for ; Wed, 20 Feb 2019 23:12:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oattJuTR0yPGvRH4rM8Y0EuVarDjueqNfQGEyafPqRA=; b=IV5/+UDTpiradWGvl0VZVuH0r2tnJq/qtKFLqDFSifV2tRKwj9betS6W4drTkasJFz W6KxQquwB+4xIHRMXY3AvOb+DWZrRMs1Xi/Z0afaATuKvdDo/5+qUq4oCG1ciWP/nYyd Bzv1/voy09zjVnpgw1JD8YJ7l6DXF/0KfqwR3bkFg+SMYfrvp6Ga/XLNXsAH44OkTdtd lsANEO01pd/9pEU14WBpskOjL/LjDQ1wBRHwhf0VtQcRtXebHv5j30jTZr8Y3F7KspuQ YUGMS8kdOlUFW1Cd+JlONhDtfqIqcnnmQER6V3d5vc3hGU5460eTF+BnrbZbw6b1y/iX 52Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=oattJuTR0yPGvRH4rM8Y0EuVarDjueqNfQGEyafPqRA=; b=hXPAi0jJi5et4ROi3W9zmMIGrJ9GiqNEvtDrADHP3FM8H30dnMuKJSjTsS1RS/cdCK 9G5KmZ0RVLW6Gc2MuwSHNK5US86ZGfmtF7eupNp4tHLwvcjie+N0H7L9o4mmWTqZUdRq O7yVlb3HvaY7EmoiifJjlndfpZV2ddRW18xSnZM7XMfBityrFn7F3ozufZN0XVKv/Cgf y2VZMTJ198hr/iKY196XKMLkDHgouPxzm+BEiSoTj1LJIzVmJhEDu2KmHNVFHPWrDMlb 3Y802j00dBAa/RKjxRTpjbgOgbZMR8DuiKP02jpY+oXpTBlaAxrnJ7ddtGvsnbX2D05X MKEQ== X-Gm-Message-State: AHQUAubrNSB1G2g+x2dmcAzLyM6EYDAHmdWbHFDf9B15PKXkGGbLYN9F 6B01N/GoNTVodOVwXwrISKgrKT3FJYQ= X-Google-Smtp-Source: AHgI3IZZ2JNS5uq/5a9VYgsHUq90ccDklJy3uvTU7bDbmh/lwxx8CtVAePosGfQ6bkCZiQAWOzZthA== X-Received: by 2002:a1c:41c5:: with SMTP id o188mr9118163wma.147.1550733156909; Wed, 20 Feb 2019 23:12:36 -0800 (PST) Received: from localhost (ip-213-220-234-21.net.upcbroadband.cz. [213.220.234.21]) by smtp.gmail.com with ESMTPSA id n14sm3417344wrx.24.2019.02.20.23.12.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Feb 2019 23:12:36 -0800 (PST) Date: Thu, 21 Feb 2019 08:02:56 +0100 From: Jiri Pirko To: Stephen Hemminger Cc: netdev@vger.kernel.org, dsahern@gmail.com, mlxsw@mellanox.com Subject: Re: [patch iproute2] devlink: relax dpipe table show dependency on resources Message-ID: <20190221070256.GB2312@nanopsycho> References: <20190220092109.4496-1-jiri@resnulli.us> <20190220180117.2ad552d0@shemminger-XPS-13-9360> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190220180117.2ad552d0@shemminger-XPS-13-9360> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Thu, Feb 21, 2019 at 03:01:17AM CET, stephen@networkplumber.org wrote: >On Wed, 20 Feb 2019 10:21:09 +0100 >Jiri Pirko wrote: > >> - resource_valid = !!nla_table[DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_ID]; >> + resource_valid = !!nla_table[DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_ID] && >> + ctx->resources; > >When you add a logical AND operator the !! is no longer needed. The !! convention >is used to turn a value of not zero (ie not NULL) into a boolean. When you add the >additional operator the result is already boolean. Okay. Will send v2.