Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1166699pxa; Thu, 13 Aug 2020 02:11:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4DmHzBl39R+T4x4U0HF4RhIg9aZ3B9vFRZTRHdBy1cN0S0pz8oOO7P2tGx1QZTJ6/1hB9 X-Received: by 2002:a17:906:af1a:: with SMTP id lx26mr3939251ejb.415.1597309870368; Thu, 13 Aug 2020 02:11:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597309870; cv=none; d=google.com; s=arc-20160816; b=YyZyH3jv7j+42FPbVetfT0LoeGfqtSWTVEoqn05qoMSKMiiN2Rf4oK1YlCEHZJy4Fz DohNo7e9pW+eLOHlc5V1Xl+ruw5/kiIClYUMqsrOST/u0kQFwxOQ3eeqIpuFrwJjt1pL dbGRr3dCXS6nIlGmp2g181h0Pyky3AlnW0vwHk1aQvW1ztwd+qlwJljRUEEeqkdnSPdj nX8+HbN/8zAeIBPGQTZAn+UQxZRHuBaL1tU1W+DtI/SMEYimTX8Ms20Kvubh3GHb/qMr kAerKXFInHlUmmz2GK51VxyD+ssea+HsmLvKpFJsVH/bhiu5uaQxgDKjWKqT7G3zDR3h I7MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=Y3y7aS9eomhaL1vuy0xFiFPQEgKpuWXeQVtkMtMXDWY=; b=W71JxPGM7oraOnd3RG4tO6uFMbIPzIPtM1qAJPAy+peMOcTzrnQCypF96UTKnuLprI a7hvQcHVX+tM14sUsdviQN9zsh3fcY8J7hpK+Xs1OTqHQhPryJ2HIeIqkuFm+lkFvBJl DXAtxS5Nh+XSabOhzrAhvvj3Zp6bIKLL8cevrF5Ej53zjqBjqamrWaE7KQuy2QdxwMc9 brx0RDwfrzlsv/JH22hHrkNpm8kdSt0igJ8UayTXgjSnQeYMd56hU8KY9tYenm3tVDF+ DOsoTPbDBDyVWOUROHfD8IxK2MaQeAkKZgAW3TCS6MNk30p5ytoRUu6pJFQxcnwnX5bR 3e6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m27si2875186edj.262.2020.08.13.02.10.47; Thu, 13 Aug 2020 02:11:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726204AbgHMJHt (ORCPT + 99 others); Thu, 13 Aug 2020 05:07:49 -0400 Received: from mga04.intel.com ([192.55.52.120]:7109 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbgHMJHt (ORCPT ); Thu, 13 Aug 2020 05:07:49 -0400 IronPort-SDR: 9PcyCk15d7S+UDmSEln3MvyU1nw4FAkxi8pCCwhTBACVlG1g2w+gLo9UvIvLuCrilhujA1j/pJ V0v6lwIHT4HQ== X-IronPort-AV: E=McAfee;i="6000,8403,9711"; a="151605469" X-IronPort-AV: E=Sophos;i="5.76,307,1592895600"; d="scan'208";a="151605469" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2020 02:07:49 -0700 IronPort-SDR: /dng0qgxe4ytvTgRYkcMNtGBMOynSwGAPVH+eX/Wk2LdOA8CuIW7OqoOQivzodL7qoLnQ7+pci 3UU1b2qIBySA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,307,1592895600"; d="scan'208";a="318448547" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.141]) by fmsmga004.fm.intel.com with ESMTP; 13 Aug 2020 02:07:47 -0700 Date: Thu, 13 Aug 2020 17:04:09 +0800 From: Xu Yilun To: David Laight Cc: 'Moritz Fischer' , "linux-fpga@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "trix@redhat.com" , "lgoncalv@redhat.com" Subject: Re: [PATCH v4 1/4] fpga: dfl: change data type of feature id to u16 Message-ID: <20200813090409.GA1080@yilunxu-OptiPlex-7050> References: <1597027273-25288-1-git-send-email-yilun.xu@intel.com> <1597027273-25288-2-git-send-email-yilun.xu@intel.com> <20200812035604.GA2544@epycbox.lan> <3810fb75b42e45928a39a97449a01520@AcuMS.aculab.com> <20200813075843.GB7383@yilunxu-OptiPlex-7050> <54216e492cec4f84bc43dee176130e89@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54216e492cec4f84bc43dee176130e89@AcuMS.aculab.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 13, 2020 at 08:28:05AM +0000, David Laight wrote: > From: Xu Yilun > > Sent: 13 August 2020 08:59 > > On Wed, Aug 12, 2020 at 08:52:39AM +0000, David Laight wrote: > > > From: Moritz Fischer > > > > Sent: 12 August 2020 04:56 > > > > > > > > On Mon, Aug 10, 2020 at 10:41:10AM +0800, Xu Yilun wrote: > > > > > The feature id is stored in a 12 bit field in DFH. So a u16 variable is > > > > > enough for feature id. > > > > > > > > > > This patch changes all feature id related places to fit u16. > > > > > > How much bigger does it make the kernel? > > > > The patch changes the definition of feature id from u64 to u16, and will > > make the kernel slightly smaller. > > Unlikely. > Most of the structures will gain a 'pad' field. > Using u16 for function parameters and results almost certainly > requires instructions to mask the value. > Any arithmetic on u16 will require masking instructions on > (probably) all architectures except x86. > > Using 'unsigned int' is probably best. > > u16 is never a good idea unless you are defining enough > of them in a structure (eg as an array) to reduce the > structure size below some threshold. > (Or are matching some hardware layout.) I got it. Thanks for your detailed explanation. I think we may change them to u32. Is it the same case for u8? Think we may also change the dfl_device_id.type. Hi Moritz: The patch is applied to for-next, is it possible we recall it, or we make another fix after it? Thanks, Yilun. > > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales)