From patchwork Wed Feb 11 05:03:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Rorvick X-Patchwork-Id: 5810251 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 540A39F30C for ; Wed, 11 Feb 2015 05:04:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7C0DD2021A for ; Wed, 11 Feb 2015 05:04:02 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1100120218 for ; Wed, 11 Feb 2015 05:04:01 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 79F872617BB; Wed, 11 Feb 2015 06:03:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id A4A0226059C; Wed, 11 Feb 2015 06:03:49 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9775E261515; Wed, 11 Feb 2015 06:03:47 +0100 (CET) Received: from mail-ie0-f179.google.com (mail-ie0-f179.google.com [209.85.223.179]) by alsa0.perex.cz (Postfix) with ESMTP id A6D8926056D for ; Wed, 11 Feb 2015 06:03:40 +0100 (CET) Received: by ierx19 with SMTP id x19so1583798ier.3 for ; Tue, 10 Feb 2015 21:03:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=f2kBp+QJKsZJGWa6hPc1uMIRCHxNM/WoWduIHellc1A=; b=baHb3n2iAD+Ue+Ofr/lDwIYIFInOsrl2EwryglcTbO7y79NEX4tDWD8gO7n7vJOtfY oKQ4kIqFrVsg2y7U1oA8p4h3uYqIYSKIHPUGXjCGEy5SBjcwRZespG5andNHcw+RH33C Zuau9/tnaqfpzsuZjxvOnr5R9vJclqjI5t0W9G1bIqOTXxXjhwcSXAuj7+shAhFl4LUr qasM5w2dbpfAZlpb8MIffZAhmgHKidQO66kAqcBnnNU/XGIKtc2eOzX0Ds7yULElnusR h3dz52/F5JpHO/0foHwSXecYCMhokbbXBB/k5m71E9BTZzcDmG9oHwdNgVwWpPZCQILY DfLA== X-Received: by 10.43.67.3 with SMTP id xs3mr1203902icb.39.1423631017838; Tue, 10 Feb 2015 21:03:37 -0800 (PST) Received: from localhost.localdomain.com ([99.135.164.179]) by mx.google.com with ESMTPSA id qd2sm9291297igc.22.2015.02.10.21.03.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Feb 2015 21:03:37 -0800 (PST) From: Chris Rorvick To: Takashi Iwai Date: Tue, 10 Feb 2015 23:03:12 -0600 Message-Id: <1423630997-25464-2-git-send-email-chris@rorvick.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1423630997-25464-1-git-send-email-chris@rorvick.com> References: <1423630997-25464-1-git-send-email-chris@rorvick.com> Cc: Stefan Hajnoczi , alsa-devel@alsa-project.org, Chris Rorvick , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH 1/6] ALSA: line6: Improve line6_read/write_data() interfaces X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Use explicit types to reflect the range of valid values. Signed-off-by: Chris Rorvick --- sound/usb/line6/driver.c | 10 +++++----- sound/usb/line6/driver.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c index 1e58e92..aac1e35 100644 --- a/sound/usb/line6/driver.c +++ b/sound/usb/line6/driver.c @@ -299,8 +299,8 @@ static void line6_data_received(struct urb *urb) /* Read data from device. */ -int line6_read_data(struct usb_line6 *line6, int address, void *data, - size_t datalen) +int line6_read_data(struct usb_line6 *line6, u16 address, void *data, + u8 datalen) { struct usb_device *usbdev = line6->usbdev; int ret; @@ -309,7 +309,7 @@ int line6_read_data(struct usb_line6 *line6, int address, void *data, /* query the serial number: */ ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, - (datalen << 8) | 0x21, address, + ((u16) datalen << 8) | 0x21, address, NULL, 0, LINE6_TIMEOUT * HZ); if (ret < 0) { @@ -357,8 +357,8 @@ EXPORT_SYMBOL_GPL(line6_read_data); /* Write data to device. */ -int line6_write_data(struct usb_line6 *line6, int address, void *data, - size_t datalen) +int line6_write_data(struct usb_line6 *line6, u16 address, void *data, + u16 datalen) { struct usb_device *usbdev = line6->usbdev; int ret; diff --git a/sound/usb/line6/driver.h b/sound/usb/line6/driver.h index 8247a6b..603bdc4 100644 --- a/sound/usb/line6/driver.h +++ b/sound/usb/line6/driver.h @@ -147,8 +147,8 @@ struct usb_line6 { extern char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1, int code2, int size); -extern int line6_read_data(struct usb_line6 *line6, int address, void *data, - size_t datalen); +extern int line6_read_data(struct usb_line6 *line6, u16 address, void *data, + u8 datalen); extern int line6_read_serial_number(struct usb_line6 *line6, int *serial_number); extern int line6_send_raw_message_async(struct usb_line6 *line6, @@ -161,8 +161,8 @@ extern void line6_start_timer(struct timer_list *timer, unsigned int msecs, void (*function)(unsigned long), unsigned long data); extern int line6_version_request_async(struct usb_line6 *line6); -extern int line6_write_data(struct usb_line6 *line6, int address, void *data, - size_t datalen); +extern int line6_write_data(struct usb_line6 *line6, u16 address, void *data, + u16 datalen); int line6_probe(struct usb_interface *interface, const struct usb_device_id *id,