usb-misc: sisusbvga: Fix coding style: remove assignment from if tests
The file drivers/usb/misc/sisusbvga/sisusb.c had 6 assignments inside if tests. This patch move the assignment outside the test. The changes also fix the remaining 2 lines that were over 80 characters. Signed-off-by: Peter Senna Tschudin <peter.senna@collabora.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
f996c49d4f
Коммит
662bfe7b53
|
@ -1378,7 +1378,8 @@ static int sisusb_clear_vram(struct sisusb_usb_data *sisusb,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* allocate free buffer/urb and clear the buffer */
|
/* allocate free buffer/urb and clear the buffer */
|
||||||
if ((i = sisusb_alloc_outbuf(sisusb)) < 0)
|
i = sisusb_alloc_outbuf(sisusb);
|
||||||
|
if (i < 0)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
memset(sisusb->obuf[i], 0, sisusb->obufsize);
|
memset(sisusb->obuf[i], 0, sisusb->obufsize);
|
||||||
|
@ -3067,7 +3068,8 @@ static int sisusb_probe(struct usb_interface *intf,
|
||||||
|
|
||||||
/* Allocate buffers */
|
/* Allocate buffers */
|
||||||
sisusb->ibufsize = SISUSB_IBUF_SIZE;
|
sisusb->ibufsize = SISUSB_IBUF_SIZE;
|
||||||
if (!(sisusb->ibuf = kmalloc(SISUSB_IBUF_SIZE, GFP_KERNEL))) {
|
sisusb->ibuf = kmalloc(SISUSB_IBUF_SIZE, GFP_KERNEL);
|
||||||
|
if (!sisusb->ibuf) {
|
||||||
dev_err(&sisusb->sisusb_dev->dev, "Failed to allocate memory for input buffer");
|
dev_err(&sisusb->sisusb_dev->dev, "Failed to allocate memory for input buffer");
|
||||||
retval = -ENOMEM;
|
retval = -ENOMEM;
|
||||||
goto error_2;
|
goto error_2;
|
||||||
|
@ -3076,7 +3078,8 @@ static int sisusb_probe(struct usb_interface *intf,
|
||||||
sisusb->numobufs = 0;
|
sisusb->numobufs = 0;
|
||||||
sisusb->obufsize = SISUSB_OBUF_SIZE;
|
sisusb->obufsize = SISUSB_OBUF_SIZE;
|
||||||
for (i = 0; i < NUMOBUFS; i++) {
|
for (i = 0; i < NUMOBUFS; i++) {
|
||||||
if (!(sisusb->obuf[i] = kmalloc(SISUSB_OBUF_SIZE, GFP_KERNEL))) {
|
sisusb->obuf[i] = kmalloc(SISUSB_OBUF_SIZE, GFP_KERNEL);
|
||||||
|
if (!sisusb->obuf[i]) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
dev_err(&sisusb->sisusb_dev->dev, "Failed to allocate memory for output buffer\n");
|
dev_err(&sisusb->sisusb_dev->dev, "Failed to allocate memory for output buffer\n");
|
||||||
retval = -ENOMEM;
|
retval = -ENOMEM;
|
||||||
|
@ -3088,7 +3091,8 @@ static int sisusb_probe(struct usb_interface *intf,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate URBs */
|
/* Allocate URBs */
|
||||||
if (!(sisusb->sisurbin = usb_alloc_urb(0, GFP_KERNEL))) {
|
sisusb->sisurbin = usb_alloc_urb(0, GFP_KERNEL);
|
||||||
|
if (!sisusb->sisurbin) {
|
||||||
dev_err(&sisusb->sisusb_dev->dev, "Failed to allocate URBs\n");
|
dev_err(&sisusb->sisusb_dev->dev, "Failed to allocate URBs\n");
|
||||||
retval = -ENOMEM;
|
retval = -ENOMEM;
|
||||||
goto error_3;
|
goto error_3;
|
||||||
|
@ -3096,7 +3100,8 @@ static int sisusb_probe(struct usb_interface *intf,
|
||||||
sisusb->completein = 1;
|
sisusb->completein = 1;
|
||||||
|
|
||||||
for (i = 0; i < sisusb->numobufs; i++) {
|
for (i = 0; i < sisusb->numobufs; i++) {
|
||||||
if (!(sisusb->sisurbout[i] = usb_alloc_urb(0, GFP_KERNEL))) {
|
sisusb->sisurbout[i] = usb_alloc_urb(0, GFP_KERNEL);
|
||||||
|
if (!sisusb->sisurbout[i]) {
|
||||||
dev_err(&sisusb->sisusb_dev->dev,
|
dev_err(&sisusb->sisusb_dev->dev,
|
||||||
"Failed to allocate URBs\n");
|
"Failed to allocate URBs\n");
|
||||||
retval = -ENOMEM;
|
retval = -ENOMEM;
|
||||||
|
@ -3112,7 +3117,8 @@ static int sisusb_probe(struct usb_interface *intf,
|
||||||
|
|
||||||
#ifdef INCL_SISUSB_CON
|
#ifdef INCL_SISUSB_CON
|
||||||
/* Allocate our SiS_Pr */
|
/* Allocate our SiS_Pr */
|
||||||
if (!(sisusb->SiS_Pr = kmalloc(sizeof(struct SiS_Private), GFP_KERNEL))) {
|
sisusb->SiS_Pr = kmalloc(sizeof(struct SiS_Private), GFP_KERNEL);
|
||||||
|
if (!sisusb->SiS_Pr) {
|
||||||
dev_err(&sisusb->sisusb_dev->dev, "Failed to allocate SiS_Pr\n");
|
dev_err(&sisusb->sisusb_dev->dev, "Failed to allocate SiS_Pr\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Загрузка…
Ссылка в новой задаче