Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp3028628rwr; Fri, 28 Apr 2023 22:29:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5a4uRr+W5reNswW5up326Y4zfX7fIdGfA9y3HKvLjxynBs6EXkRE0/X+ZqPNYwMpb7oZls X-Received: by 2002:a05:6a21:32a2:b0:eb:7d41:a70b with SMTP id yt34-20020a056a2132a200b000eb7d41a70bmr9406638pzb.1.1682746156277; Fri, 28 Apr 2023 22:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682746156; cv=none; d=google.com; s=arc-20160816; b=b6R30GcfROnf5oObMk5mLVcgN65yvLi3svUL3vDsUuXL4KFC9jLYQACuNGvGgVHnxD k3SAZWqg+eX2+moMWK3LW0UExHOJ/e0eo+6kIsH28V3krbLhkLGT5q2lNujQ0QNSezS9 luLDwFeT3vgNYMwJA5kpE1i/kYSfeEwVtTRyJo+eo1bwh01L2/FfVA8xdAl8e5zKZJH4 P1r4h7AOeARK6egjk0PzaffJU6LFblFylG42tBcBzruYGkYdi+wqX2odjwJPOqc0xSTq NqFHkZ5gFu9sk2RuhY4UtM4C0fSYmDqF0iHqRlhG/IOPr/hJfMUwCcLHbGN+AzCW5wtP eCbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=3MmkiiZNk9+wb8Klw3jzPi8fh73m62AVfCNe2hPNLUU=; b=RwpuAbAyE9Q0CTVe/xN03eRMVHt0xQhnGOeomS/lxps6ni+0s83O2n4K+Nc9wUe2xo OZGAAHLlptJ0vpczL7jf7YU+DzlJza4uGQqlLLQAUFAjO7B1bnVlBDtQPe/4g3RRi6rK OvX5dHGJsJnDcacCGwCzjsQSbIpjld4AFbQKt99tpoS/8sOL6+hZoMbg7O8L4FCNSkHg yRQjoPCvdfkUpq/tgx53sxAiPATdmFtu/27bbioqZvKIdeHdnu71SeSyy5QeMbGzycSD L3B+rzqBkhi0LOkyvlL69eqsFlei4vtDkGu2rAyZTVvxkI7Zq9Q9dB7UmjdrAqhE9U2k TwMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=3OCkz1Yg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j2-20020a17090a318200b002467eaf62e0si25431893pjb.178.2023.04.28.22.29.05; Fri, 28 Apr 2023 22:29:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=3OCkz1Yg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347219AbjD2EpM (ORCPT + 99 others); Sat, 29 Apr 2023 00:45:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347214AbjD2EpK (ORCPT ); Sat, 29 Apr 2023 00:45:10 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D046B2D7F for ; Fri, 28 Apr 2023 21:45:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:In-Reply-To:References; bh=3MmkiiZNk9+wb8Klw3jzPi8fh73m62AVfCNe2hPNLUU=; b=3OCkz1YgKtsppB85cXDdCi2F3q fQUvS0lN1/beLdci4WMpPWxc5l1L68XpvPJN5Fy11nojc16aVxNsy2lEhnKQoBuKfxYfHqQOZtlpD nEC9+DbaV+/oNNRL7P2kzCfAxKFgGEJO88aoFwioU4df6F63Jn346rm7U2Zjyts/b4gCrsT75DNNP 4PGve5JHfmgWC5UJxzQj0RxqMUMwW2xF2trmEuLCD1GMZ2ELuqxGwA3M4Mla9Clld4OxL/2jgEL+O SVvPBAhHZnjljqh7BK27Nf+GEv7246ivJ5HjCgr4HkhN/wfdpDz9Zao2RPwWf3QHk37ko+6qoGzQy fzX4g7MA==; Received: from [2601:1c2:980:9ec0::2764] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pscSJ-00CEcL-1M; Sat, 29 Apr 2023 04:45:08 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Tejun Heo , Lai Jiangshan Subject: [RFC PATCH] workqueue: fix cast warnings on i386 Date: Fri, 28 Apr 2023 21:45:06 -0700 Message-Id: <20230429044506.24843-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add casts to avoid int-to-pointer-cast warings on i386 or UML for i386: ../kernel/workqueue.c: In function ‘get_work_pwq’: ../kernel/workqueue.c:713:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 713 | return (void *)(data & WORK_STRUCT_WQ_DATA_MASK); | ^ ../kernel/workqueue.c: In function ‘get_work_pool’: ../kernel/workqueue.c:741:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 741 | return ((struct pool_workqueue *) | ^ ../kernel/workqueue.c: In function ‘get_work_pool_id’: ../kernel/workqueue.c:763:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 763 | return ((struct pool_workqueue *) | ^ Fixes: e120153ddf86 ("workqueue: fix how cpu number is stored in work->data") Fixes: 112202d9098a ("workqueue: rename cpu_workqueue to pool_workqueue") Signed-off-by: Randy Dunlap Cc: Tejun Heo Cc: Lai Jiangshan --- kernel/workqueue.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff -- a/kernel/workqueue.c b/kernel/workqueue.c --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -710,7 +710,7 @@ static struct pool_workqueue *get_work_p unsigned long data = atomic_long_read(&work->data); if (data & WORK_STRUCT_PWQ) - return (void *)(data & WORK_STRUCT_WQ_DATA_MASK); + return (void *)(unsigned long)(data & WORK_STRUCT_WQ_DATA_MASK); else return NULL; } @@ -739,7 +739,7 @@ static struct worker_pool *get_work_pool if (data & WORK_STRUCT_PWQ) return ((struct pool_workqueue *) - (data & WORK_STRUCT_WQ_DATA_MASK))->pool; + (unsigned long)(data & WORK_STRUCT_WQ_DATA_MASK))->pool; pool_id = data >> WORK_OFFQ_POOL_SHIFT; if (pool_id == WORK_OFFQ_POOL_NONE) @@ -761,7 +761,7 @@ static int get_work_pool_id(struct work_ if (data & WORK_STRUCT_PWQ) return ((struct pool_workqueue *) - (data & WORK_STRUCT_WQ_DATA_MASK))->pool->id; + (unsigned long)(data & WORK_STRUCT_WQ_DATA_MASK))->pool->id; return data >> WORK_OFFQ_POOL_SHIFT; }