Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp821802imm; Fri, 31 Aug 2018 14:25:44 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZN6DBTK7ibfUveNS5iCqBZQqK3XiTPnA8fxO6Pwa+3/fv14g1pjawKXQgts4WIRWaaGujE X-Received: by 2002:a63:c608:: with SMTP id w8-v6mr16217188pgg.16.1535750744536; Fri, 31 Aug 2018 14:25:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535750744; cv=none; d=google.com; s=arc-20160816; b=FcivJ5U5H0mHnAyPJeH6mpO8tA6zA/rg/20A3HPock16sLMO/w0o7OR8+m+EC3qkh/ 0UmZHt9F+ATgBN+jDb6ia0IpA7VVrq+v0UmxGW1+F0yAfYY+rTWKkfZKucQcZbnvoC/I aPs3SxM61bfRZ/PIXQP1RvvLDz+yt64grztT+JKcvYbNm6ofBDBgtxkGeRfAiNJpwio6 HA55/yr0kYyAokD+p34ZACfKwrnbMYHrwgxkJzA6Mmvlm4fB+6sRLTO2G8arA8vFpQDF 7jjSsB5EFx/PlbZsMgHpoO0KYp7IC16+ijN89KAYHL/Saq3T2an59MjaRuAdmPtKAIdU xVAg== 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:arc-authentication-results; bh=XHp5kZcFvaIa+QEHAd7ZE10oFqyt5prSd/2ihgZaGzs=; b=kqJSX8D57XBmDl1ZfXsY16LDgYiZOmFlD3GVW6JB9A6kacdikBEpTRRrceQyD6a4t8 CDRH1ETucJMJ+HWyIblYOqeVBmDPTZ1avWK75egBKoCaIdouNgd9ginsnEMpuYUZ7Akw MSB9+8wOQjJVXoUW9wgNSbP++JzRn3pClEuhucyaIsZeqAkQrlMpEzuijzzJPfWcsC6V O7JICGNEw3q2V2Yd7fXDumiDK173mzHJmUU5zSnX0LTFa59hnm0i+IvCIEZ4XrniE3WX SNetqH2GB7QkpNlkdDcfeyPeivCYaO4HWMCllN7rq7NrF15HzmvNjnBRVOBBamSitcWx qU/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rGdjGimO; 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 z128-v6si11179424pgb.185.2018.08.31.14.25.28; Fri, 31 Aug 2018 14:25:44 -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=rGdjGimO; 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 S1727298AbeIABdk (ORCPT + 99 others); Fri, 31 Aug 2018 21:33:40 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:40592 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726987AbeIABdk (ORCPT ); Fri, 31 Aug 2018 21:33:40 -0400 Received: by mail-lj1-f193.google.com with SMTP id j19-v6so11139262ljc.7; Fri, 31 Aug 2018 14:24:20 -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=XHp5kZcFvaIa+QEHAd7ZE10oFqyt5prSd/2ihgZaGzs=; b=rGdjGimOTf8u3WlWxz3ipWuPLKgD+vDDTgOqPJXFe3n7JokImUpjUSyNjkPvfQsVDE CMHSvLsZ3JBf8SdEB1u4cM1/Ha4kWrgI4hakZ9u+uSN672JTtE8CEJtPquSFXG3YJM0c 3FkLedKaReVm+0dddTmJAzvyVMJPa21hM9WJQYsnwKoAt28n6l56yIrwx6B+hOm9+9Rj mLxUF0D9pj5Mc+azpUkmp6Cg6pu9Z8pOewBVn5i/oRVM24o/6B/S7VoCiDcRlpuLuxN3 zeZQKOGa8FzlBxv5CWXFdi4ssudgVFmsVFWzRNEUwnDmSjHVR1yqawofMcSwJeEih867 Q5ng== 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=XHp5kZcFvaIa+QEHAd7ZE10oFqyt5prSd/2ihgZaGzs=; b=axuuHLPo9ZpNImm7TuzyM6IMGHdxmUc4E6xz5W/YauHQMURktkBz6b6br/6T8zppv8 Rb+eLtJuHtPbtl5PgqNCysdWLYef+O5MPOgyOphH6eik2V3hIg+E7JMrEtoIB5r24kxq 1OoC/fcHQAZJLCx+YkTfpDzLI3ozRiGgK0xcvO65L2MMbxjiVEfpIBpZd5q3kFkw8Bg/ Ci813X+SvgMvSKHH14hp1dpYE/OpxhHa6soro5/J40meQiR0DxoNeTyP5RmQ9zoC6Mgl py1FhRYnK4rRg8VoL7lJ04dagb2V3214gtZcRszJ8xtHLqcnDVarI6ZUlJbhcdpr5yhP nvKQ== X-Gm-Message-State: APzg51Bo6mhpVCYv9xuaOTzXTsfWoCtHoUkaYEQxUApe5iYZ76uhJejG ZLApblomFXHnjDNankJBmRk= X-Received: by 2002:a2e:8807:: with SMTP id x7-v6mr2744614ljh.98.1535750659366; Fri, 31 Aug 2018 14:24:19 -0700 (PDT) Received: from Mort.jumbo.freeair (91-159-62-202.elisa-laajakaista.fi. [91.159.62.202]) by smtp.gmail.com with ESMTPSA id t4-v6sm2037130lfd.13.2018.08.31.14.24.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 14:24:18 -0700 (PDT) From: Igor Stoppa X-Google-Original-From: Igor Stoppa To: Dmitry Safonov Cc: igor.stoppa@gmail.com, Igor Stoppa , Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftest: vm: add unlikely() to BUG_ON() Date: Sat, 1 Sep 2018 00:24:08 +0300 Message-Id: <20180831212408.20071-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 BUG_ON() is unlikely() to BUG() For unlikely(), borrow the definition from tools/include/linux/compiler.h Signed-off-by: Igor Stoppa Cc: Dmitry Safonov Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- tools/testing/selftests/vm/map_populate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/vm/map_populate.c b/tools/testing/selftests/vm/map_populate.c index 6b8aeaa0bf7a..1bf8ff068dcd 100644 --- a/tools/testing/selftests/vm/map_populate.c +++ b/tools/testing/selftests/vm/map_populate.c @@ -21,9 +21,13 @@ #define MMAP_SZ 4096 #endif +#ifndef unlikely +# define unlikely(x) __builtin_expect(!!(x), 0) +#endif + #define BUG_ON(condition, description) \ do { \ - if (condition) { \ + if (unlikely(condition)) { \ fprintf(stderr, "[FAIL]\t%s:%d\t%s:%s\n", __func__, \ __LINE__, (description), strerror(errno)); \ exit(1); \ -- 2.17.1