Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp144831lqo; Tue, 7 May 2024 15:21:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXG64x15N61ZzUEncWRlENcmcT8irATCSTWT6GIqn1ZvPxNrhJSK68ha0VFBKhiEatlD8LTo6zP6B/DhXAhPST7wOwcS9qCM7KlClPFKQ== X-Google-Smtp-Source: AGHT+IHUt4Dg8iOYPGd/VtEvg/TP9Iad+aJWxn/QP0rtgkdtdnRxvWhfGKxW9sK2dvJuZSHojSUl X-Received: by 2002:a17:903:2444:b0:1eb:904:dfd7 with SMTP id d9443c01a7336-1ee62f65e4bmr62536095ad.2.1715120467851; Tue, 07 May 2024 15:21:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715120467; cv=pass; d=google.com; s=arc-20160816; b=LUioXR22TRLvJrzJVRkh/mjTjzU/EC7lpDoc2DJVFmBwPKvhobMSUwqgszZZ6daumn mWIUoYnPSSX8Ih3xs2/ynD/5w9Fetp2JKO0keigNU1wMjjerZ0p1cJiM7KzeUXNtrZNA EHJwGfH9K8Gmdzfj3L4AtLkNWn0sMcC52yI1yu7DJuVUOx/I/GolS9RiCrL9UGlqut0B HFZ2WqgSv1jwzJ0Us8uFAYgZymuHdMWLYDkY9TruyfTxm90ASM5/VSlMWLBXUmypZKeO SpOJYmB/os0/JBT74DVeSh76usUk4W6dQj1CZBKVZl3vB5OdoevlkSgf+e6ewuRutsgX /iyQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=sEVwJv44zaVqMvBXpLTR8+D9zvixnfOEIX/GYYRWRRA=; fh=CgbKnIP7s8bj5c0ptNYUf4zJkJAE7ofkX1L/2+fCmu4=; b=IM2Afzy+xqgA1XTcvYpcNxmdsEGPYjG1cpTJSczWAfqBnkS9iyYAYuiFJf9ZgjgVvG irMQYdLujczNf9YF4FSGSc+etP3im33P6djIDxD1CzDG9PRErQvouXPBl4ZQS7OH4YGi vxhXIyLBtgw5/gCnVb/xE/Z1YoJ1WaAZAKfIcjeNiubi16MW1n+f3fbNX24wJ7bEDUos w60VY0A/QFC7YwRHjpUDgB6xc9qTRM63jlzfrwz178Do6HaA1AMULDAZ/PbUPkFWOQMu mLfCHQpxD74fq6HpieplCMiW3F2hDUBpYTCb1rNXP/Lvj3cKl/JdnjfDYqNXchotS150 cN6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=knpRnSRQ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-172245-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172245-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l16-20020a170903245000b001e46f4a657csi11668983pls.528.2024.05.07.15.21.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 15:21:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172245-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=knpRnSRQ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-172245-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172245-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0AE3F285045 for ; Tue, 7 May 2024 22:21:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 86923155A34; Tue, 7 May 2024 22:21:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="knpRnSRQ" Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5ADCE71B3B; Tue, 7 May 2024 22:20:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715120460; cv=none; b=rTTgKRu9G4wAjFGvGooZ6pvhWMe43uAcMsn29K4RS/mstnusQ1GK9Il+NAe9/p0MfoXR2FQAX/nxnxXFItiMzgyux+/Kwad0VAhU3GnFrkqfGyNle87Yd9F/hO+qffEoSNCFUVSmemTzzD3rDSALGLuroi44hEn6yQGj+rDnwjA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715120460; c=relaxed/simple; bh=HF/6ZRvBDsf27X3eJOND8Urh1pLKofHMissu9BvMcWw=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=pTr5pt878MYa2gSUYInTVA1ahNhTNGCM6gu2D4xT/ymobgdWQfl3+pc8pAmTaveP4pqWL4bTM9e+MI55UlHWM10zPNTpQYkZOSg7m0cjPYnxtvCZ7j6t1fJlomQrNlVewzsidNLyUe3GSPQkobdWybGwmt+QnBBOpO2BcALAQfE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=knpRnSRQ; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1ecd9a81966so1909505ad.0; Tue, 07 May 2024 15:20:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715120458; x=1715725258; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sEVwJv44zaVqMvBXpLTR8+D9zvixnfOEIX/GYYRWRRA=; b=knpRnSRQtmX6L999Pirikw4Fsfr6rmAkyl/bY3SBEnqLPGdM579nS69GixDMml+g32 mvyLM3VlTY4vMqNyzbl4Z63ICXLIqe42QPDYdNp0hAZIRps15OGcb3YuXpOFTGwBupF8 GhWbDxOtPgHzmPSH1Gnay+aXAmDiWTaCIToZHSEEQ9bMaVzcir9MUi+++OW68FSvvGEM 4oUbyuUtOHU57Ich7ZVs+7JeNPIyQJPQYG2Q6Nhw4LO/E6ZUGfYIxXorLPq6C8PwyZp9 irMIXWM+M8HfuX0dzPO4fHr7fh64Ub8Y9syvQc0KhIe4GUErB+MODcnhJBKWpG8OjkVI Tpdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715120458; x=1715725258; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sEVwJv44zaVqMvBXpLTR8+D9zvixnfOEIX/GYYRWRRA=; b=O3ODsIQBg538DHT5sENpeIRzxEWTkVo3spcimOAUh3vRnlA3ee0YPeJAtmfpu9kfPl s23g6cMt97P6os1ZIYZb296/HQRT/xdM8QQJppXyLJZFc6jcy9G6ogx+yKQNmarvCJiS nxgBDQA/FxaexHuKfMUbI9m7JVr91Mk4neqkFXf1ymULFt0OwChs28z0uE4ttgSKZMz2 RZ6zZjnOM/VHgqJIOpi3uMEA/m3sUe5PzM+rxYfQZ79n6Dh/mbz5AaJgVMEJB4BnxOgw G0UfOmcIKmylQ9tOaNxDoyjH0LEpsociuQdCd3OkGqbyN/vdQbnnwwc2R5Fw3vqU8W4h CN5Q== X-Forwarded-Encrypted: i=1; AJvYcCVFV5ZOg+KqBXgzwwL0jDEdENKKWLKziHX8JnAan/irSf8QOOxejLAh4S/vURxQ2OHJBpAiSmsuqIjdLpG4cFLtBM6KUjy5x9cCCKK8 X-Gm-Message-State: AOJu0YxF86s6R30lO3Twlc1x1sfnltELQMZHWUm75YMuzjK7S9jV55mq rRaxX+Q7erss/5J6vevw5BuJAdazYYQgUf/GSWmn0AE9rX+aTA1n4+rljA== X-Received: by 2002:a17:902:d2d1:b0:1e2:a1a8:5f49 with SMTP id d9443c01a7336-1eeabea21bcmr16203835ad.24.1715120458539; Tue, 07 May 2024 15:20:58 -0700 (PDT) Received: from carrot.. (i222-151-5-6.s42.a014.ap.plala.or.jp. [222.151.5.6]) by smtp.gmail.com with ESMTPSA id q3-20020a170902dac300b001e512537a5fsm10545132plx.9.2024.05.07.15.20.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 15:20:57 -0700 (PDT) From: Ryusuke Konishi To: Andrew Morton Cc: linux-nilfs@vger.kernel.org, linux-kernel@vger.kernel.org, Bart Van Assche , Linus Torvalds , Rasmus Villemoes Subject: [PATCH -mm v2] nilfs2: Use __field_struct() for a bitwise field Date: Wed, 8 May 2024 07:20:41 +0900 Message-Id: <20240507222041.4876-1-konishi.ryusuke@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Bart Van Assche As one can see in include/trace/stages/stage4_event_fields.h, the implementation of __field() uses the is_signed_type() macro. As one can see in commit dcf8e5633e2e ("tracing: Define the is_signed_type() macro once"), there has been an attempt to not make is_signed_type() trigger sparse warnings for bitwise types. Despite that change, sparse complains when passing a bitwise type to is_signed_type(). The reason is that in its definition below, an inequality comparison will be made against bitwise types, which are random collections of bits (the casts to bitwise types themselves are semantically valid and not problematic): #define is_signed_type(type) (((type)(-1)) < (__force type)1) So, as a workaround, follow the example of and suppress the following sparse warnings by changing __field() into __field_struct() that doesn't use is_signed_type(): fs/nilfs2/segment.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, include/trace/events/nilfs2.h): ./include/trace/events/nilfs2.h:191:1: warning: cast to restricted blk_opf_t ./include/trace/events/nilfs2.h:191:1: warning: restricted blk_opf_t degrades to integer ./include/trace/events/nilfs2.h:191:1: warning: restricted blk_opf_t degrades to integer [konishi.ryusuke: described the reason for the warnings based on Linus' explanation] Cc: Linus Torvalds Cc: Rasmus Villemoes Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202401092241.I4mm9OWl-lkp@intel.com/ Reported-by: Ryusuke Konishi Closes: https://lore.kernel.org/all/20240430080019.4242-2-konishi.ryusuke@gmail.com/ Signed-off-by: Bart Van Assche Signed-off-by: Ryusuke Konishi --- include/trace/events/nilfs2.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/trace/events/nilfs2.h b/include/trace/events/nilfs2.h index 8efc6236f57c..8880c11733dd 100644 --- a/include/trace/events/nilfs2.h +++ b/include/trace/events/nilfs2.h @@ -200,7 +200,11 @@ TRACE_EVENT(nilfs2_mdt_submit_block, __field(struct inode *, inode) __field(unsigned long, ino) __field(unsigned long, blkoff) - __field(enum req_op, mode) + /* + * Use field_struct() to avoid is_signed_type() on the + * bitwise type enum req_op. + */ + __field_struct(enum req_op, mode) ), TP_fast_assign( -- 2.34.1