Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2199793rwb; Wed, 30 Nov 2022 03:50:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf6jRKFT5VgjYXPTnPuy2KaExV54PpQqcwCAyqARPCBPVReOV2f3k7tWu3qzB7+3ssHlmvLX X-Received: by 2002:a17:902:b947:b0:189:7a15:134b with SMTP id h7-20020a170902b94700b001897a15134bmr19830072pls.143.1669809046212; Wed, 30 Nov 2022 03:50:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669809046; cv=none; d=google.com; s=arc-20160816; b=IEFXmp/0o4AvLKAhr5jajTzBlAean+RV6DKJXokpr54kkeBXd40Ah7y3JM6ymN9FVW QZAyFi8ODcK/+6bB6jFz2p7AdzGP26r0WMwa3qfncjy6l5pa5i5DBSG6Q02+6mEHIjt7 deI/RKibdyp1sUrwSHAWlH/BAC1zv/jXwk44lwBcE8s8YHRW8uxfouD3Rle9E94JlTEr Ei9uhI6vxxLdKJMSRN/AofLF+pDHaCThEwlfaqY3RLc0aEGyc0bmsg8LSmRtkktsfjHw B0o/o/3mRlvQWPcCmCYyoocHAhzksEVLzD+OPoEua+wp2+CuIWMVL95kdL31Api6+RIE yPzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=mzBWUeLhR7dfMw6kLaASBL56Rah8K4Bj7qk2FEvReb4=; b=Ae5K/v7fNmD+P/LYZJwSkbmUjGoMVbThaCpmtB3xuvTrEFOgESlqYHHrO1hb3dRmG6 GHyAky7NTH6Crv5gpFoGSrh5lRtq72EbFWRbGRyaxXgY7xnXJaGqrkdtgNqze5u5uB9C 2jn77VsV5peipAwADOOtzV1vXGzyW38aDtYuv17OKbTvP1AA+TlrCq7nKVNZlle15K6A kldAXdgOJF2zqYj25SRwgFYU7AFlYuYZbSObe/mErpqY+oR9ztVUxAsW0hqn1LTpp47R +i2aPsIFHbshxWO6TCrPoAtNIjqqJOVlB+pr9RHnjvhjh11WDDd6w3nJNVHtDkL3WhgP zlWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XasCGH4s; 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 t64-20020a635f43000000b004784634562esi1095503pgb.187.2022.11.30.03.50.34; Wed, 30 Nov 2022 03:50:46 -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=XasCGH4s; 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 S231322AbiK3Lig (ORCPT + 84 others); Wed, 30 Nov 2022 06:38:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232155AbiK3Lie (ORCPT ); Wed, 30 Nov 2022 06:38:34 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 945D12ED60; Wed, 30 Nov 2022 03:38:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669808313; x=1701344313; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=TaijO37vvQN0R1RRGRvAfk8K4dWGe7fGsOg1uROklL0=; b=XasCGH4sAU5DPGcVmEyW0C6XUfhkjj4MA/YGvxwhDPI8YlmHtS0s45cH +v8S5Ldyk2BgyH2hkRfoFJ1MzC0lRH1pcm7iVJvrdezIB5/NAscWEmtZ3 k8KPJAyt8PnhroSyfFvuBLvxbbFb9IUvmaCPmwSE49ydLFa9L+Z03WegC FsJR5ASdHQVH83A5X78KEWWv6sSndD8MOMJlIol4gEPx9Vwcce+Om//Cn M+gFtH9QODUTfHaOaI1B1Y3jgMzUGFDMD28uCRc1i7KCPM/uKmDVBQCqH ugLSYz+/S15YFBpwIJSM1H2UJi9IiJgeKjD9LRsXxNWjQo3FcHX1sTdUs Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="317223174" X-IronPort-AV: E=Sophos;i="5.96,206,1665471600"; d="scan'208";a="317223174" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2022 03:38:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="594634197" X-IronPort-AV: E=Sophos;i="5.96,206,1665471600"; d="scan'208";a="594634197" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003.jf.intel.com with ESMTP; 30 Nov 2022 03:38:30 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1p0LQ4-002EqP-0q; Wed, 30 Nov 2022 13:38:28 +0200 Date: Wed, 30 Nov 2022 13:38:27 +0200 From: Andy Shevchenko To: Mika Westerberg 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=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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 Wed, Nov 30, 2022 at 01:09:59PM +0200, Mika Westerberg wrote: > 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 :) It replaces types u* by __le*, that's it: -4 +4 LoCs. -- With Best Regards, Andy Shevchenko