From: amit karwar Date: Tue, 16 May 2017 10:01:09 +0000 (+0530) Subject: rsi: define RSI_USB_BUF_SIZE macro X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7bdead7ae944c06ef5916e22254929f583684b4a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git rsi: define RSI_USB_BUF_SIZE macro RSI_USB_BUF_SIZE macro is used instead of hardcoding a buffer size to 4096. Signed-off-by: Amitkumar Karwar Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index cc8deecea8cb..be8487c56945 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -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), diff --git a/drivers/net/wireless/rsi/rsi_usb.h b/drivers/net/wireless/rsi/rsi_usb.h index ebea0c411ead..48c9211fac09 100644 --- a/drivers/net/wireless/rsi/rsi_usb.h +++ b/drivers/net/wireless/rsi/rsi_usb.h @@ -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;