summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Shan <gshan@redhat.com>2023-01-24 08:02:43 +0800
committerYury Norov <yury.norov@gmail.com>2023-03-01 23:02:34 -0800
commit985ed3d95d40a97cb43f414fceb85fcbfb90f7f9 (patch)
tree39e0a075a4b3287a6afd2cd754828e175f0b9961
parent024f21922587eaed6809dd6654aa41c5a419a2b3 (diff)
downloadlinux-next-985ed3d95d40a97cb43f414fceb85fcbfb90f7f9.tar.gz
nodemask: Drop duplicate check in for_each_node_mask()
The return value type is changed from 'int' to 'unsigned int' since commit 0dfe54071d7c8 ("nodemask: Fix return values to be unsigned"). Besides, the conversion between 'int' and 'unsigned int' on the parameter @node is guaranteed to be safe due to the limited range of MAX_NUMNODES and CONFIG_NODES_SHIFT. By the way, '(node >= 0)' should have been '(node) >= 0' actually. It's unnecessary to check if their return values are greater or equal to 0 in for_each_node_mask(). Remove it. No functional change intended. Signed-off-by: Gavin Shan <gshan@redhat.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Yury Norov <yury.norov@gmail.com>
-rw-r--r--include/linux/nodemask.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 8c04254c5284..6650a754165b 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -385,7 +385,7 @@ static __always_inline void __nodes_fold(nodemask_t *dstp, const nodemask_t *ori
#if MAX_NUMNODES > 1
#define for_each_node_mask(node, mask) \
for ((node) = first_node(mask); \
- (node >= 0) && (node) < MAX_NUMNODES; \
+ (node) < MAX_NUMNODES; \
(node) = next_node((node), (mask)))
#else /* MAX_NUMNODES == 1 */
#define for_each_node_mask(node, mask) \