Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2179880rwb; Wed, 30 Nov 2022 03:31:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf4jGZUigHZUjL7YijNJjAeIhVJKxdDdFGal4hJHmNfe5iYGr0MkUDV51VkZ9lIE3cOyWcV4 X-Received: by 2002:a17:902:f253:b0:189:68cf:ccc7 with SMTP id j19-20020a170902f25300b0018968cfccc7mr25803564plc.26.1669807899430; Wed, 30 Nov 2022 03:31:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669807899; cv=none; d=google.com; s=arc-20160816; b=ra6dUDyiRdDeAbFeUoBwJnWd/D4BsTXvgy2AJQSEsttb2Kk7LjDWb16RcsYu8CR8MP UYTRO65UOo8VVcehKJgbkUGtWt/ELvXyDXYD44gxj9JkNs37e+IVOdIYPbAG5h2Y/mxK NJlMrXaEm6GOP/fqgENOvC2NR92dSMxAS+4oMd9nAVf8k8EQH27ttfobmIOg4R4dD7V+ uwuBCXVcgSWoANn4cfVU5p7+5grH1fXdPtZVWp+T36hVnCZyA5V/JP9R65XTlbuGpfgt Pg6TDQwKwGoN0aT7QmWcL9d2XnaT1y3TdSgnYrlQU/twufVxo8Tz24x+O539nG25GSOO ApcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fHk/dI+Wqo8AKKVxdKx3BJPu0uLScN9ugi+9UKAE7w4=; b=cKhjYg4ln3E0l1SqwKVfYxgffKBpA1OxWUHmmcwia14wH8fZ3qoGTwKPIMWxYWRyKM Ts5CMSadhmGU7y3yOzE16h+CpCfJiVWZdAm0e6Xsy16P4R9G1s4u7FcdIQPrGP4RA5Ab KNeFYlubIyAAUWXfAQfUwfPBDqUz2cSh2uGSIHjH+5YX9Q7isbSd4k6mH14fbyPLx5Zp BUPBu8kXZsWkmQtMqmNHo7vsiXkIN8dE36VHn4y9jZ758OVg2FEVcpU6xaEZcTcD9GKg zif9aknHY3wRvhwk0w1PnCXrMydQuXcWUXFbz+c6TeXTY9w3QqRMzWwmhGZq3csgwty2 J2aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LBAYZ7W3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h69-20020a636c48000000b00476e8fca283si1019530pgc.725.2022.11.30.03.31.28; Wed, 30 Nov 2022 03:31:39 -0800 (PST) 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=@intel.com header.s=Intel header.b=LBAYZ7W3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233552AbiK3LKl (ORCPT + 84 others); Wed, 30 Nov 2022 06:10:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231550AbiK3LKb (ORCPT ); Wed, 30 Nov 2022 06:10:31 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E12474CC6; Wed, 30 Nov 2022 03:10:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669806630; x=1701342630; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=SHCCZ8tHX7swHS+8I5E5Yfv024KDVI1AhlbR7nZOZSI=; b=LBAYZ7W3HYv5kaT6uLUBSxdX5aptsu5H97aHAk05xV5MGDSXl2e/pcwa IsHCZCCMEeGGcjYRmw78c8mwuNMbfHicucG80gq5mEGzoDqnC8JG/uUmG KUIhGWeconyQ1Veodu3ms+EHb76PXtUwruUFuwSt9E8NxPlwMhMn/oe2V Oedy8nKcfDXPmvVR5WIMUDFXb2UQNBAJsonHre9RyavybdJgkEeBDhnTV H+eC4aSvaY1A/cnEAxOfR/jPSE5r1iE+DggD8gaq9piS9vch7sNn9R3PV 2WegSojcau9gEGKbf7V/LFTn5DCcJCpkEnXC1ZEkBJ8tkrJV7UGQN5Zkh A==; X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="342289945" X-IronPort-AV: E=Sophos;i="5.96,206,1665471600"; d="scan'208";a="342289945" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2022 03:09:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="786425773" X-IronPort-AV: E=Sophos;i="5.96,206,1665471600"; d="scan'208";a="786425773" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 30 Nov 2022 03:09:32 -0800 Received: by black.fi.intel.com (Postfix, from userid 1001) id 8F510184; Wed, 30 Nov 2022 13:09:59 +0200 (EET) Date: Wed, 30 Nov 2022 13:09:59 +0200 From: Mika Westerberg To: Andy Shevchenko Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Jamet , Yehezkel Bernat , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Subject: Re: [resend, PATCH net-next v1 2/2] net: thunderbolt: Use separate header data type for the Rx Message-ID: References: <20221129161359.75792-1-andriy.shevchenko@linux.intel.com> <20221129161359.75792-2-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 On Wed, Nov 30, 2022 at 12:51:06PM +0200, Andy Shevchenko wrote: > On Wed, Nov 30, 2022 at 09:46:16AM +0200, Mika Westerberg wrote: > > On Tue, Nov 29, 2022 at 06:13:59PM +0200, Andy Shevchenko wrote: > > > The same data type structure is used for bitwise operations and > > > regular ones. It makes sparse unhappy, for example: > > > > > > .../thunderbolt.c:718:23: warning: cast to restricted __le32 > > > > > > .../thunderbolt.c:953:23: warning: incorrect type in initializer (different base types) > > > .../thunderbolt.c:953:23: expected restricted __wsum [usertype] wsum > > > .../thunderbolt.c:953:23: got restricted __be32 [usertype] > > > > > > Split the header to bitwise one and specific for Rx to make sparse > > > happy. Assure the layout by involving static_assert() against size > > > and offsets of the member of the structures. > > > I would much rather keep the humans reading this happy than add 20+ > > lines just to silence a tool. Unless this of course is some kind of a > > real bug. > > Actually, changing types to bitwise ones reduces the sparse noise > (I will double check this) without reducing readability. > Would it be accepted? Sure if it makes it more readable and does not add too many lines :)