From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751764AbcBWMSO (ORCPT ); Tue, 23 Feb 2016 07:18:14 -0500 Received: from bonobo.tulip.relay.mailchannels.net ([23.83.218.22]:45814 "EHLO bonobo.tulip.relay.mailchannels.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751241AbcBWMSN (ORCPT ); Tue, 23 Feb 2016 07:18:13 -0500 X-Greylist: delayed 1801 seconds by postgrey-1.27 at vger.kernel.org; Tue, 23 Feb 2016 07:18:11 EST X-Sender-Id: totalchoicehosting|x-authuser|billaue@leviathan.tchmachines.com X-Sender-Id: totalchoicehosting|x-authuser|billaue@leviathan.tchmachines.com X-MC-Relay: Neutral X-MailChannels-SenderId: totalchoicehosting|x-authuser|billaue@leviathan.tchmachines.com X-MailChannels-Auth-Id: totalchoicehosting X-MC-Loop-Signature: 1456227755731:1471144971 X-MC-Ingress-Time: 1456227755731 From: Eli Billauer To: arnd@arndb.de, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Eli Billauer Subject: [PATCH] char: xillybus: Fix internal data structure initialization Date: Tue, 23 Feb 2016 13:41:28 +0200 Message-Id: <1456227688-14827-1-git-send-email-eli.billauer@gmail.com> X-Mailer: git-send-email 1.7.2.3 X-AuthUser: billaue@leviathan.tchmachines.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Eli Billauer --- drivers/char/xillybus/xillybus_core.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/char/xillybus/xillybus_core.c b/drivers/char/xillybus/xillybus_core.c index 77d6c12..dcd19f3 100644 --- a/drivers/char/xillybus/xillybus_core.c +++ b/drivers/char/xillybus/xillybus_core.c @@ -509,7 +509,7 @@ static int xilly_setupchannels(struct xilly_endpoint *ep, channel->log2_element_size = ((format > 2) ? 2 : format); - bytebufsize = channel->rd_buf_size = bufsize * + bytebufsize = bufsize * (1 << channel->log2_element_size); buffers = devm_kcalloc(dev, bufnum, @@ -523,6 +523,7 @@ static int xilly_setupchannels(struct xilly_endpoint *ep, if (!is_writebuf) { channel->num_rd_buffers = bufnum; + channel->rd_buf_size = bytebufsize; channel->rd_allow_partial = allowpartial; channel->rd_synchronous = synchronous; channel->rd_exclusive_open = exclusive_open; @@ -533,6 +534,7 @@ static int xilly_setupchannels(struct xilly_endpoint *ep, bufnum, bytebufsize); } else if (channelnum > 0) { channel->num_wr_buffers = bufnum; + channel->wr_buf_size = bytebufsize; channel->seekable = seekable; channel->wr_supports_nonempty = supports_nonempty; -- 1.7.2.3