Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2689722lqt; Mon, 22 Apr 2024 20:25:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWxUs5vbfqmfd0BvaBu9FMchV64wCi0GI00kOPj6OmVg/czwW5b5yK5egIRjhDA3C/dcJKNoeRh00BzJJKkPa/K7Z05FUeC5ODVwKHkDg== X-Google-Smtp-Source: AGHT+IFqNcKkAq4ACPUnc/vV+0+fD+L0GJtO/PcYKZOJ6ETyGGMNry0aRQRbES2DahkK0PoFFRAJ X-Received: by 2002:a05:6512:40a:b0:518:bc7c:4137 with SMTP id u10-20020a056512040a00b00518bc7c4137mr6343776lfk.0.1713842739058; Mon, 22 Apr 2024 20:25:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713842739; cv=pass; d=google.com; s=arc-20160816; b=msjY+1I/coAu9MUqgmH+jEoemLXBKOx8Lj5rMwco2dKQLMCINHeOGlypVZju+2uafz dQ++uT6tOA3a7f9ZAWukTaaKIcmnVE5+LUZA+tBaMBIxkK0abPzHoWcmNeqZqCg3aqIL tirdgvWRh6JYV/QqqG+A30kGOeu9ZmPAMymBHJIBN6uP7vFimWPkdRRDzj7RSOtYytR3 460Fzlo3rwFz5l4MpQYAJu63iO5C/hpSzHsRrn7yKMQbWcCXjtFk/cuf9vTR+aN8kDmT J63gcJbKIsH2TDvLaBtHvFPsChM6HmYsju5NlX614ydqkLc4lbbdEmR6a6kUxzmblPcb cMPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=qtMGrJ3CLLK0RMLaaz/XukLZE22bi0+EJWg0qr8z6dw=; fh=J257D8fwb/+62Vcgdn9VfjMZXjRl80a3qN/eoi5IJQE=; b=J8rPe04WgHSQHhSja2wl39++bqQOST6S1YisVu/IPB3fEkm0LSHiH95O7rSNo5mJEP re9YLCkrDJ3pd0OxIU+Sk2+mG3/cQG5+D3r1L0vCRUhRcvrayQ8d8KMdFIU7wA99uOSh pLin5M3whZqT78dtjzVBlkbuyT2cvSSLy8ZvBJO2d/Q8d6GBpUJBGnxNRpau1fxUTTvm RfsW+buRmIB9td0ciaaNwB414H7ALs840j3KN5xtoOw5hmZk3rJ6bj6uO3i408LZR9it u3WLM9EH7XxFn2zfnB9wywFqk6spHDUsrrtdFhwu0Qlbd0+7I0cwP6b6+EOUTX4r9RDp mxeQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ByNErQpW; 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-154456-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154456-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 hh15-20020a170906a94f00b00a55a8a66b8dsi2982234ejb.932.2024.04.22.20.25.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 20:25:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154456-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=ByNErQpW; 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-154456-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154456-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 C483F1F2234B for ; Tue, 23 Apr 2024 03:25:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A12C1B952; Tue, 23 Apr 2024 03:24:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ByNErQpW" 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 4AEA0219FC for ; Tue, 23 Apr 2024 03:24:31 +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=1713842672; cv=none; b=ED8I76AdBadF6DcaifjI2u3GKTfIqJHQPNOpQvo+DxUOUqigCfF3BQdhzlVCJcXsDhL+H2H1cLtpOP7xsdSIEfrtGu3PlLNe/78rCDPFX3tWrI0e5B8UmjTLMXzQ9afG79mUiOkUatZ9KOraGgwoPA9oe6I45UNqljcnDL9Rzts= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713842672; c=relaxed/simple; bh=5MVVIcDipqgJAk3mCYyyzSHu50ImzAuTrQ9oKbZbq3w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=j2xU5FtZRgY8zieeLaZJlbBXdSKeapFTyfrDdMIGtmbvMmkNtX1hxaLWbVjXpOzjuB8WLqeoyZb+2o0Q1UtJSmbR8qQn/JJ8Lg5DZkhtpSgaoMSb2YVteaU4m/IibIhNlIq4kSex+qTkRV/Vovp0djLHzMCHmz2OkZTth2nP9A0= 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=ByNErQpW; 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=1713842670; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qtMGrJ3CLLK0RMLaaz/XukLZE22bi0+EJWg0qr8z6dw=; b=ByNErQpWLEuR+y/0VexF/g2/zIX6ZqJlWMFPDXAyxYBA1jIUOpp5JvZ26qgTtSLmbm0yeZ XFL0AX5xg3+krFwJN9Be3N0Gxl9LghLvULgiwAZxyh+AFuV1WN+wSYepjNTS4kbG0XZHhT qWgtlGBflcQdiavq3cM6kwrinyVbMak= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-653-NjVT6l0HMT-_YCt94dPB7Q-1; Mon, 22 Apr 2024 23:24:26 -0400 X-MC-Unique: NjVT6l0HMT-_YCt94dPB7Q-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 615C11C068C0; Tue, 23 Apr 2024 03:24:26 +0000 (UTC) Received: from gshan-thinkpadx1nanogen2.remote.csb (unknown [10.64.136.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0FA181BDAA; Tue, 23 Apr 2024 03:24:23 +0000 (UTC) From: Gavin Shan To: virtualization@lists.linux.dev Cc: linux-kernel@vger.kernel.org, mst@redhat.com, jasowang@redhat.com, shan.gavin@gmail.com Subject: [PATCH 4/4] vhost: Reformat vhost_{get, put}_user() Date: Tue, 23 Apr 2024 13:24:07 +1000 Message-ID: <20240423032407.262329-5-gshan@redhat.com> In-Reply-To: <20240423032407.262329-1-gshan@redhat.com> References: <20240423032407.262329-1-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=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 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 --- 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 a3de9325175f..3be19877f9df 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