From owner-dev-commits-src-all@freebsd.org Mon Jan 25 22:52:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B080E4F542E for ; Mon, 25 Jan 2021 22:52:23 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPlVv4N2mz3n0D for ; Mon, 25 Jan 2021 22:52:23 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f42.google.com with SMTP id q7so14584033wre.13 for ; Mon, 25 Jan 2021 14:52:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=+3DaJ9LbExuSCKXEcy132v5R4homHwkNuwZ2Mszn7OA=; b=LtiUGoH1gUwZ5404jY52yAhX6J7amQVOG1i3utqbEbVSlzwh6bUzB1R8L1dqjwwCdl yqRtPuU5sYl+g7CGeOI3sE0zB8sktkf2VdBCjZmLNayEP8ilExaczUFHXo7rsd+anpfS TsbOlttUfWc1alEPc8aeu2LK+0HjCHcl2EutO19d4FptEVPcucfHfwBbLaxJAndIoxe2 EYVhCFpt/J/DIgS+o7bB9t06Dme8CqDuZGd16qmdE1e12WZ3qB+AbO/Is+dIb9gGBFou gtbehao33mI+VoxqcZeJREn6Z+GlzDFvIQN1sKsC0DLH4O1rtYSPv6SrF83nH4BXAS2A J4JA== X-Gm-Message-State: AOAM530V0Bkn/9P2N2vzcVICBZwZGGUpLJdkCYlBekjocjLS6I+r5i2g RZbesCVNl13fCNMGhEvRd+Fhmg== X-Google-Smtp-Source: ABdhPJweCS9bJtTnEVXBO9tmG/yl0cUnGc2Di8691D1fZHMFfRoL19cZrmu+5XgkjJaSgH6niOv0uw== X-Received: by 2002:a5d:4a50:: with SMTP id v16mr3169401wrs.241.1611615142172; Mon, 25 Jan 2021 14:52:22 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id m82sm705862wmf.29.2021.01.25.14.52.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jan 2021 14:52:21 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: cc96f92a570e - main - atomic: make atomic_store_ptr type-aware From: Jessica Clarke In-Reply-To: <202101252242.10PMgZfO026271@gitrepo.freebsd.org> Date: Mon, 25 Jan 2021 22:52:21 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: 7bit Message-Id: References: <202101252242.10PMgZfO026271@gitrepo.freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DPlVv4N2mz3n0D X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 22:52:23 -0000 On 25 Jan 2021, at 22:42, Mateusz Guzik wrote: > index a3548977b940..4c29d132c369 100644 > --- a/sys/sys/atomic_common.h > +++ b/sys/sys/atomic_common.h > @@ -58,7 +58,7 @@ > #define atomic_store_long(p, v) \ > (*(volatile u_long *)(p) = (u_long)(v)) > #define atomic_store_ptr(p, v) \ > - (*(volatile uintptr_t *)(p) = (uintptr_t)(v)) > + (*(volatile __typeof(*p) *)(p) = (v)) This is in fact general enough to be any of the atomic_store_*, and won't give any errors if you use it for a uint16_t (where it will store a uint16_t). Jess