From: Gavin Shan Date: Tue, 24 Jan 2023 00:02:43 +0000 (+0800) Subject: nodemask: Drop duplicate check in for_each_node_mask() X-Git-Tag: v6.6.7~2392^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cdd2d06fbc0a58297f782c8eb7e2f3c0b1dc367e;p=platform%2Fkernel%2Flinux-starfive.git 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 Reviewed-by: Andy Shevchenko Signed-off-by: Yury Norov --- diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index bb0ee80..8d07116 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h @@ -385,7 +385,7 @@ static inline void __nodes_fold(nodemask_t *dstp, const nodemask_t *origp, #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) \