Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752452AbdIVWFW (ORCPT ); Fri, 22 Sep 2017 18:05:22 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:50632 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752083AbdIVWFV (ORCPT ); Fri, 22 Sep 2017 18:05:21 -0400 Subject: Re: [PATCH v4 10/13] xen/pvcalls: implement recvmsg To: Stefano Stabellini , xen-devel@lists.xen.org References: <1505516440-11111-1-git-send-email-sstabellini@kernel.org> <1505516440-11111-10-git-send-email-sstabellini@kernel.org> Cc: linux-kernel@vger.kernel.org, jgross@suse.com, Stefano Stabellini From: Boris Ostrovsky Message-ID: <4521347c-8212-c86e-d164-fc1ffe94e064@oracle.com> Date: Fri, 22 Sep 2017 18:05:00 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1505516440-11111-10-git-send-email-sstabellini@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 550 Lines: 22 > > +static bool pvcalls_front_read_todo(struct sock_mapping *map) > +{ > + struct pvcalls_data_intf *intf = map->active.ring; > + RING_IDX cons, prod; > + int32_t error; > + > + cons = intf->in_cons; > + prod = intf->in_prod; > + error = intf->in_error; > + return (error != 0 || > + pvcalls_queued(prod, cons, > + XEN_FLEX_RING_SIZE(PVCALLS_RING_ORDER)) != 0); Does this routine have to be different from pvcalls_front_write_todo()? They look pretty similar. Can they be merged? (and you don't really need 'error' variable) -boris