All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Hajda <a.hajda@samsung.com>
To: linux-kernel@vger.kernel.org
Cc: Andrzej Hajda <a.hajda@samsung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Alexander Kuleshov <kuleshovmail@gmail.com>,
	Tony Luck <tony.luck@intel.com>,
	Wei Yang <weiyang@linux.vnet.ibm.com>,
	linux-mm@kvack.org
Subject: [PATCH 33/38] mm/memblock.c: remove invalid check
Date: Mon, 21 Sep 2015 15:34:05 +0200	[thread overview]
Message-ID: <1442842450-29769-34-git-send-email-a.hajda@samsung.com> (raw)
In-Reply-To: <1442842450-29769-1-git-send-email-a.hajda@samsung.com>

Unsigned value cannot be lesser than zero.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2038576

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
 mm/memblock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index d300f13..aeb5148 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -837,7 +837,7 @@ void __init_memblock __next_reserved_mem_region(u64 *idx,
 {
 	struct memblock_type *type = &memblock.reserved;
 
-	if (*idx >= 0 && *idx < type->cnt) {
+	if (*idx < type->cnt) {
 		struct memblock_region *r = &type->regions[*idx];
 		phys_addr_t base = r->base;
 		phys_addr_t size = r->size;
-- 
1.9.1


WARNING: multiple messages have this Message-ID (diff)
From: Andrzej Hajda <a.hajda@samsung.com>
To: linux-kernel@vger.kernel.org
Cc: Andrzej Hajda <a.hajda@samsung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Alexander Kuleshov <kuleshovmail@gmail.com>,
	Tony Luck <tony.luck@intel.com>,
	Wei Yang <weiyang@linux.vnet.ibm.com>,
	linux-mm@kvack.org
Subject: [PATCH 33/38] mm/memblock.c: remove invalid check
Date: Mon, 21 Sep 2015 15:34:05 +0200	[thread overview]
Message-ID: <1442842450-29769-34-git-send-email-a.hajda@samsung.com> (raw)
In-Reply-To: <1442842450-29769-1-git-send-email-a.hajda@samsung.com>

Unsigned value cannot be lesser than zero.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2038576

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
 mm/memblock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index d300f13..aeb5148 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -837,7 +837,7 @@ void __init_memblock __next_reserved_mem_region(u64 *idx,
 {
 	struct memblock_type *type = &memblock.reserved;
 
-	if (*idx >= 0 && *idx < type->cnt) {
+	if (*idx < type->cnt) {
 		struct memblock_region *r = &type->regions[*idx];
 		phys_addr_t base = r->base;
 		phys_addr_t size = r->size;
-- 
1.9.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2015-09-21 13:41 UTC|newest]

Thread overview: 130+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-21 13:33 [PATCH 00/38] Fixes related to incorrect usage of unsigned types Andrzej Hajda
2015-09-21 13:33 ` [lustre-devel] " Andrzej Hajda
2015-09-21 13:33 ` Andrzej Hajda
2015-09-21 13:33 ` Andrzej Hajda
2015-09-21 13:33 ` [rtc-linux] " Andrzej Hajda
2015-09-21 13:33 ` Andrzej Hajda
2015-09-21 13:33 ` [PATCH 01/38] arm-cci: fix handling cpumask_any_but return value Andrzej Hajda
2015-09-21 15:29   ` Will Deacon
2015-12-14 10:20   ` Andrzej Hajda
2015-12-14 11:42     ` Suzuki K. Poulose
2015-09-21 13:33 ` [PATCH 02/38] bus: arm-ccn: " Andrzej Hajda
2015-09-21 19:56   ` Pawel Moll
2015-09-21 13:33 ` [PATCH 03/38] drm/i915: fix handling gen8_emit_flush_coherentl3_wa result Andrzej Hajda
2015-09-21 13:33   ` Andrzej Hajda
2015-09-21 13:59   ` Jani Nikula
2015-09-21 13:59     ` Jani Nikula
2015-09-22  9:42     ` Daniel Vetter
2015-09-22  9:42       ` Daniel Vetter
2015-09-21 13:33 ` [PATCH 04/38] IB/ehca: fix handling idr_alloc result Andrzej Hajda
2015-09-21 13:33   ` Andrzej Hajda
     [not found]   ` <1442842450-29769-5-git-send-email-a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-09-29 18:23     ` Doug Ledford
2015-09-29 18:23       ` Doug Ledford
2015-09-21 13:33 ` [PATCH 05/38] staging: lustre: fix handling lustre_posix_acl_xattr_filter result Andrzej Hajda
2015-09-21 13:33   ` [lustre-devel] " Andrzej Hajda
2015-09-21 13:33 ` [PATCH 06/38] tty: serial: lpc32xx_hs: fix handling platform_get_irq result Andrzej Hajda
2015-09-21 13:33 ` [PATCH 07/38] usb: host: ehci-msm: " Andrzej Hajda
2015-09-21 14:45   ` Alan Stern
2015-09-21 13:33 ` [PATCH 08/38] openvswitch: fix handling result of ipv6_skip_exthdr Andrzej Hajda
2015-09-21 13:33   ` Andrzej Hajda
2015-09-21 17:45   ` Pravin Shelar
2015-09-21 13:33 ` [PATCH 09/38] selftests/timers: fix write return value handlng Andrzej Hajda
2015-12-11  6:42   ` John Stultz
2015-12-11  6:42     ` John Stultz
2015-09-21 13:33 ` [PATCH 10/38] hwrng: fix handling platform_get_irq Andrzej Hajda
2015-09-21 15:05   ` Herbert Xu
2015-09-21 13:33 ` [PATCH 11/38] HSI: omap_ssi: fix handling ida_simple_get result Andrzej Hajda
2015-12-14 10:27   ` Andrzej Hajda
2016-01-07 15:20     ` Sebastian Reichel
2015-09-21 13:33 ` [PATCH 12/38] HSI: omap_ssi_port: fix handling of_get_named_gpio result Andrzej Hajda
2015-12-14 10:27   ` Andrzej Hajda
2015-09-21 13:33 ` [PATCH 13/38] ARM: shmobile: apmu: correct type of CPU id Andrzej Hajda
2015-09-21 13:33   ` Andrzej Hajda
2015-09-21 13:33   ` Andrzej Hajda
2015-10-02  1:57   ` Simon Horman
2015-10-02  1:57     ` Simon Horman
2015-10-02  1:57     ` Simon Horman
2015-09-21 13:33 ` [PATCH 14/38] clk: vt8500: fix sign of possible PLL values Andrzej Hajda
2015-10-01 22:56   ` Stephen Boyd
2015-10-02  4:49     ` [PATCH v2 " Andrzej Hajda
2015-12-14 10:30       ` Andrzej Hajda
2016-01-05 14:24       ` Andrzej Hajda
2016-01-30  0:44       ` Stephen Boyd
2015-09-21 13:33 ` [PATCH 15/38] drm/layerscape: fix handling fsl_dcu_drm_plane_index result Andrzej Hajda
2015-09-21 13:33   ` Andrzej Hajda
2015-09-21 13:33 ` [PATCH 16/38] gpu: ipu-v3: fix div_ratio type Andrzej Hajda
2015-09-23  8:20   ` Philipp Zabel
2015-09-21 13:33 ` [PATCH 17/38] isdn: hisax: fix frame calculation Andrzej Hajda
2015-09-22 23:15   ` David Miller
2015-09-21 13:33 ` [PATCH 18/38] net/ibm/emac: fix type of phy_mode Andrzej Hajda
2015-09-22 23:14   ` David Miller
2015-09-21 13:33 ` [PATCH 19/38] net: stmmac: fix type of entry variable Andrzej Hajda
2015-09-22 23:15   ` David Miller
2015-09-21 13:33 ` [PATCH 20/38] net: brcm80211: fix range check Andrzej Hajda
2015-09-22 23:15   ` David Miller
2015-09-21 13:33 ` [PATCH 21/38] mwifiex: fix comparison expression Andrzej Hajda
2015-09-22 10:56   ` Amitkumar Karwar
2015-09-22 23:15   ` David Miller
2015-09-21 13:33 ` [PATCH 22/38] orinoco: fix checking for default value Andrzej Hajda
2015-09-22 23:15   ` David Miller
2015-09-21 13:33 ` [PATCH 23/38] rndis_wlan: " Andrzej Hajda
2015-09-22 23:15   ` David Miller
2015-09-21 13:33 ` [PATCH 24/38] rtc: opal: fix type of token Andrzej Hajda
2015-09-21 13:33   ` [rtc-linux] " Andrzej Hajda
2015-10-03 13:08   ` Alexandre Belloni
2015-10-03 13:08     ` [rtc-linux] " Alexandre Belloni
2015-09-21 13:33 ` [PATCH 25/38] staging: media: davinci_vpfe: fix ipipe_mode type Andrzej Hajda
2015-11-09 21:18   ` Laurent Pinchart
2015-09-21 13:33 ` [PATCH 26/38] staging: lustre: remove invalid check Andrzej Hajda
2015-09-21 13:33   ` [lustre-devel] " Andrzej Hajda
2015-09-21 13:33 ` [PATCH 27/38] usbnet: " Andrzej Hajda
2015-09-22 23:15   ` David Miller
2015-09-21 13:34 ` [PATCH 28/38] video/omap: " Andrzej Hajda
2015-09-21 13:34   ` Andrzej Hajda
2015-09-24 10:48   ` Tomi Valkeinen
2015-09-24 10:48     ` Tomi Valkeinen
2015-09-24 10:48     ` Tomi Valkeinen
2015-09-21 13:34 ` [PATCH 29/38] Input: touchscreen: atmel: " Andrzej Hajda
2015-09-21 17:10   ` Dmitry Torokhov
2015-09-21 13:34 ` [PATCH 30/38] leds: flash: " Andrzej Hajda
2015-09-22  7:36   ` Jacek Anaszewski
2015-09-21 13:34 ` [PATCH 31/38] leds: tca6507: " Andrzej Hajda
2015-09-22  7:37   ` Jacek Anaszewski
2015-09-21 13:34 ` [PATCH 32/38] fs/cachefiles: remove invalid checks Andrzej Hajda
2015-09-21 13:34 ` Andrzej Hajda [this message]
2015-09-21 13:34   ` [PATCH 33/38] mm/memblock.c: remove invalid check Andrzej Hajda
2015-09-21 21:31   ` Andrew Morton
2015-09-21 21:31     ` Andrew Morton
2015-09-21 13:34 ` [PATCH 34/38] perf: " Andrzej Hajda
2015-09-21 13:34   ` Andrzej Hajda
2015-09-21 13:34 ` [PATCH 35/38] ptrace: " Andrzej Hajda
2015-09-21 13:34   ` Andrzej Hajda
2015-09-21 13:34 ` [PATCH 36/38] MIPS: " Andrzej Hajda
2015-09-22 15:43   ` Ralf Baechle
2015-09-21 13:34 ` [PATCH 37/38] zlib_deflate/deftree: change always true condition to 1 Andrzej Hajda
2015-09-21 13:34 ` [PATCH 38/38] drm/radeon: simplify boot level calculation Andrzej Hajda
2015-09-21 13:34   ` Andrzej Hajda
2015-10-26 15:55   ` Deucher, Alexander
2015-10-26 15:55     ` Deucher, Alexander
     [not found] ` <1442842450-29769-1-git-send-email-a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-09-21 13:42   ` [PATCH 00/38] Fixes related to incorrect usage of unsigned types David Howells
2015-09-21 13:42     ` David Howells
2015-09-21 13:42     ` [lustre-devel] " David Howells
2015-09-21 13:42     ` David Howells
2015-09-21 13:42     ` David Howells
2015-09-21 13:42     ` David Howells
2015-09-22  9:13     ` Andrzej Hajda
2015-09-22  9:13       ` Andrzej Hajda
2015-09-22  9:13       ` [lustre-devel] " Andrzej Hajda
2015-09-22  9:13       ` Andrzej Hajda
2015-09-22  9:13       ` Andrzej Hajda
2015-09-22  9:13       ` [rtc-linux] " Andrzej Hajda
2015-09-22  9:13       ` Andrzej Hajda
2015-09-22  9:13       ` Andrzej Hajda
2015-09-22  9:46       ` Jacek Anaszewski
2015-09-22  9:46         ` Jacek Anaszewski
2015-09-22  9:46         ` [lustre-devel] " Jacek Anaszewski
2015-09-22  9:46         ` [rtc-linux] " Jacek Anaszewski
2015-09-22  9:46         ` Jacek Anaszewski
2015-09-22  9:46         ` Jacek Anaszewski
2015-09-21 13:48 ` [PATCH 32/38] fs/cachefiles: remove invalid checks David Howells
2015-09-21 16:10 ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1442842450-29769-34-git-send-email-a.hajda@samsung.com \
    --to=a.hajda@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=kuleshovmail@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=m.szyprowski@samsung.com \
    --cc=tony.luck@intel.com \
    --cc=weiyang@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.