Skip to content

Commit cdd2d06

Browse files
Gavin ShanYuryNorov
authored andcommitted
nodemask: Drop duplicate check in for_each_node_mask()
The return value type is changed from 'int' to 'unsigned int' since commit 0dfe540 ("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 <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Yury Norov <[email protected]>
1 parent c1d2ba1 commit cdd2d06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/nodemask.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ static inline void __nodes_fold(nodemask_t *dstp, const nodemask_t *origp,
385385
#if MAX_NUMNODES > 1
386386
#define for_each_node_mask(node, mask) \
387387
for ((node) = first_node(mask); \
388-
(node >= 0) && (node) < MAX_NUMNODES; \
388+
(node) < MAX_NUMNODES; \
389389
(node) = next_node((node), (mask)))
390390
#else /* MAX_NUMNODES == 1 */
391391
#define for_each_node_mask(node, mask) \

0 commit comments

Comments
 (0)