Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp749310rdh; Wed, 14 Feb 2024 10:07:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVEGbd7vKiC7Xp28N1bPfszxZ9xXHdbAAShOkhZFIxQU6qCxglZkFfsjij1OhUepDX9SFZ3Ky9QTt6wnnHi/7IPx+4004TMNzkZl2LPQw== X-Google-Smtp-Source: AGHT+IFVuLW9HaXzYh8GiRceVhkf8LaEMFzkm5sJP3MVBnRXdQ6Hst+3Kmd2jfainwXzKefUhmSw X-Received: by 2002:a05:6a20:94c6:b0:19e:a85d:166 with SMTP id ht6-20020a056a2094c600b0019ea85d0166mr4849900pzb.9.1707934076922; Wed, 14 Feb 2024 10:07:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707934076; cv=pass; d=google.com; s=arc-20160816; b=VhXxIQEjlhgkRhyne4+hXpkz0x9M25+JbOnq6zpn5Dup5+iqYjz0p7WEAw3+nOyAxZ I2IhE6/k1/rn+yRG9sqJ6kKLznwrGlsUmj+/WviZo6FmeUwspUN4ed8VUaZ4URfcQ6HA UFDNyEw/y5aJQD6cYMdFZpLj8PnKTtXkLKCfmiupGNzG/VKiOyoAAT7W5ppO3yQXGLWZ nP6NDUEG9E/taZf9fG1gCDXIjhKt8gAHYASY9sZbNoA2ntA7vELtLzIGhWABxNZBgWOr sgwL6K/ZTQuT61valZ8HWRn2As+FOCy0UtntSkK0n0I/JKCEoVUAyzZeZoMos/GZEFca q5ZA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Cr4AUbLb4Tlg5EF++RWRUguumIyFcjXyIqj/taO18zs=; fh=pb96VbaGxAWPmSb++D+18tPeAD9h+q1NxI5eirfRj9g=; b=RWvXd55lI2N5vZAZcdnJVsoDgPm9fxQuNIWyY+DgSXzvAjfIk++93IXhSrjhrx6eiP XGyTo97HY+Uki+rFWd7HJ6kT1J1svJHplvXshqAAvL+eQXLXf58/AC+bR0qxx5a3Pgog BJjHjSUvv+QoEmn0ydV029TE+tNiYCcKYcxoxcxgbw8PJva/CerhxT4LWmjQ8TC2FZHA zDyLsuxdzCtpvHGgljyu+EenE10zDx1GRvF4bWRd0yL9jPQq13WQpvrfqrYrbbq/9XUz IFUoBlBZL5avU+D6QoyY3H0IDDpacFYXYDrfZgdxqNI/qJkS5UIhPeMlVAKFvncqiqAE kRVQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MatnQ4pI; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-65694-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65694-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCXckSA+42sRrk/7Vx4bt/5DtibWeWFAF0zH+xpIym02dyaLwdMmGtSYuNmEU4tVMNLqatOG//3Wz+6C4z82Xw6nCI8JS0MV1e9ocuPo8A== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b123-20020a633481000000b005d6a0068c1csi4217940pga.95.2024.02.14.10.07.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 10:07:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65694-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MatnQ4pI; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-65694-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65694-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B8D1BB2B5A9 for ; Wed, 14 Feb 2024 17:40:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A5A784FC8; Wed, 14 Feb 2024 17:39:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MatnQ4pI" Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2074A84A5D for ; Wed, 14 Feb 2024 17:39:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707932380; cv=none; b=WH9BZmCQ/cPFCX3rgTBhCB0pDV3aaRfFv76InOqHbxCtAmDbWWFTldkFrwbllRLdiolwivIUdLSVEZ0luX8xt0HHN0B9+x7CQMCIPKlctbyvtvtKu8ulcfXz7lYi7e/oaTKXbVoLzp4OBgnLiD7xpZL3YbAFY2SM5eNkKUTnFAQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707932380; c=relaxed/simple; bh=OM0x46JCVVAHrJ5IMUKXDrphSJGApFAK1gqtkAA3Ozw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Oq0wT/8VYgpexVHQWMpyOAatgLWFn2LkCNOihRtlpRswXRH+VB2L59xTSlM/s2k3cn62bWQtycAxRXg9eWVMgypvk9EtRG0/rj2bNOBSu6CS8piLIGbgPh882vPZbkczDbRqU0vZoDEu52Wvbe9JpxyDArco/XYR9r8zLQ8ZyZA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MatnQ4pI; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-411a5a86078so22306235e9.2 for ; Wed, 14 Feb 2024 09:39:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707932377; x=1708537177; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Cr4AUbLb4Tlg5EF++RWRUguumIyFcjXyIqj/taO18zs=; b=MatnQ4pI+ecY4RboTEIOJUsR8j+GDPYgLTm3YzMBg4zgqP1gkfwymAznQgZSh2+YCh rQblJerp6M0/eNT0Ds3qZOykfrIvaHhtMVRQrNpvjo1yar5SwGwTev/i0mDWH/rCmC03 ZJuLw8evDFC+Emd0VKYNLc96dwndWX/YxAcBQ6GzJNc+t7rv++urk8sDn0JLDklgefdJ JMGHInlB+eLoqi93XD61rzuO+2akfA/cABLQiDQ3JgOZPLn++pZ35Frg0vihTB0tf49U +MCGliyBJL6fABNocBHrRK1qnILJna1+BiRcMEwrgbBj35qQHyRMDYinel54BsFnRZYm UFhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707932377; x=1708537177; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Cr4AUbLb4Tlg5EF++RWRUguumIyFcjXyIqj/taO18zs=; b=SPiRcKF04MfL+pduc++luni7PINMioSnpZYeSppaOe2Az7oavlKjpBt2ceLEzRXlA+ hlrsJtgRju+PhgRQDIgS5cdA3AO+3JXNWW+llunKxUiI8d2lDZlPwXRTeRYaA+o0kIRY pBpGM6lwW/jvuPZB8pchpdC4vKmrubN7tFUB18jnq+2axFWCsYM3y692dHGJ/Ehzspgb 4fvMoh8dH1A8zNCOWOPv1hq0vLPlswXpx+GQ7DPXGdeJlhyny9mieC2gUMieT5AlDORZ WUfrhzEIBD4Vf8iIc2uKp6RLdRZqs5Xp3uhQWDnxX1V+5vpmQe8KAksOEyOVK2C2+xcc 4LLg== X-Forwarded-Encrypted: i=1; AJvYcCV7EXNxzoXuzUhI3ZzipniduVF0R1RnBu+jBGVvwuelKYhi6mQFhNTNiUOXES+XZ22z8Q379zBQVEBQ2YBua+Hx1XxAICWdiVad7xSp X-Gm-Message-State: AOJu0YyyauPbMnaPCrInnweX083mweX5yai0wVRMAmCdVWn/kfcExjD6 Ney7Yx+DHDozej618R7MJEtvcXXFafvdhiAPN0d17inAalbTmTE= X-Received: by 2002:adf:e591:0:b0:33b:63a3:450b with SMTP id l17-20020adfe591000000b0033b63a3450bmr2224153wrm.3.1707932377120; Wed, 14 Feb 2024 09:39:37 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUaDcoUns/VELPIlv7/cXGIsqVDdBkHRXrQgDqL/RL2DECfCKeovdNYV/d1fpJ++INJJ1Boehuzy9t1OyvmwvgYuZGy9Jws0aA4Aup9o5+Y8XTB2Vl8zZKNECY1tFCRDRHBdsmKiykh3jN6FOEWM2VYiXomb/XJX9BjPCk= Received: from p183 ([46.53.252.131]) by smtp.gmail.com with ESMTPSA id e30-20020adf9bde000000b0033cf5769ab2sm522263wrc.101.2024.02.14.09.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 09:39:36 -0800 (PST) Date: Wed, 14 Feb 2024 20:39:35 +0300 From: Alexey Dobriyan To: Andy Shevchenko Cc: Michal Wajdeczko , linux-kernel@vger.kernel.org, Rodrigo Vivi , Jani Nikula Subject: Re: [RFC] include/linux/make_type.h: Helpers for making u16/u32/u64 values Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On Wed, Feb 14, 2024 at 07:32:10PM +0200, Andy Shevchenko wrote: > On Wed, Feb 14, 2024 at 08:20:55PM +0300, Alexey Dobriyan wrote: > > ... > > > Secondly, > > > > #define make_u64(hi__, lo__) ((u64)(hi__) << 32 | (u32)(lo__)) > > > > doesn't truncate hi, why? > > Because it's not needed (the whole point AFAIU is to override promotion > to a _signed_ type (int) and here it makes no difference)? Well, make_u64((u64)-1, 0) will return (u64)-1 unlike make_u16((u64)-1, 0) which will return 0xff00. BTW, I'm for truncation, but it should be done everywhere. Thirdly, there were no users posted.