rsi: define RSI_USB_BUF_SIZE macro
authoramit karwar <amitkarwar@gmail.com>
Tue, 16 May 2017 10:01:09 +0000 (15:31 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 24 May 2017 13:37:49 +0000 (16:37 +0300)
RSI_USB_BUF_SIZE macro is used instead of hardcoding a buffer
size to 4096.

Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/rsi/rsi_91x_usb.c
drivers/net/wireless/rsi/rsi_usb.h

index cc8deecea8cbeeebbd7bc9216d7698a175ba8cae..be8487c569452ceec8e8152a4f6bdc02119148ca 100644 (file)
@@ -293,12 +293,12 @@ int rsi_usb_write_register_multiple(struct rsi_hw *adapter,
        u8 transfer;
        int status = 0;
 
-       buf = kzalloc(4096, GFP_KERNEL);
+       buf = kzalloc(RSI_USB_BUF_SIZE, GFP_KERNEL);
        if (!buf)
                return -ENOMEM;
 
        while (count) {
-               transfer = (u8)(min_t(u32, count, 4096));
+               transfer = (u8)(min_t(u32, count, RSI_USB_BUF_SIZE));
                memcpy(buf, data, transfer);
                status = usb_control_msg(dev->usbdev,
                                         usb_sndctrlpipe(dev->usbdev, 0),
index ebea0c411ead43f4411aa17445a6c003cb923aa1..48c9211fac09ab59e91953bacd4b36c13d67339e 100644 (file)
@@ -35,6 +35,8 @@
 #define MGMT_EP                      1
 #define DATA_EP                      2
 
+#define RSI_USB_BUF_SIZE            4096
+
 struct rsi_91x_usbdev {
        struct rsi_thread rx_thread;
        u8 endpoint;