Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1557874lqa; Mon, 29 Apr 2024 11:50:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXmfcpfWhv8hA7K7gizHTwkokMeAg+IvkvkEBas0uAGuV8eTY3bzANJQN+2iy2Bi1j5eaNFOEIBkfvnd551XHvIt0+lJZgwiWQkrYXXwQ== X-Google-Smtp-Source: AGHT+IGITGt3vapVjz0YqtfCBxbdWHScQl/AQf7WoI+/iw5wHQWeWjiL84RFo01qVS6vYJAVcd3F X-Received: by 2002:a17:906:6a8d:b0:a58:308:274c with SMTP id p13-20020a1709066a8d00b00a580308274cmr8356049ejr.21.1714416607512; Mon, 29 Apr 2024 11:50:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714416607; cv=pass; d=google.com; s=arc-20160816; b=VYTHklVhmFCzl9b/UQ9bil1+YrNwicrQTvncVg2C1JHPnuq0jl9WGc2sCQbQsq97wy UAKP2MCKgiRV9iVHew8h/ezuryaayJLNjPKixaoELWrsaeF/MbmtSyc4iCVlA6soKsnx wpeqnFi83fTvkfCGK/2wpErsrzF+438B8dIQlbS0e4E1XKJq8u/NVgfu6GKFlp2FLJf0 rQ8UP3iCuLkZgogMLyzOdYBxoJBYBOl/RcfoWLvTkJsk/HNWh0OohL9ltNKjiRHKiapI SkyjBEDZ9qp7fJv+VWVUrJ89oAGqeBiqj3vjA8CBG2roTIgKydf9RslqWlcDlUbyBjqU aqHA== 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=Cri9wJQIMuiWfyMRh8o3fAPmxNnbcSXNHzgldLoV4IA=; fh=ENRiqPIGd1ZJEQBExcvrIEcb1SmCDAmBPpfPfWo3Lag=; b=O24bAemEx9obz0VuahH3k80WoRWU9xUlxmrfp87RMSbKkTQwl7DdlGL2YwGLqcP+FF YRff9glUr/CZZXISilRxgOhatjD1+Vm+MWiIP0fyd+l90/Vz+l19k29FFXkMQaHghWdm VDj378S9W7yq/ybTPT/L3fpvJs/y6dzXlslt0rEQfyG9Wr1O4BoAnV7P0wI2FRM9c5zI +GrJlGNABLajrCXxZdVWzxrEBGXKf85+vb/0q6V9jnXULRPiwkuu7JYKUrL2RrWwhvHF 5p8jk17KAdyD/TH7TwwVwtRTJh6w2ydfoak4FjBTRhQPdA77nTf7tTO6Z1UWZFti8rzo mX1Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QTutc7YL; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-162858-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162858-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id x5-20020a170906b08500b00a5229a3285csi14695936ejy.360.2024.04.29.11.50.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 11:50:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162858-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QTutc7YL; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-162858-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162858-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 am.mirrors.kernel.org (Postfix) with ESMTPS id D0E6C1F22B26 for ; Mon, 29 Apr 2024 18:50:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 316D813AA3A; Mon, 29 Apr 2024 18:50:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QTutc7YL" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E94028612C for ; Mon, 29 Apr 2024 18:49:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714416600; cv=none; b=pJyvIpNBmpfE3OmYbkKnkgmVcUmX/DF2kMYgD09/V8ijaOI0FX9FdJXb1MW0BKgEWIFrLzJ+KhmX3hZlxE6BcWDtkXuCTdPHgKUDV6QU37awUHFrD8euZ7KFX6wAl1SAGMtx4wM+kpNRsUhKLsu4tORO1HZRn27HQ1BklenjSLY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714416600; c=relaxed/simple; bh=ibS47OzWKnXsrz/clEM8WXST7kYkQMIbx8DG7ht8SUg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AS+J/0Dd1SoUBb0zb79XGurjeUTrEopk6uAP6igKyrZ8OFqmCUZMSYnq0/S6jOwvGfdsqGrPyBSl9uQRLOtPnkBzuBZfuckKO3bsuRyP1LNCBk0QkoIBZSHUhyIn0SUyl6wQXKohSYUjuKCxw7uOPX5/r+4PrsRQPreJ7q3weM0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=QTutc7YL; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714416597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Cri9wJQIMuiWfyMRh8o3fAPmxNnbcSXNHzgldLoV4IA=; b=QTutc7YLNxDFNsau/LrdsHstlafTm1b2N82LLSITfQlh0Hlx3M/phzOzkU7gUm+QrnTu4A VTGaqYVuvA7JSxao5jGAaAsfdAVz5Gh6erxQwgzAho0V2MDo57j/8bjkXB/3ZhNDu658lk CyWK/U7MKg0LJUR4JkRTxXkR8S3OHNc= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-465-dHysN8hhN5iMnRHMyZLOWQ-1; Mon, 29 Apr 2024 14:49:54 -0400 X-MC-Unique: dHysN8hhN5iMnRHMyZLOWQ-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-41c025915a9so9460205e9.3 for ; Mon, 29 Apr 2024 11:49:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714416593; x=1715021393; 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=Cri9wJQIMuiWfyMRh8o3fAPmxNnbcSXNHzgldLoV4IA=; b=oc08RmXuMzt8sXKhIBdQbmxXgZCS09ZVYJDmJVEs/lsBEao8+KCpj3NfI/XSHt9wFU NDAvtLnJ+jrLdXKvCU09+yB3sqeTD2vwbtMMfccVZtAU+PSXXdaL11HCyxeRF3id4c1h jFH38Zez8OGPZxr0z8IEFLDgqjtkrroJXgiWeSvkwhjHerCn13hz03Mevz256mmC77d1 FALJh01Q/Lm3o9fmVtNVIZ9WHUGw7oY7bjg9LmvHVCNoa8EO4fmh7bM0Z0xe9yBhIjM7 UKMuW26kkWxtVBxnKd0Qv6mb/QvQxhM0/bDTf/HKZ4csvT+YKB8DGg5z0HNXI+2rfb+6 Gtbw== X-Forwarded-Encrypted: i=1; AJvYcCVXLv7hnNhJWorBGU1Wbw/w4s1hc6f6V2DB0LaGl2+shinSLCKM2WwgZrSd7x0VAztnIBQMOE2aCkdc8v9JKskGSWRAtZNSO6a1xxID X-Gm-Message-State: AOJu0YwAx9CP6/P3h2siiY/tnRaQWoQrx+h2WV2C7u1kwLzt2NHgpihU U4B02uC02y5aM8RzoUWKmCBnJ9H+SzL70L4Aok/YpgvptCH55zsW5YZ4J0A0mIhKabE1D7cAoSM qLyRfA7hNykipksYyt2BbzC6mVqACbH1jt+btTUqAcWz9u/PjENuvjkZ/L0bRYw== X-Received: by 2002:a05:600c:46ce:b0:41c:2313:da92 with SMTP id q14-20020a05600c46ce00b0041c2313da92mr3567509wmo.4.1714416593041; Mon, 29 Apr 2024 11:49:53 -0700 (PDT) X-Received: by 2002:a05:600c:46ce:b0:41c:2313:da92 with SMTP id q14-20020a05600c46ce00b0041c2313da92mr3567486wmo.4.1714416592241; Mon, 29 Apr 2024 11:49:52 -0700 (PDT) Received: from redhat.com ([2a02:14f:174:67cc:7d0:12ee:4f8f:484f]) by smtp.gmail.com with ESMTPSA id y7-20020a5d6207000000b00346f9071405sm30250181wru.21.2024.04.29.11.49.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 11:49:51 -0700 (PDT) Date: Mon, 29 Apr 2024 14:49:48 -0400 From: "Michael S. Tsirkin" To: Gavin Shan Cc: virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, jasowang@redhat.com, shan.gavin@gmail.com Subject: Re: [PATCH v2 4/4] vhost: Reformat vhost_{get, put}_user() Message-ID: <20240429144908-mutt-send-email-mst@kernel.org> References: <20240429101400.617007-1-gshan@redhat.com> <20240429101400.617007-5-gshan@redhat.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240429101400.617007-5-gshan@redhat.com> On Mon, Apr 29, 2024 at 08:14:00PM +1000, Gavin Shan wrote: > Reformat the macros to use tab as the terminator for each line so > that it looks clean. > > No functional change intended. > > Signed-off-by: Gavin Shan Just messes up history for no real gain. > --- > drivers/vhost/vhost.c | 60 +++++++++++++++++++++---------------------- > 1 file changed, 30 insertions(+), 30 deletions(-) > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index 4ddb9ec2fe46..c1ed5e750521 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -1207,21 +1207,22 @@ static inline void __user *__vhost_get_user(struct vhost_virtqueue *vq, > return __vhost_get_user_slow(vq, addr, size, type); > } > > -#define vhost_put_user(vq, x, ptr) \ > -({ \ > - int ret; \ > - if (!vq->iotlb) { \ > - ret = __put_user(x, ptr); \ > - } else { \ > - __typeof__(ptr) to = \ > +#define vhost_put_user(vq, x, ptr) \ > +({ \ > + int ret; \ > + if (!vq->iotlb) { \ > + ret = __put_user(x, ptr); \ > + } else { \ > + __typeof__(ptr) to = \ > (__typeof__(ptr)) __vhost_get_user(vq, ptr, \ > - sizeof(*ptr), VHOST_ADDR_USED); \ > - if (to != NULL) \ > - ret = __put_user(x, to); \ > - else \ > - ret = -EFAULT; \ > - } \ > - ret; \ > + sizeof(*ptr), \ > + VHOST_ADDR_USED); \ > + if (to != NULL) \ > + ret = __put_user(x, to); \ > + else \ > + ret = -EFAULT; \ > + } \ > + ret; \ > }) > > static inline int vhost_put_avail_event(struct vhost_virtqueue *vq) > @@ -1252,22 +1253,21 @@ static inline int vhost_put_used_idx(struct vhost_virtqueue *vq) > &vq->used->idx); > } > > -#define vhost_get_user(vq, x, ptr, type) \ > -({ \ > - int ret; \ > - if (!vq->iotlb) { \ > - ret = __get_user(x, ptr); \ > - } else { \ > - __typeof__(ptr) from = \ > - (__typeof__(ptr)) __vhost_get_user(vq, ptr, \ > - sizeof(*ptr), \ > - type); \ > - if (from != NULL) \ > - ret = __get_user(x, from); \ > - else \ > - ret = -EFAULT; \ > - } \ > - ret; \ > +#define vhost_get_user(vq, x, ptr, type) \ > +({ \ > + int ret; \ > + if (!vq->iotlb) { \ > + ret = __get_user(x, ptr); \ > + } else { \ > + __typeof__(ptr) from = \ > + (__typeof__(ptr)) __vhost_get_user(vq, ptr, \ > + sizeof(*ptr), type); \ > + if (from != NULL) \ > + ret = __get_user(x, from); \ > + else \ > + ret = -EFAULT; \ > + } \ > + ret; \ > }) > > #define vhost_get_avail(vq, x, ptr) \ > -- > 2.44.0