Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756574Ab2JWCB4 (ORCPT ); Mon, 22 Oct 2012 22:01:56 -0400 Received: from ozlabs.org ([203.10.76.45]:57115 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756518Ab2JWCA5 convert rfc822-to-8bit (ORCPT ); Mon, 22 Oct 2012 22:00:57 -0400 From: Rusty Russell To: sjur.brandeland@stericsson.com, Amit Shah Cc: "Michael S. Tsirkin" , Linus Walleij , Masami Hiramatsu , Ohad Ben-Cohen , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, sjurbren@gmail.com, Sjur =?utf-8?Q?Br=C3=A6ndeland?= Subject: Re: [PATCHv7 3/4] virtio_console: Merge struct buffer_token into struct port_buffer In-Reply-To: <1350287856-5284-4-git-send-email-sjur.brandeland@stericsson.com> References: <1350287856-5284-1-git-send-email-sjur.brandeland@stericsson.com> <1350287856-5284-4-git-send-email-sjur.brandeland@stericsson.com> User-Agent: Notmuch/0.14 (http://notmuchmail.org) Emacs/23.4.1 (i686-pc-linux-gnu) Date: Tue, 23 Oct 2012 10:49:24 +1030 Message-ID: <87fw56hwfn.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1372 Lines: 43 sjur.brandeland@stericsson.com writes: > From: Sjur Brændeland > > Refactoring the splice functionality by unifying the approach for > sending scatter-lists and regular buffers. This simplifies > buffer handling and reduces code size. Splice will now allocate > a port_buffer and send_buf() and free_buf() can always be used > for any buffer. > > Signed-off-by: Sjur Brændeland This looks sensible; a couple of extra blank lines inserted though. Amit? > @@ -1033,6 +1008,8 @@ static const struct file_operations port_fops = { > static int put_chars(u32 vtermno, const char *buf, int count) > { > struct port *port; > + struct scatterlist sg[1]; > + > > if (unlikely(early_put_chars)) > return early_put_chars(vtermno, buf, count); > @@ -1041,7 +1018,9 @@ static int put_chars(u32 vtermno, const char *buf, int count) > if (!port) > return -EPIPE; > > - return send_buf(port, (void *)buf, count, false); > + sg_init_one(sg, buf, count); > + return __send_to_port(port, sg, 1, count, (void *)buf, false); > + > } > > /* Cheers, Rusty. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/