Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2080949imm; Fri, 7 Sep 2018 10:28:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZofjv7tz7GQ/kpzyoVtoQrQxgSGkeALRKNjeBzV1TDW1wfQycc2xbP9fwJ72MDTk2140Bq X-Received: by 2002:a17:902:82c5:: with SMTP id u5-v6mr8995725plz.83.1536341335384; Fri, 07 Sep 2018 10:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536341335; cv=none; d=google.com; s=arc-20160816; b=nB+z4GABplm62/xW7smdn+I1M/Dkv6uYH/WPp04Lo0KhzRoZxmPayC4WkSbFemYcgi pAft3B65jc9J/noV7eLk6vzpgYj4oBOz9QPWj9Ah/3sxbB+zvEZeT9Ox7mMxguEp1NBI beiPgUP4M72Zp1GSMzQOhtz3ALxxi5B12cvAQlCKXjAfGTWI0FohKemVll8qY+JkyVd5 b5ockkdwjcNw34h+XHsc4S80UGGnDMSsF25xChIb5g3ADA3uJp9yhN7fdUCbx7sXR66a 4x8SBLh+LvMWp8cWOOoMFlWSy6snjT5JZfOxVIBO4TldDPsW/xxyf02IxqlZs7tIhipA WGrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=l7Wmm5zNI5FkbzOn57PV2u80o55Qrfw7dU+DgFDUcEE=; b=qZhoLxbK+igUw9EicoGsFg1cC4Q8P1utzQ8CCD3fcqV6ldlO18PiM1KS3fmqZQlUH1 UJ4xRCWIxq+mJQYPp1jB/hE0k71H4d98Bx0Xh87F33iY0RO59UWDGoVz9fxD/rNWlic4 p5itad7LMauc9AnBcgJW8gf040zimcHYH7Rwpk6X5IeSJm4Ux1VTjXsIHxWhNIOGN2Gd I0GNirXW5scAnkecJy40+PDCOSPIQaWvYAFsJGIXTJaiUxqLuy4L/ORU5RiPRxHiKz5Q htqwMR4PtqqEei+ZX7UaQ4Y8CfAETQga29j+j3Cl3JejHKRQ8YSU/d9eez0z0RILYbp8 P0KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uYJ2Mjv4; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s195-v6si9149401pgs.492.2018.09.07.10.28.40; Fri, 07 Sep 2018 10:28:55 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uYJ2Mjv4; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727349AbeIGWI4 (ORCPT + 99 others); Fri, 7 Sep 2018 18:08:56 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:45557 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726583AbeIGWI4 (ORCPT ); Fri, 7 Sep 2018 18:08:56 -0400 Received: by mail-lj1-f196.google.com with SMTP id u83-v6so12849573lje.12; Fri, 07 Sep 2018 10:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=l7Wmm5zNI5FkbzOn57PV2u80o55Qrfw7dU+DgFDUcEE=; b=uYJ2Mjv46GM9rcKmqkDibxkdFn/Y+gq9A4PCsW+D4tKKQI/0qKKV7D6sGZB2le5WgI 5QFtcvvmfClkS5lHckPq9z2MPGiO0qCRod+pEKsabsfqvyfA9m3SKVlWTBeML5LL+OXw z7NT2ZjY6fXkW1VRLs6hGosDIqIka2GS8uJsMAVox9Lm8hJtQl7mbyU7OGQgJq+2VWS+ q8qsUEf2BRPtwrAWxcZDXFiniHFFuUkKnvBjSGk/mkei4w3MLMhgUb9t9oyq63sUOWTH izn1wwVV9pS6UINdk9HLyNYsPEWq0Cip6y/cgUAl2oiKV/SGvCeuGs5OYNElPAzzm2Gz Hjdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=l7Wmm5zNI5FkbzOn57PV2u80o55Qrfw7dU+DgFDUcEE=; b=gdrFgtMTzbRsGnozzEPLqSPptjkS8zaRxEwe4GDMnV1jioHGUjOiLRE2Vf30VUSIQp aSDNpQEGXZUb+PnhobFbnJ515+aXXR7BTza9cnN05IpVMKW4JjtipQp1SbtlphpHAuQy c8t3RAbLe2f0WwRYzpDS0jJwAAjGXvA7LxOHjnaqwwOR/CMc8gjbRIuH1xYwJh5b5GYM jGlbeX2RVRoi1RPrepbdejhXb5wYnOx5GapsGyCUHQmbcuM1FVmnGO7wYsCsSFk3Te8X FHwSu4vgGyQgztjfrsSuQFx+/jbnL+zQbsvzMuGsLvlZlqKaR16T10vCa00bwjuVIlHH 7oag== X-Gm-Message-State: APzg51BMnnhNbrpYqLDoq5snr2lCU8ZO4X8l/ERkWA0BcbT6GS3OMsyf /vBs+AAqgnrak9fkgIDQd8s= X-Received: by 2002:a2e:4782:: with SMTP id u124-v6mr5937015lja.40.1536341218991; Fri, 07 Sep 2018 10:26:58 -0700 (PDT) Received: from Mort.jumbo.freeair (91-156-179-220.elisa-laajakaista.fi. [91.156.179.220]) by smtp.gmail.com with ESMTPSA id d14-v6sm1380854ljc.56.2018.09.07.10.26.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 10:26:58 -0700 (PDT) From: Igor Stoppa X-Google-Original-From: Igor Stoppa To: huangdaode Cc: igor.stoppa@gmail.com, Igor Stoppa , Yisen Zhuang , Salil Mehta , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ethernet: hnae: add unlikely() to assert() Date: Fri, 7 Sep 2018 20:26:50 +0300 Message-Id: <20180907172650.29408-1-igor.stoppa@huawei.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The assert() condition is likely to be true. Signed-off-by: Igor Stoppa Cc: huangdaode Cc: Yisen Zhuang Cc: Salil Mehta Cc: "David S. Miller" Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/net/ethernet/hisilicon/hns/hnae.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns/hnae.h b/drivers/net/ethernet/hisilicon/hns/hnae.h index 08a750fb60c4..bd3c180a3fe9 100644 --- a/drivers/net/ethernet/hisilicon/hns/hnae.h +++ b/drivers/net/ethernet/hisilicon/hns/hnae.h @@ -47,7 +47,7 @@ #ifndef assert #define assert(expr) \ do { \ - if (!(expr)) { \ + if (unlikely(!(expr))) { \ pr_err("Assertion failed! %s, %s, %s, line %d\n", \ #expr, __FILE__, __func__, __LINE__); \ } \ -- 2.17.1