From patchwork Tue Jul 11 14:27:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitkumar Karwar X-Patchwork-Id: 9834829 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AFCC2602A0 for ; Tue, 11 Jul 2017 14:31:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F96426E56 for ; Tue, 11 Jul 2017 14:31:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 932FF28487; Tue, 11 Jul 2017 14:31:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6921A26E56 for ; Tue, 11 Jul 2017 14:31:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932820AbdGKObF (ORCPT ); Tue, 11 Jul 2017 10:31:05 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:32959 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932729AbdGKObE (ORCPT ); Tue, 11 Jul 2017 10:31:04 -0400 Received: by mail-pf0-f195.google.com with SMTP id e199so165148pfh.0 for ; Tue, 11 Jul 2017 07:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=mRRTjLOMZNJ4IAs/A8xuED1uqUUrFeJS+hpb1gveHi0=; b=ZfWxGGScMnNL9bnq2oxn5t2womuDgwwA3PtO20Ckbz3Ux0UFoHNDywvB/EhybT7zor lGew2JxEKt5mCaLF6AZSlqUxLW2egwHy9dpd/hqrsKsCKbPl12AMWBGwCTcSBVZA07gu OF01sOb771nqTCxxMjFB06dnJO9WI+vY5NhkJcsR9L0/95z9rtEjUPXjD9H2e08VntWu uMcr9Mppt3XjUwNfrwd7I3lC0N9SHWUGSwKi59E3Cdboi7O4Pg9wUdHGpFLhY7ImgjJ+ noP/EgaZyOX9bTmWVF/B5QgotyG+pejD+fl+y3pAN7Qm5Ht6XYln9Ox2CclO4y17uGXt K55Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=mRRTjLOMZNJ4IAs/A8xuED1uqUUrFeJS+hpb1gveHi0=; b=ZRuwsEQYbZz3LNnUZMkRv/gMd+XTvqtGVhBBx1b14qm6I0MEhPF1pfTFc7hGBJcCqC XKAARq48aYEb2a7/ldHvH371mScDzXjT58lvmpJCdioWfHDzT5jXt7wtDDMMVBtsn7V/ c64c+q80lDwfW4Wt/+Xj3KrlrYL5RjjzKA5Z2xPJs9ebee6SEUTVb0co9ogYRj6bRZwn e6nC/ukmSk32kyLnkA7aMDg+ga+1wiEaEjEH7QmQhVPhqNicl2qXvO3CqI2oAFdXEnI7 5lJhmlnp7PuV01B/dIJqV8lmBjKgDjAOmtuEjPqs6X+YbQNzU7dzRT4cuUZMq/ahfg6U 2UIQ== X-Gm-Message-State: AIVw113HU3NtiTeqsQX5r87ktl69cow1Ry1Y3ogkdXAjrTlUwwBRUjQt 9YmKQeR4eFUf0g== X-Received: by 10.84.132.73 with SMTP id 67mr201306ple.53.1499783463678; Tue, 11 Jul 2017 07:31:03 -0700 (PDT) Received: from cpu185.redpinesignals.com ([203.196.161.90]) by smtp.gmail.com with ESMTPSA id x124sm228941pgb.20.2017.07.11.07.31.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Jul 2017 07:31:03 -0700 (PDT) From: Amitkumar Karwar To: Kalle Valo Cc: linux-wireless@vger.kernel.org, Amitkumar Karwar , Prameela Rani Garnepudi Subject: [PATCH 1/3] rsi: use macro for allocating USB buffer Date: Tue, 11 Jul 2017 19:57:51 +0530 Message-Id: <1499783273-15428-1-git-send-email-amitkarwar@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Amitkumar Karwar 4 bytes is fixed size for reading or writing USB register. We will use a macro instead of hardcoding this. Fixes: b97e9b94ad75c ("rsi: Add new host interface operations") Signed-off-by: Amitkumar Karwar --- drivers/net/wireless/rsi/rsi_91x_usb.c | 4 ++-- drivers/net/wireless/rsi/rsi_usb.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index 3febf24..99a520a 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -162,7 +162,7 @@ static int rsi_usb_reg_read(struct usb_device *usbdev, u8 *buf; int status = -ENOMEM; - buf = kmalloc(0x04, GFP_KERNEL); + buf = kmalloc(RSI_USB_CTRL_BUF_SIZE, GFP_KERNEL); if (!buf) return status; @@ -204,7 +204,7 @@ static int rsi_usb_reg_write(struct usb_device *usbdev, u8 *usb_reg_buf; int status = -ENOMEM; - usb_reg_buf = kmalloc(0x04, GFP_KERNEL); + usb_reg_buf = kmalloc(RSI_USB_CTRL_BUF_SIZE, GFP_KERNEL); if (!usb_reg_buf) return status; diff --git a/drivers/net/wireless/rsi/rsi_usb.h b/drivers/net/wireless/rsi/rsi_usb.h index 3babf81..891daea 100644 --- a/drivers/net/wireless/rsi/rsi_usb.h +++ b/drivers/net/wireless/rsi/rsi_usb.h @@ -37,6 +37,7 @@ #define BT_EP 2 #define RSI_USB_BUF_SIZE 4096 +#define RSI_USB_CTRL_BUF_SIZE 0x04 struct rsi_91x_usbdev { struct rsi_thread rx_thread;