Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp521683pxb; Thu, 24 Mar 2022 01:34:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+kXxSZkQKNywUIKvNbccW0Eya0I6EH63PW38x7l/oBgHauhDLP0olKGw56sUwZZ0vWxlX X-Received: by 2002:a17:907:d03:b0:6da:9618:7ddd with SMTP id gn3-20020a1709070d0300b006da96187dddmr4471142ejc.341.1648110889611; Thu, 24 Mar 2022 01:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648110889; cv=none; d=google.com; s=arc-20160816; b=F2AGv+elU8/W529EWKz9oA6uS+HbfNK2ElrFd/YpZFRm7lZ8I9MLMBWYSMnWkuSse/ JAhqPe1n5/Q5K2whUju1Xg+4h9RzX8Bz4nDyQMuosUtBahmwPjnVjPVn1pflPZCuVTaQ purNlLWX2EwsuZG5b+RnCzMd2WrGV7kwFMjbHvldG317m2bBixTUbRj42qjx6G0d2RHu 07FhHqdnc+pYB8DaUI1LD/c3BvNKqIbeQ8Ho+aqcX5cTkLe5Sl0ypM+AURCH2ud3fPXc GDQqCjv42tsrE9wQfMBqeL+Z17P7vLEG6a+ZHNsjYguMmwgt7s59pLTdQVoag2E+cO8U /xqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=+Pff7gY705XlzxC+9bRvnIDtmMqK2dXvDkHDvOBYbI0=; b=jVXphlrzcU5f+m54NN/2YMmiOUodMo8OXpWNMmNNM+54kfaCgLuyOGgRNUdMHUwa9/ Bwt5jIvxFIW2QyUOr2LRwpT3bAdaEqEjxDYsuCjfX1sc3ViGdCdXoV9XYZ+p92dhwy6q 24LcZHNEWksNX+wXKyXB4wVqnclmP+RYsLJWt7YB3iKa5W7CfjhbLkCA//1ITtYjDs3f 8689Gifsg49GXo2w2tg5khEHe3vTgTl4s5sd+IHHt9poPXpP0QhUjp09tKsApXUaNkCW fihUIKWtbXvvF0bSJg0oMxvp/JwCeBGJMbo1xqsDfQBZ+YOlwOKsBb6pUKC5v9KO5Ud4 kW9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tFHOHIUA; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q23-20020a50aa97000000b00419297bb4a0si13399682edc.514.2022.03.24.01.34.22; Thu, 24 Mar 2022 01:34:49 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=tFHOHIUA; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239238AbiCVS3C (ORCPT + 99 others); Tue, 22 Mar 2022 14:29:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235139AbiCVS3A (ORCPT ); Tue, 22 Mar 2022 14:29:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A733590246; Tue, 22 Mar 2022 11:27:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 41B12615C0; Tue, 22 Mar 2022 18:27:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F171C340EC; Tue, 22 Mar 2022 18:27:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647973651; bh=uOSvkHpZ1Gp5Do/Gf5jpgr3xJAKnHMDWMqaC9BanDE0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tFHOHIUA81vi642CvYKLC3JpQKJGfF5h9CyHBiupNSEKY4FQMfOkfHioEtgM3a3G/ oXcEwHUc0ON2plePihafb4XX3uvuabPt2Khu4fwtsuiJZP5nkbivMwpOERe9cfwvzV cjMnZrTz1sL4L1NuieJIVSNY/x3BNtwHFf9FYZac+aDbBuWQgINI9Z7IlCo4hEwZeP d0iie3NqlzCN/5xU0bEQahdplhpygP/h5/+y2H3fOrMcOFNwz/11jGsB/sqHDbZfTp o3eMNFr1hdEFKOC6zBjjNnwmR//blNXw2Y4OA5QefoP3M63NXyGQPONAcZ5VlHsYih eYeYr8tlHRQtA== Date: Tue, 22 Mar 2022 11:27:30 -0700 From: Jakub Kicinski To: David Laight Cc: 'Alexander Lobakin' , 'Wan Jiabing' , Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Paolo Abeni , "intel-wired-lan@lists.osuosl.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] ice: use min_t() to make code cleaner in ice_gnss Message-ID: <20220322112730.482d674d@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: References: <20220321135947.378250-1-wanjiabing@vivo.com> <20220322175038.2691665-1-alexandr.lobakin@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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, 22 Mar 2022 18:12:08 +0000 David Laight wrote: > > > Oh FFS why is that u16? > > > Don't do arithmetic on anything smaller than 'int' > > > > Any reasoning? I don't say it's good or bad, just want to hear your > > arguments (disasms, perf and object code measurements) etc. > > Look at the object code on anything except x86. > The compiler has to add instruction to mask the value > (which is in a full sized register) down to 16 bits > after every arithmetic operation. Isn't it also slower on some modern x86 CPUs? I could have sworn someone mentioned that in the past.