Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1980590rwb; Wed, 30 Nov 2022 00:07:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf6rvCoeRPyOLCfqFtURxJ2cXhszS5AS0Edp41uUNL9Wr5IFLhlSwZjsesm1xfUxFEyUywah X-Received: by 2002:a63:1761:0:b0:478:18d6:2cf2 with SMTP id 33-20020a631761000000b0047818d62cf2mr12320716pgx.442.1669795628909; Wed, 30 Nov 2022 00:07:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669795628; cv=none; d=google.com; s=arc-20160816; b=QmFoY2HPhBIcggafHWBVrrrpx8549c1SmLcIIqxl48mExoJLI2A+X1xgNouIbLMJYm lkdWkZB6BVNRwJqXEQ/95uw9vN+kf6ZzK3DjjIbLMY7yYihCXldqe5sWsZNDXMJJJHCW WAQ3sVguTHShIeHbUM4FxEecABf1bFDTFudyfu+3NhkvxXaP3rfPDoRTbDdLernxgCI1 8LsskZgb64RDDXogTfsBkA224a5SGuuoFgWybI40+8L0zVd0QLIU88GRExTsp/c6xXFS 2fOrwkzL8sgaI0I+2JM1i5tqA6Fqyo8hifn6QfoMqz/2zrLCWZYj9dPHxH4mSrI8qrED KKRw== 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=SHZmCtkFijlRgBHp91wu4STlkuLWl+xNHlIn4od/eAI=; b=RXNx3B2Y8TY7dMQcee3+2xOtgOuJPcEn/STNaAlNQEn6xZ8ARe4v06jvcB8V56RiPD YFSSS4NVy2GThT+P5LX181acBT4slci+tDaPd8lNMxVPo7rEgBXvLlBWJyL9s54f4Sdu v8TFXgdcDrRb6FRC53Tcqvzd+AJWMUKTQtqNwRjrF4GOJt7TyUJkqKwt7uam6nAc02PV p46l+IjuVPvnGhmhDNbJMQSgkkW5E/IkJLbkbV8MqyiGrWKaUpDR9wP64fTEZLYoc+Df iEczRyfaXhjihzxoRJTtK55e7JGfwERs6Mwe4cfapyL+9QPJ6G7tQu0LIQnlusxPlpx6 4Y+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AyaTmx4q; 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 u130-20020a637988000000b00477b64d8df4si695479pgc.77.2022.11.30.00.06.57; Wed, 30 Nov 2022 00:07:08 -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=AyaTmx4q; 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 S234165AbiK3Hp4 (ORCPT + 84 others); Wed, 30 Nov 2022 02:45:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233456AbiK3Hpy (ORCPT ); Wed, 30 Nov 2022 02:45:54 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBE4B61756; Tue, 29 Nov 2022 23:45:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669794353; x=1701330353; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=HaVmUGK72metvKvFhKmIqLQywyLRFYn/B8IU58n+gnU=; b=AyaTmx4qV0ungnI+aYOyKdFFRtQMMoKTgkCvDZO4YT6WAqwUrrnOL9kv 59wCkmwyY4J2H2QJA3H4JE0pJ76qjzrLZe+Q8y7z1NVD+EF8kI5tBfPPx bph9Rj+Hqo7FEOVeOREwWWfHhoXz45DiUEkjaEzJWuo3SQGaQZCWdY8S/ OjJAECcueGplzjC0pAIyVcYejRGRMUOTqeQ1+66FT+2KaOpUALe033svp 4NkE0Jy8oWce7oY9XxYUMlCVf3NSiqreFKDr/uQwmpu8UWbLNZYt38OoF 0f+Z5QJNSkpa1MSBs3Nir5S1loxggl183elD0mYgwCC0cFiyrpVD6pR+j w==; X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="317180663" X-IronPort-AV: E=Sophos;i="5.96,205,1665471600"; d="scan'208";a="317180663" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2022 23:45:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="732885048" X-IronPort-AV: E=Sophos;i="5.96,205,1665471600"; d="scan'208";a="732885048" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 29 Nov 2022 23:45:50 -0800 Received: by black.fi.intel.com (Postfix, from userid 1001) id E44AD10E; Wed, 30 Nov 2022 09:46:16 +0200 (EET) Date: Wed, 30 Nov 2022 09:46:16 +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: <20221129161359.75792-2-andriy.shevchenko@linux.intel.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 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. > > Signed-off-by: Andy Shevchenko > --- > drivers/net/thunderbolt.c | 22 +++++++++++++++++++++- > 1 file changed, 21 insertions(+), 1 deletion(-) 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.