From patchwork Wed Sep 9 21:08:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 7148971 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3543B9F1D3 for ; Wed, 9 Sep 2015 21:12:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B3EE2096E for ; Wed, 9 Sep 2015 21:12:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 766AF20957 for ; Wed, 9 Sep 2015 21:12:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755236AbbIIVJj (ORCPT ); Wed, 9 Sep 2015 17:09:39 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:36167 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754692AbbIIVIz (ORCPT ); Wed, 9 Sep 2015 17:08:55 -0400 Received: by padhk3 with SMTP id hk3so20676208pad.3 for ; Wed, 09 Sep 2015 14:08:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc :cc:cc:subject:date:message-id:in-reply-to:references; bh=KE0dkNjoIKvBrHZ2Hz/ezyNvwKeDHLHMjuwExh3j6hs=; b=bBO/rHfD95g0EefpDEkhHJzEuCgclKU6gmxQHGDrl2KEbjJN8Ay0p2OkYxS48OXxjS gmBcUxVvkUzGTCwjZd/9gMKPjckJ4QezydrzSdjfy9x3Jkup5nMPWV8qdHx4hHxJhm40 TJM+MjslPxJ3zHWix4rFPxoI1VZRMMC6NTDCbWXO3thrEANDwvVA9+w7E1A0pFQ41ZXe D4RgjWP+PhqZ3fcHDsTHb9wUVb666zsLLZx4l9hyES0gaI+pq/aytzOy3FA4aoqornRr WJzxFHeH3/E7F1rs3xDxZO/v6di9zZ8horgDUIuvmvemIoNNnA9TMMqbiSKdUMnDIwFs IxTA== X-Gm-Message-State: ALoCoQld2v+X39rdbWa3AOHSm44niMNM0j0OkXOPz+LvycsCEyAtAuBAKfE0bnh8+fkpsE/zXo2d X-Received: by 10.66.246.228 with SMTP id xz4mr66479051pac.46.1441832934897; Wed, 09 Sep 2015 14:08:54 -0700 (PDT) Received: from localhost (wap-cal.CS.Berkeley.EDU. [128.32.35.228]) by smtp.gmail.com with ESMTPSA id lq10sm8040784pab.18.2015.09.09.14.08.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Sep 2015 14:08:54 -0700 (PDT) From: Palmer Dabbelt To: arnd@arndb.de Cc: 3chas3@gmail.com Cc: hpa@zytor.com Cc: mingo@redhat.com Cc: plagnioj@jcrosoft.com Cc: jikos@kernel.org Cc: linux-api@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-atm-general@lists.sourceforge.net Cc: linux-fbdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org Cc: tglx@linutronix.de Cc: tomi.valkeinen@ti.com Cc: x86@kernel.org Cc: Palmer Dabbelt Subject: [PATCH 09/13] Hide bp_type_idx behind #ifdef __KERNEL__ Date: Wed, 9 Sep 2015 14:08:18 -0700 Message-Id: <1441832902-28993-10-git-send-email-palmer@dabbelt.com> X-Mailer: git-send-email 2.4.6 In-Reply-To: <1441832902-28993-1-git-send-email-palmer@dabbelt.com> References: <2644177.lVCYzIBfPW@wuerfel> <1441832902-28993-1-git-send-email-palmer@dabbelt.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I'm actually not sure what to do here: if this enum is meant to be used by userspace, then it has to be the same regardless of kernel configuration. One option would be to have the kernel expose all the values to userspace and then map them internally if CONFIG_HAVE_MIXED_BREAKPOINT_REGS isn't set, but that feels like it'd be more invasive. Here I took the simple and fail-fast route to hide all the definitions. Signed-off-by: Palmer Dabbelt Reviewed-by: Andrew Waterman Reviewed-by: Albert Ou --- include/uapi/linux/hw_breakpoint.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/hw_breakpoint.h b/include/uapi/linux/hw_breakpoint.h index b04000a2296a..2498bfbf56c4 100644 --- a/include/uapi/linux/hw_breakpoint.h +++ b/include/uapi/linux/hw_breakpoint.h @@ -17,14 +17,16 @@ enum { HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X, }; +#ifdef __KERNEL__ enum bp_type_idx { TYPE_INST = 0, -#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS +#if defined(CONFIG_HAVE_MIXED_BREAKPOINTS_REGS) TYPE_DATA = 0, #else TYPE_DATA = 1, #endif TYPE_MAX }; +#endif /* __KERNEL__ */ #endif /* _UAPI_LINUX_HW_BREAKPOINT_H */