From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751808AbdBBU31 (ORCPT ); Thu, 2 Feb 2017 15:29:27 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33394 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751206AbdBBU3Z (ORCPT ); Thu, 2 Feb 2017 15:29:25 -0500 Date: Thu, 2 Feb 2017 15:29:22 -0500 From: Tejun Heo To: Arnd Bergmann Cc: Lai Jiangshan , Sebastian Andrzej Siewior , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH wq/for-4.11] workqueue: clean up enum definitions in workqueue.h Message-ID: <20170202202922.GD7917@htj.duckdns.org> References: <20170201170135.2654291-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170201170135.2654291-1-arnd@arndb.de> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>From 225248f9f11895dabd86e118b69220242aece94b Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Thu, 2 Feb 2017 15:25:08 -0500 Consistently use UL postfix for mask calculation and drop unnecessary (unsigned long) cast from the enum definitions. Signed-off-by: Tejun Heo --- Arnd, I also queued this patch on top. It shouldn't change anything but can you please double check? Thanks. include/linux/workqueue.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index bde063c..1d2bce1 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -39,12 +39,12 @@ enum { WORK_STRUCT_COLOR_BITS = 4, - WORK_STRUCT_PENDING = 1 << WORK_STRUCT_PENDING_BIT, - WORK_STRUCT_DELAYED = 1 << WORK_STRUCT_DELAYED_BIT, - WORK_STRUCT_PWQ = 1 << WORK_STRUCT_PWQ_BIT, - WORK_STRUCT_LINKED = 1 << WORK_STRUCT_LINKED_BIT, + WORK_STRUCT_PENDING = 1UL << WORK_STRUCT_PENDING_BIT, + WORK_STRUCT_DELAYED = 1UL << WORK_STRUCT_DELAYED_BIT, + WORK_STRUCT_PWQ = 1UL << WORK_STRUCT_PWQ_BIT, + WORK_STRUCT_LINKED = 1UL << WORK_STRUCT_LINKED_BIT, #ifdef CONFIG_DEBUG_OBJECTS_WORK - WORK_STRUCT_STATIC = 1 << WORK_STRUCT_STATIC_BIT, + WORK_STRUCT_STATIC = 1UL << WORK_STRUCT_STATIC_BIT, #else WORK_STRUCT_STATIC = 0, #endif @@ -53,7 +53,7 @@ enum { * The last color is no color used for works which don't * participate in workqueue flushing. */ - WORK_NR_COLORS = (1 << WORK_STRUCT_COLOR_BITS) - 1, + WORK_NR_COLORS = (1UL << WORK_STRUCT_COLOR_BITS) - 1, WORK_NO_COLOR = WORK_NR_COLORS, /* not bound to any CPU, prefer the local CPU */ @@ -71,7 +71,7 @@ enum { WORK_OFFQ_FLAG_BASE = WORK_STRUCT_COLOR_SHIFT, __WORK_OFFQ_CANCELING = WORK_OFFQ_FLAG_BASE, - WORK_OFFQ_CANCELING = (1 << __WORK_OFFQ_CANCELING), + WORK_OFFQ_CANCELING = (1UL << __WORK_OFFQ_CANCELING), /* * When a work item is off queue, its high bits point to the last @@ -82,16 +82,16 @@ enum { WORK_OFFQ_POOL_SHIFT = WORK_OFFQ_FLAG_BASE + WORK_OFFQ_FLAG_BITS, WORK_OFFQ_LEFT = BITS_PER_LONG - WORK_OFFQ_POOL_SHIFT, WORK_OFFQ_POOL_BITS = WORK_OFFQ_LEFT <= 31 ? WORK_OFFQ_LEFT : 31, - WORK_OFFQ_POOL_NONE = (1LU << WORK_OFFQ_POOL_BITS) - 1, + WORK_OFFQ_POOL_NONE = (1UL << WORK_OFFQ_POOL_BITS) - 1, /* convenience constants */ WORK_STRUCT_FLAG_MASK = (1UL << WORK_STRUCT_FLAG_BITS) - 1, WORK_STRUCT_WQ_DATA_MASK = ~WORK_STRUCT_FLAG_MASK, - WORK_STRUCT_NO_POOL = (unsigned long)WORK_OFFQ_POOL_NONE << WORK_OFFQ_POOL_SHIFT, + WORK_STRUCT_NO_POOL = WORK_OFFQ_POOL_NONE << WORK_OFFQ_POOL_SHIFT, /* bit mask for work_busy() return values */ - WORK_BUSY_PENDING = 1 << 0, - WORK_BUSY_RUNNING = 1 << 1, + WORK_BUSY_PENDING = 1UL << 0, + WORK_BUSY_RUNNING = 1UL << 1, /* maximum string length for set_worker_desc() */ WORKER_DESC_LEN = 24, -- 2.9.3