From patchwork Mon Apr 27 21:31:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 47648 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 35DB620553 for ; Mon, 27 Apr 2015 21:52:19 +0000 (UTC) Received: by wicmx19 with SMTP id mx19sf1275034wic.3 for ; Mon, 27 Apr 2015 14:52:18 -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: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=P+k8tBOeUqWdhKkx6mh4WgI1HVa3rX4FZ7qJCGLfBu8=; b=I508Im72wmG/S105ZHy/f0iYObE68N5A1UJiAa+e4gqnwBNXrPEvats2J8RGRLvHOw XdKgiG1e9O8E5KXy6wKypXDV4b8MYDm2xA1uD4POuq0H0vfj2BiUXSlU9wF8JFGp6QXQ tlBq+TWPHx3Zt8pkEri6sOSoEZpfHf9sNjnLla9lUn/7qWGkHYBU6kkff2/Hx/KQ2Sm4 i89hcWFbPEZMqLDqbcqBS63KVlZgaSSrMUshE11IsJA/mn7wjU9CoNps/D+Evp0WcDQn GXqBcz0hAsGBzh/aDVanuIG/iaVWBffaRrIWptWieGjwNQanBDWjAvkWYWsuF3k2sGM3 uCcA== X-Gm-Message-State: ALoCoQm0+3JlEMw8DHBFa3NhR493MzVqxG7+7RBEiA0bC4kLM25fNxfVLr9HV0wozRFe3o/qmFW9 X-Received: by 10.112.51.68 with SMTP id i4mr8518961lbo.13.1430171538492; Mon, 27 Apr 2015 14:52:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.103 with SMTP id kx7ls367lac.62.gmail; Mon, 27 Apr 2015 14:52:18 -0700 (PDT) X-Received: by 10.152.243.9 with SMTP id wu9mr11620276lac.63.1430171538220; Mon, 27 Apr 2015 14:52:18 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id a1si15652209lbc.45.2015.04.27.14.52.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Apr 2015 14:52:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lagv1 with SMTP id v1so90503928lag.3 for ; Mon, 27 Apr 2015 14:52:18 -0700 (PDT) X-Received: by 10.113.10.134 with SMTP id ea6mr11713194lbd.29.1430171538095; Mon, 27 Apr 2015 14:52:18 -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 l1csp1526207lbt; Mon, 27 Apr 2015 14:52:17 -0700 (PDT) X-Received: by 10.68.252.38 with SMTP id zp6mr26065315pbc.159.1430171524867; Mon, 27 Apr 2015 14:52:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ir4si31560609pbc.118.2015.04.27.14.52.03; Mon, 27 Apr 2015 14:52:04 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-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 S1030302AbbD0Vvq (ORCPT + 27 others); Mon, 27 Apr 2015 17:51:46 -0400 Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:49590 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965286AbbD0Vc5 (ORCPT ); Mon, 27 Apr 2015 17:32:57 -0400 Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.85) (envelope-from ) id 1Ymqe6-0003vh-U6; Mon, 27 Apr 2015 23:32:54 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Alex Elder , Alex Elder , Sage Weil , David Miller , Andrew Morton , Linus Torvalds , Jiri Slaby Subject: [PATCH 3.12 11/83] kernel.h: define u8, s8, u32, etc. limits Date: Mon, 27 Apr 2015 23:31:42 +0200 Message-Id: <70f9463cdf882d4f04bbf7f5e13c893a2efe07e0.1430159990.git.jslaby@suse.cz> X-Mailer: git-send-email 2.3.5 In-Reply-To: <3426bb8de3a655aa6668e92ee92eb35f0db86582.1430159990.git.jslaby@suse.cz> References: <3426bb8de3a655aa6668e92ee92eb35f0db86582.1430159990.git.jslaby@suse.cz> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linux-kernel-owner@vger.kernel.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.215.42 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 3.12-stable review patch. If anyone has any objections, please let me 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))