From patchwork Thu Apr 23 07:20:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 47448 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D0FF220553 for ; Thu, 23 Apr 2015 07:30:22 +0000 (UTC) Received: by layy10 with SMTP id y10sf2079093lay.0 for ; Thu, 23 Apr 2015 00:30:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=ZcJbw727qVjTdpfv1MOAJBb5i9Q36dgTYLzQB5EycpM=; b=GQ6u6s+ceFKSX3vMuMY0Xj1FEEWGePmw3Eas7Gq5zkxOpF2ph9+hodaTanIEUdToJw BIi+dw14zrDkEemdJRh9jSSYvpmfM6/ZraIIQgLZjdK/+/3UuX2EmADkeJm8KrG9PZoD SJ0B1Zqyv2Fj48T/5BdWXKSpJTkhyPUWtS1bo8mH+1g8oHOVAHfXD6enN+WDscy4yt/k AwgNGv5HyD4XzVLm5ckvLq9CWowSmrzwxb6THSyOrMUVgCi0dMfuQBVH6gIohSt/rxjw 6fbcAognV2ZqRwhhEHCQEGvuKpVxmD10Rv4a31g/q4BxBZyliSFgQVNbOTCYsFps01p5 HTEQ== X-Gm-Message-State: ALoCoQkPdZaixR6RqVcWobKIL8owaxWTELlON/3OtQjg7E464kIKjKOgWbzn2NYbzxu375EqLVD6 X-Received: by 10.112.13.200 with SMTP id j8mr745862lbc.14.1429774221794; Thu, 23 Apr 2015 00:30:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.18.225 with SMTP id z1ls300533lad.109.gmail; Thu, 23 Apr 2015 00:30:21 -0700 (PDT) X-Received: by 10.112.225.43 with SMTP id rh11mr1293814lbc.90.1429774221686; Thu, 23 Apr 2015 00:30:21 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id r10si5046958lal.5.2015.04.23.00.30.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Apr 2015 00:30:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbbuc2 with SMTP id uc2so6856728lbb.2 for ; Thu, 23 Apr 2015 00:30:21 -0700 (PDT) X-Received: by 10.112.222.133 with SMTP id qm5mr1294434lbc.86.1429774221565; Thu, 23 Apr 2015 00:30:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp401616lbt; Thu, 23 Apr 2015 00:30:21 -0700 (PDT) X-Received: by 10.70.128.200 with SMTP id nq8mr2686113pdb.167.1429773724617; Thu, 23 Apr 2015 00:22:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nl4si11190826pbc.114.2015.04.23.00.22.03; Thu, 23 Apr 2015 00:22:04 -0700 (PDT) Received-SPF: none (google.com: stable-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756098AbbDWHVw (ORCPT + 2 others); Thu, 23 Apr 2015 03:21:52 -0400 Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:39010 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756127AbbDWHVc (ORCPT ); Thu, 23 Apr 2015 03:21:32 -0400 Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.85) (envelope-from ) id 1YlBRy-00071P-4u; Thu, 23 Apr 2015 09:21:30 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: Alex Elder , Alex Elder , Sage Weil , David Miller , Andrew Morton , Linus Torvalds , Jiri Slaby Subject: [patch added to the 3.12 stable tree] kernel.h: define u8, s8, u32, etc. limits Date: Thu, 23 Apr 2015 09:20:49 +0200 Message-Id: <1429773689-26866-11-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1429773689-26866-1-git-send-email-jslaby@suse.cz> References: <1429773689-26866-1-git-send-email-jslaby@suse.cz> Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Alex Elder This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== commit 89a0714106aac7309c7dfa0f004b39e1e89d2942 upstream. Create constants that define the maximum and minimum values representable by the kernel types u8, s8, u16, s16, and so on. Signed-off-by: Alex Elder Cc: Sage Weil Cc: David Miller Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Jiri Slaby --- include/linux/kernel.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 672ddc4de4af..93bfc3a7e0a3 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -29,6 +29,19 @@ #define ULLONG_MAX (~0ULL) #define SIZE_MAX (~(size_t)0) +#define U8_MAX ((u8)~0U) +#define S8_MAX ((s8)(U8_MAX>>1)) +#define S8_MIN ((s8)(-S8_MAX - 1)) +#define U16_MAX ((u16)~0U) +#define S16_MAX ((s16)(U16_MAX>>1)) +#define S16_MIN ((s16)(-S16_MAX - 1)) +#define U32_MAX ((u32)~0U) +#define S32_MAX ((s32)(U32_MAX>>1)) +#define S32_MIN ((s32)(-S32_MAX - 1)) +#define U64_MAX ((u64)~0ULL) +#define S64_MAX ((s64)(U64_MAX>>1)) +#define S64_MIN ((s64)(-S64_MAX - 1)) + #define STACK_MAGIC 0xdeadbeef #define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))