Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp301281iob; Wed, 18 May 2022 02:29:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLuRVW0Ce+/WqAvo8NlPE7TZhz6X5c1hkT3CGbLP06/I4DPXU/FyAK4BHVzqWHRE4iASU3 X-Received: by 2002:a17:90b:1482:b0:1df:5b39:8a4 with SMTP id js2-20020a17090b148200b001df5b3908a4mr14766728pjb.233.1652866192437; Wed, 18 May 2022 02:29:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652866192; cv=none; d=google.com; s=arc-20160816; b=konG4ov6/Xj4j2EBP7BiD5m5IQZB64Jz3kPeJff5GnBWlRpcl/Uj87KXigaI8P0BKy 3FNdhhnI++BeSA6ZKiw3X2z109TBYp2wHNU8XcVmDDzoPNvo9LXP/ZipINxUnPOK9KAD OVRTRWEfJuHhnIN/L3EUBNTexcwyiuV5e9hHFDGYm3HrV638+fYv4Fyxpru+EuyjaXRn f3zqM83YWfGaG4giBQD8g7yRkEd/0+7MmiDP8AzCuIlQfGkw8452v/HZm+JaAmlicNK+ Crpq93Wqirb0ai5oyMWI5+dUqcZ0KRKoMDzbeiILYmrqqB7W4F49rVNVYTD+k2WE7Jbt xQrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id:dkim-signature; bh=GKJLCH2lJWrU2y3uKn5XDixssi7wgR5jkODsM9EB1WA=; b=bAXEKDo8bLTKdLX8Y8ww6eyYYBcyG/b5oFjdedSSeOrCdPscJ8WSzVXcmZDmVjgNYU r+2JQwLpfT3uEimG0imDGYBFcOiFU73iNl5Kbn2irpP0jn92+2glcvb8FIgKeKWXkPvF RzB8QEShA3LcTY1tVNr8WQM1POquNrcrFuoZO80CVtzG2n4tmtP0RBEYmeAavjBftrd9 4NPtgQDlEQTXW/yb3o0Pk9mAKFyciiZ183oQOrsj8w3IFEMwOFT796PzwyG3b655BvVJ /HkcWH4idb/hrTeKLfLqF+STh76I8JNf2/jjgxmO9bUwDfUy5Q4sMSPKjFl08xl85ZBD utGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=Odo5DWfp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j23-20020a63cf17000000b003c6086f7cb8si2169303pgg.431.2022.05.18.02.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 02:29:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=Odo5DWfp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9E82B624D; Wed, 18 May 2022 02:21:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234093AbiERJVG (ORCPT + 99 others); Wed, 18 May 2022 05:21:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234122AbiERJUx (ORCPT ); Wed, 18 May 2022 05:20:53 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07AA7C1E for ; Wed, 18 May 2022 02:20:50 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id f4so2474432lfu.12 for ; Wed, 18 May 2022 02:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to:cc :references:content-language:in-reply-to:content-transfer-encoding; bh=GKJLCH2lJWrU2y3uKn5XDixssi7wgR5jkODsM9EB1WA=; b=Odo5DWfp+MrJB0QFt2qllzGHNv+mP66gEbUZQ66kHh5rk1i71AFZprQh5DiyMyEscm pFfRHga1dvqYdzCepLnwOxoSJ12effeuj7jvpjiH16q1JM18dr06wrP/vZDM6waqFwwz sMQodP7FgEFh7ky6GFzZNoVUPW2ZYS2o2vIxqO+0sSJNhpn6g5c0fH9T5rMsrRp8Lxfc 4WAEZnkSk96nUh4BaONd+4sRiBl32YXL0Br+kbZYg1kcN9ZtV1h+cPDnUnscrCrGQKnr leEYbtO5ZjSOCdzy07iiEvtCYHu++k65ink7pxYTEq7Z7hwJuBa1SHQ6+V800jTv6uPF zXGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:cc:references:content-language:in-reply-to :content-transfer-encoding; bh=GKJLCH2lJWrU2y3uKn5XDixssi7wgR5jkODsM9EB1WA=; b=rkV9zIRnZM7c4I+fcXsRmicOALZbQx1cnX/Q3U6b9663XoGFY/j+OGQr6bFwYMeYvt ShhaYvTcjxQH3U87J3U43AdcCuibbkGH8RIxn8XDdUVbzvmmo1B0XbIRCpxGcgHuFpj6 uMjNrInRuAys8EMD8KdUSPK8o9CMpVTmubxZfaAAgUmZA8iNspfji/bX3Q0Gj3lgPgNQ KEUmtP5Z6EkwAjo5xdfM9J6aq4FqS/3naEqKj24RDJbK1iHb1JuY1SBe7gIDsBm/jkMQ G2/HkwZQxH8qH+mn4s4KoMP9aSIfTqS+0kd30eVc9ZZDPnlcSYWbTibUHtS8QKANZUAM xgpw== X-Gm-Message-State: AOAM531anI6VVX6VRJrCHCmNVmGG7oHKMQZVJQ7FSLgbzsQziqMCGq9d ci0BNsPmzR+AGYUxBbrBqnGafVhadTKn+A== X-Received: by 2002:a05:6512:22d4:b0:477:be45:3667 with SMTP id g20-20020a05651222d400b00477be453667mr427543lfu.659.1652865649229; Wed, 18 May 2022 02:20:49 -0700 (PDT) Received: from [192.168.43.196] ([185.174.128.243]) by smtp.gmail.com with ESMTPSA id b19-20020ac25633000000b00477b086308dsm153328lff.27.2022.05.18.02.20.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 May 2022 02:20:48 -0700 (PDT) Message-ID: <7de7721b-d090-6400-9a74-30ecb696761b@openvz.org> Date: Wed, 18 May 2022 12:20:46 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 From: Vasily Averin Subject: [PATCH v2] io_uring: fix sparce warnings about __kernel_rwf_t casts To: Jens Axboe , Christoph Hellwig Cc: kernel@openvz.org, linux-kernel@vger.kernel.org, Pavel Begunkov , Steven Rostedt , Ingo Molnar , io-uring@vger.kernel.org References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 sparse generates follwong warnings: fs/io_uring.c: note: in included file (through include/trace/perf.h, include/trace/define_trace.h, include/trace/events/io_uring.h): ./include/trace/events/io_uring.h:488:1: sparse: warning: incorrect type in assignment (different base types) expected unsigned int [usertype] op_flags got restricted __kernel_rwf_t const [usertype] rw_flags fs/io_uring.c:3164:23: sparse: warning: incorrect type in assignment (different base types) expected unsigned int [usertype] flags got restricted __kernel_rwf_t fs/io_uring.c:3769:48: sparse: warning: incorrect type in argument 2 (different base types) expected restricted __kernel_rwf_t [usertype] flags got unsigned int [usertype] flags __kernel_rwf_t type is bitwise and requires __force attribute for casts. To fix the warnings, the patch changes the type of fields in the corresponding structures: poll32_events and rw_flags are neighbours in the same union. Signed-off-by: Vasily Averin --- v2: updated according to comments by Christoph Hellwig --- fs/io_uring.c | 2 +- include/trace/events/io_uring.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 91de361ea9ab..e2a40c58654c 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -585,7 +585,7 @@ struct io_rw { struct kiocb kiocb; u64 addr; u32 len; - u32 flags; + rwf_t flags; }; struct io_connect { diff --git a/include/trace/events/io_uring.h b/include/trace/events/io_uring.h index cddf5b6fbeb4..34839f30caee 100644 --- a/include/trace/events/io_uring.h +++ b/include/trace/events/io_uring.h @@ -520,7 +520,7 @@ TRACE_EVENT(io_uring_req_failed, __entry->off = sqe->off; __entry->addr = sqe->addr; __entry->len = sqe->len; - __entry->op_flags = sqe->rw_flags; + __entry->op_flags = sqe->poll32_events; __entry->buf_index = sqe->buf_index; __entry->personality = sqe->personality; __entry->file_index = sqe->file_index; -- 2.31.1