Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: gadget: f_mass_storage: code style clean ups

This commit is purely style clean ups.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Michal Nazarewicz and committed by
Greg Kroah-Hartman
b73af61e 00cb636e

+249 -211
+248 -210
drivers/usb/gadget/f_mass_storage.c
··· 37 37 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 38 */ 39 39 40 - 41 40 /* 42 41 * The Mass Storage Function acts as a USB Mass Storage device, 43 42 * appearing to the host as a disk drive or as a CD-ROM drive. In ··· 184 185 * <http://www.usb.org/developers/devclass_docs/usbmass-ufi10.pdf>. 185 186 */ 186 187 187 - 188 188 /* 189 189 * Driver Design 190 190 * ··· 273 275 /* #define VERBOSE_DEBUG */ 274 276 /* #define DUMP_MSGS */ 275 277 276 - 277 278 #include <linux/blkdev.h> 278 279 #include <linux/completion.h> 279 280 #include <linux/dcache.h> ··· 297 300 #include "gadget_chips.h" 298 301 299 302 300 - 301 303 /*------------------------------------------------------------------------*/ 302 304 303 305 #define FSG_DRIVER_DESC "Mass Storage Function" 304 306 #define FSG_DRIVER_VERSION "2009/09/11" 305 307 306 308 static const char fsg_string_interface[] = "Mass Storage"; 307 - 308 309 309 310 #define FSG_NO_INTR_EP 1 310 311 #define FSG_NO_DEVICE_STRINGS 1 ··· 319 324 320 325 /* FSF callback functions */ 321 326 struct fsg_operations { 322 - /* Callback function to call when thread exits. If no 327 + /* 328 + * Callback function to call when thread exits. If no 323 329 * callback is set or it returns value lower then zero MSF 324 330 * will force eject all LUNs it operates on (including those 325 331 * marked as non-removable or with prevent_medium_removal flag 326 - * set). */ 332 + * set). 333 + */ 327 334 int (*thread_exits)(struct fsg_common *common); 328 335 329 - /* Called prior to ejection. Negative return means error, 336 + /* 337 + * Called prior to ejection. Negative return means error, 330 338 * zero means to continue with ejection, positive means not to 331 - * eject. */ 339 + * eject. 340 + */ 332 341 int (*pre_eject)(struct fsg_common *common, 333 342 struct fsg_lun *lun, int num); 334 - /* Called after ejection. Negative return means error, zero 335 - * or positive is just a success. */ 343 + /* 344 + * Called after ejection. Negative return means error, zero 345 + * or positive is just a success. 346 + */ 336 347 int (*post_eject)(struct fsg_common *common, 337 348 struct fsg_lun *lun, int num); 338 349 }; 339 - 340 350 341 351 /* Data shared by all the FSG instances. */ 342 352 struct fsg_common { ··· 398 398 /* Gadget's private data. */ 399 399 void *private_data; 400 400 401 - /* Vendor (8 chars), product (16 chars), release (4 402 - * hexadecimal digits) and NUL byte */ 401 + /* 402 + * Vendor (8 chars), product (16 chars), release (4 403 + * hexadecimal digits) and NUL byte 404 + */ 403 405 char inquiry_string[8 + 16 + 4 + 1]; 404 406 405 407 struct kref ref; 406 408 }; 407 - 408 409 409 410 struct fsg_config { 410 411 unsigned nluns; ··· 432 431 char can_stall; 433 432 }; 434 433 435 - 436 434 struct fsg_dev { 437 435 struct usb_function function; 438 436 struct usb_gadget *gadget; /* Copy of cdev->gadget */ ··· 449 449 struct usb_ep *bulk_out; 450 450 }; 451 451 452 - 453 452 static inline int __fsg_is_set(struct fsg_common *common, 454 453 const char *func, unsigned line) 455 454 { ··· 461 462 462 463 #define fsg_is_set(common) likely(__fsg_is_set(common, __func__, __LINE__)) 463 464 464 - 465 465 static inline struct fsg_dev *fsg_from_func(struct usb_function *f) 466 466 { 467 467 return container_of(f, struct fsg_dev, function); 468 468 } 469 - 470 469 471 470 typedef void (*fsg_routine_t)(struct fsg_dev *); 472 471 ··· 475 478 476 479 /* Make bulk-out requests be divisible by the maxpacket size */ 477 480 static void set_bulk_out_req_length(struct fsg_common *common, 478 - struct fsg_buffhd *bh, unsigned int length) 481 + struct fsg_buffhd *bh, unsigned int length) 479 482 { 480 483 unsigned int rem; 481 484 ··· 485 488 length += common->bulk_out_maxpacket - rem; 486 489 bh->outreq->length = length; 487 490 } 491 + 488 492 489 493 /*-------------------------------------------------------------------------*/ 490 494 ··· 517 519 wake_up_process(common->thread_task); 518 520 } 519 521 520 - 521 522 static void raise_exception(struct fsg_common *common, enum fsg_state new_state) 522 523 { 523 524 unsigned long flags; 524 525 525 - /* Do nothing if a higher-priority exception is already in progress. 526 + /* 527 + * Do nothing if a higher-priority exception is already in progress. 526 528 * If a lower-or-equal priority exception is in progress, preempt it 527 - * and notify the main thread by sending it a signal. */ 529 + * and notify the main thread by sending it a signal. 530 + */ 528 531 spin_lock_irqsave(&common->lock, flags); 529 532 if (common->state <= new_state) { 530 533 common->exception_req_tag = common->ep0_req_tag; ··· 554 555 return rc; 555 556 } 556 557 558 + 557 559 /*-------------------------------------------------------------------------*/ 558 560 559 - /* Bulk and interrupt endpoint completion handlers. 560 - * These always run in_irq. */ 561 + /* Completion handlers. These always run in_irq. */ 561 562 562 563 static void bulk_in_complete(struct usb_ep *ep, struct usb_request *req) 563 564 { ··· 566 567 567 568 if (req->status || req->actual != req->length) 568 569 DBG(common, "%s --> %d, %u/%u\n", __func__, 569 - req->status, req->actual, req->length); 570 + req->status, req->actual, req->length); 570 571 if (req->status == -ECONNRESET) /* Request was cancelled */ 571 572 usb_ep_fifo_flush(ep); 572 573 ··· 587 588 dump_msg(common, "bulk-out", req->buf, req->actual); 588 589 if (req->status || req->actual != bh->bulk_out_intended_length) 589 590 DBG(common, "%s --> %d, %u/%u\n", __func__, 590 - req->status, req->actual, 591 - bh->bulk_out_intended_length); 591 + req->status, req->actual, bh->bulk_out_intended_length); 592 592 if (req->status == -ECONNRESET) /* Request was cancelled */ 593 593 usb_ep_fifo_flush(ep); 594 594 ··· 600 602 spin_unlock(&common->lock); 601 603 } 602 604 603 - 604 - /*-------------------------------------------------------------------------*/ 605 - 606 - /* Ep0 class-specific handlers. These always run in_irq. */ 607 - 608 605 static int fsg_setup(struct usb_function *f, 609 - const struct usb_ctrlrequest *ctrl) 606 + const struct usb_ctrlrequest *ctrl) 610 607 { 611 608 struct fsg_dev *fsg = fsg_from_func(f); 612 609 struct usb_request *req = fsg->common->ep0req; ··· 621 628 if (w_index != fsg->interface_number || w_value != 0) 622 629 return -EDOM; 623 630 624 - /* Raise an exception to stop the current operation 625 - * and reinitialize our state. */ 631 + /* 632 + * Raise an exception to stop the current operation 633 + * and reinitialize our state. 634 + */ 626 635 DBG(fsg, "bulk reset request\n"); 627 636 raise_exception(fsg->common, FSG_STATE_RESET); 628 637 return DELAYED_STATUS; ··· 636 641 if (w_index != fsg->interface_number || w_value != 0) 637 642 return -EDOM; 638 643 VDBG(fsg, "get max LUN\n"); 639 - *(u8 *) req->buf = fsg->common->nluns - 1; 644 + *(u8 *)req->buf = fsg->common->nluns - 1; 640 645 641 646 /* Respond with data/status */ 642 647 req->length = min((u16)1, w_length); ··· 644 649 } 645 650 646 651 VDBG(fsg, 647 - "unknown class-specific control req " 648 - "%02x.%02x v%04x i%04x l%u\n", 652 + "unknown class-specific control req %02x.%02x v%04x i%04x l%u\n", 649 653 ctrl->bRequestType, ctrl->bRequest, 650 654 le16_to_cpu(ctrl->wValue), w_index, w_length); 651 655 return -EOPNOTSUPP; ··· 655 661 656 662 /* All the following routines run in process context */ 657 663 658 - 659 664 /* Use this for bulk or interrupt transfers, not ep0 */ 660 665 static void start_transfer(struct fsg_dev *fsg, struct usb_ep *ep, 661 - struct usb_request *req, int *pbusy, 662 - enum fsg_buffer_state *state) 666 + struct usb_request *req, int *pbusy, 667 + enum fsg_buffer_state *state) 663 668 { 664 669 int rc; 665 670 ··· 676 683 677 684 /* We can't do much more than wait for a reset */ 678 685 679 - /* Note: currently the net2280 driver fails zero-length 680 - * submissions if DMA is enabled. */ 681 - if (rc != -ESHUTDOWN && !(rc == -EOPNOTSUPP && 682 - req->length == 0)) 686 + /* 687 + * Note: currently the net2280 driver fails zero-length 688 + * submissions if DMA is enabled. 689 + */ 690 + if (rc != -ESHUTDOWN && 691 + !(rc == -EOPNOTSUPP && req->length == 0)) 683 692 WARNING(fsg, "error in submission: %s --> %d\n", 684 - ep->name, rc); 693 + ep->name, rc); 685 694 } 686 695 } 687 696 ··· 741 746 unsigned int partial_page; 742 747 ssize_t nread; 743 748 744 - /* Get the starting Logical Block Address and check that it's 745 - * not too big */ 749 + /* 750 + * Get the starting Logical Block Address and check that it's 751 + * not too big. 752 + */ 746 753 if (common->cmnd[0] == READ_6) 747 754 lba = get_unaligned_be24(&common->cmnd[1]); 748 755 else { 749 756 lba = get_unaligned_be32(&common->cmnd[2]); 750 757 751 - /* We allow DPO (Disable Page Out = don't save data in the 758 + /* 759 + * We allow DPO (Disable Page Out = don't save data in the 752 760 * cache) and FUA (Force Unit Access = don't read from the 753 - * cache), but we don't implement them. */ 761 + * cache), but we don't implement them. 762 + */ 754 763 if ((common->cmnd[1] & ~0x18) != 0) { 755 764 curlun->sense_data = SS_INVALID_FIELD_IN_CDB; 756 765 return -EINVAL; ··· 772 773 return -EIO; /* No default reply */ 773 774 774 775 for (;;) { 775 - 776 - /* Figure out how much we need to read: 776 + /* 777 + * Figure out how much we need to read: 777 778 * Try to read the remaining amount. 778 779 * But don't read more than the buffer size. 779 780 * And don't try to read past the end of the file. 780 781 * Finally, if we're not at a page boundary, don't read past 781 782 * the next page. 782 783 * If this means reading 0 then we were asked to read past 783 - * the end of file. */ 784 + * the end of file. 785 + */ 784 786 amount = min(amount_left, FSG_BUFLEN); 785 - amount = min((loff_t) amount, 786 - curlun->file_length - file_offset); 787 + amount = min((loff_t)amount, 788 + curlun->file_length - file_offset); 787 789 partial_page = file_offset & (PAGE_CACHE_SIZE - 1); 788 790 if (partial_page > 0) 789 - amount = min(amount, (unsigned int) PAGE_CACHE_SIZE - 790 - partial_page); 791 + amount = min(amount, (unsigned int)PAGE_CACHE_SIZE - 792 + partial_page); 791 793 792 794 /* Wait for the next buffer to become available */ 793 795 bh = common->next_buffhd_to_fill; ··· 798 798 return rc; 799 799 } 800 800 801 - /* If we were asked to read past the end of file, 802 - * end with an empty buffer. */ 801 + /* 802 + * If we were asked to read past the end of file, 803 + * end with an empty buffer. 804 + */ 803 805 if (amount == 0) { 804 806 curlun->sense_data = 805 807 SS_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE; ··· 815 813 /* Perform the read */ 816 814 file_offset_tmp = file_offset; 817 815 nread = vfs_read(curlun->filp, 818 - (char __user *) bh->buf, 819 - amount, &file_offset_tmp); 816 + (char __user *)bh->buf, 817 + amount, &file_offset_tmp); 820 818 VLDBG(curlun, "file read %u @ %llu -> %d\n", amount, 821 - (unsigned long long) file_offset, 822 - (int) nread); 819 + (unsigned long long)file_offset, (int)nread); 823 820 if (signal_pending(current)) 824 821 return -EINTR; 825 822 826 823 if (nread < 0) { 827 - LDBG(curlun, "error in file read: %d\n", 828 - (int) nread); 824 + LDBG(curlun, "error in file read: %d\n", (int)nread); 829 825 nread = 0; 830 826 } else if (nread < amount) { 831 827 LDBG(curlun, "partial file read: %d/%u\n", 832 - (int) nread, amount); 828 + (int)nread, amount); 833 829 nread -= (nread & 511); /* Round down to a block */ 834 830 } 835 831 file_offset += nread; ··· 882 882 curlun->filp->f_flags &= ~O_SYNC; /* Default is not to wait */ 883 883 spin_unlock(&curlun->filp->f_lock); 884 884 885 - /* Get the starting Logical Block Address and check that it's 886 - * not too big */ 885 + /* 886 + * Get the starting Logical Block Address and check that it's 887 + * not too big 888 + */ 887 889 if (common->cmnd[0] == WRITE_6) 888 890 lba = get_unaligned_be24(&common->cmnd[1]); 889 891 else { 890 892 lba = get_unaligned_be32(&common->cmnd[2]); 891 893 892 - /* We allow DPO (Disable Page Out = don't save data in the 894 + /* 895 + * We allow DPO (Disable Page Out = don't save data in the 893 896 * cache) and FUA (Force Unit Access = write directly to the 894 897 * medium). We don't implement DPO; we implement FUA by 895 - * performing synchronous output. */ 898 + * performing synchronous output. 899 + */ 896 900 if (common->cmnd[1] & ~0x18) { 897 901 curlun->sense_data = SS_INVALID_FIELD_IN_CDB; 898 902 return -EINVAL; ··· 924 920 bh = common->next_buffhd_to_fill; 925 921 if (bh->state == BUF_STATE_EMPTY && get_some_more) { 926 922 927 - /* Figure out how much we want to get: 923 + /* 924 + * Figure out how much we want to get: 928 925 * Try to get the remaining amount. 929 926 * But don't get more than the buffer size. 930 927 * And don't try to go past the end of the file. ··· 933 928 * don't go past the next page. 934 929 * If this means getting 0, then we were asked 935 930 * to write past the end of file. 936 - * Finally, round down to a block boundary. */ 931 + * Finally, round down to a block boundary. 932 + */ 937 933 amount = min(amount_left_to_req, FSG_BUFLEN); 938 - amount = min((loff_t) amount, curlun->file_length - 939 - usb_offset); 934 + amount = min((loff_t)amount, 935 + curlun->file_length - usb_offset); 940 936 partial_page = usb_offset & (PAGE_CACHE_SIZE - 1); 941 937 if (partial_page > 0) 942 938 amount = min(amount, 943 - (unsigned int) PAGE_CACHE_SIZE - partial_page); 939 + (unsigned int)PAGE_CACHE_SIZE - partial_page); 944 940 945 941 if (amount == 0) { 946 942 get_some_more = 0; ··· 951 945 curlun->info_valid = 1; 952 946 continue; 953 947 } 954 - amount -= (amount & 511); 948 + amount -= amount & 511; 955 949 if (amount == 0) { 956 950 957 - /* Why were we were asked to transfer a 958 - * partial block? */ 951 + /* 952 + * Why were we were asked to transfer a 953 + * partial block? 954 + */ 959 955 get_some_more = 0; 960 956 continue; 961 957 } ··· 969 961 if (amount_left_to_req == 0) 970 962 get_some_more = 0; 971 963 972 - /* amount is always divisible by 512, hence by 973 - * the bulk-out maxpacket size */ 964 + /* 965 + * amount is always divisible by 512, hence by 966 + * the bulk-out maxpacket size 967 + */ 974 968 bh->outreq->length = amount; 975 969 bh->bulk_out_intended_length = amount; 976 970 bh->outreq->short_not_ok = 1; 977 971 if (!start_out_transfer(common, bh)) 978 - /* Don't know what to do if 979 - * common->fsg is NULL */ 972 + /* Dunno what to do if common->fsg is NULL */ 980 973 return -EIO; 981 974 common->next_buffhd_to_fill = bh->next; 982 975 continue; ··· 1003 994 amount = bh->outreq->actual; 1004 995 if (curlun->file_length - file_offset < amount) { 1005 996 LERROR(curlun, 1006 - "write %u @ %llu beyond end %llu\n", 1007 - amount, (unsigned long long) file_offset, 1008 - (unsigned long long) curlun->file_length); 997 + "write %u @ %llu beyond end %llu\n", 998 + amount, (unsigned long long)file_offset, 999 + (unsigned long long)curlun->file_length); 1009 1000 amount = curlun->file_length - file_offset; 1010 1001 } 1011 1002 1012 1003 /* Perform the write */ 1013 1004 file_offset_tmp = file_offset; 1014 1005 nwritten = vfs_write(curlun->filp, 1015 - (char __user *) bh->buf, 1016 - amount, &file_offset_tmp); 1006 + (char __user *)bh->buf, 1007 + amount, &file_offset_tmp); 1017 1008 VLDBG(curlun, "file write %u @ %llu -> %d\n", amount, 1018 - (unsigned long long) file_offset, 1019 - (int) nwritten); 1009 + (unsigned long long)file_offset, (int)nwritten); 1020 1010 if (signal_pending(current)) 1021 1011 return -EINTR; /* Interrupted! */ 1022 1012 1023 1013 if (nwritten < 0) { 1024 1014 LDBG(curlun, "error in file write: %d\n", 1025 - (int) nwritten); 1015 + (int)nwritten); 1026 1016 nwritten = 0; 1027 1017 } else if (nwritten < amount) { 1028 1018 LDBG(curlun, "partial file write: %d/%u\n", 1029 - (int) nwritten, amount); 1019 + (int)nwritten, amount); 1030 1020 nwritten -= (nwritten & 511); 1031 1021 /* Round down to a block */ 1032 1022 } ··· 1098 1090 unsigned int amount; 1099 1091 ssize_t nread; 1100 1092 1101 - /* Get the starting Logical Block Address and check that it's 1102 - * not too big */ 1093 + /* 1094 + * Get the starting Logical Block Address and check that it's 1095 + * not too big. 1096 + */ 1103 1097 lba = get_unaligned_be32(&common->cmnd[2]); 1104 1098 if (lba >= curlun->num_sectors) { 1105 1099 curlun->sense_data = SS_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE; 1106 1100 return -EINVAL; 1107 1101 } 1108 1102 1109 - /* We allow DPO (Disable Page Out = don't save data in the 1110 - * cache) but we don't implement it. */ 1103 + /* 1104 + * We allow DPO (Disable Page Out = don't save data in the 1105 + * cache) but we don't implement it. 1106 + */ 1111 1107 if (common->cmnd[1] & ~0x10) { 1112 1108 curlun->sense_data = SS_INVALID_FIELD_IN_CDB; 1113 1109 return -EINVAL; ··· 1136 1124 1137 1125 /* Just try to read the requested blocks */ 1138 1126 while (amount_left > 0) { 1139 - 1140 - /* Figure out how much we need to read: 1127 + /* 1128 + * Figure out how much we need to read: 1141 1129 * Try to read the remaining amount, but not more than 1142 1130 * the buffer size. 1143 1131 * And don't try to read past the end of the file. 1144 1132 * If this means reading 0 then we were asked to read 1145 - * past the end of file. */ 1133 + * past the end of file. 1134 + */ 1146 1135 amount = min(amount_left, FSG_BUFLEN); 1147 - amount = min((loff_t) amount, 1148 - curlun->file_length - file_offset); 1136 + amount = min((loff_t)amount, 1137 + curlun->file_length - file_offset); 1149 1138 if (amount == 0) { 1150 1139 curlun->sense_data = 1151 1140 SS_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE; ··· 1167 1154 return -EINTR; 1168 1155 1169 1156 if (nread < 0) { 1170 - LDBG(curlun, "error in file verify: %d\n", 1171 - (int) nread); 1157 + LDBG(curlun, "error in file verify: %d\n", (int)nread); 1172 1158 nread = 0; 1173 1159 } else if (nread < amount) { 1174 1160 LDBG(curlun, "partial file verify: %d/%u\n", 1175 - (int) nread, amount); 1176 - nread -= (nread & 511); /* Round down to a sector */ 1161 + (int)nread, amount); 1162 + nread -= nread & 511; /* Round down to a sector */ 1177 1163 } 1178 1164 if (nread == 0) { 1179 1165 curlun->sense_data = SS_UNRECOVERED_READ_ERROR; ··· 1213 1201 memcpy(buf + 8, common->inquiry_string, sizeof common->inquiry_string); 1214 1202 return 36; 1215 1203 } 1216 - 1217 1204 1218 1205 static int do_request_sense(struct fsg_common *common, struct fsg_buffhd *bh) 1219 1206 { ··· 1267 1256 return 18; 1268 1257 } 1269 1258 1270 - 1271 1259 static int do_read_capacity(struct fsg_common *common, struct fsg_buffhd *bh) 1272 1260 { 1273 1261 struct fsg_lun *curlun = common->curlun; 1274 1262 u32 lba = get_unaligned_be32(&common->cmnd[2]); 1275 1263 int pmi = common->cmnd[8]; 1276 - u8 *buf = (u8 *) bh->buf; 1264 + u8 *buf = (u8 *)bh->buf; 1277 1265 1278 1266 /* Check the PMI and LBA fields */ 1279 1267 if (pmi > 1 || (pmi == 0 && lba != 0)) { ··· 1286 1276 return 8; 1287 1277 } 1288 1278 1289 - 1290 1279 static int do_read_header(struct fsg_common *common, struct fsg_buffhd *bh) 1291 1280 { 1292 1281 struct fsg_lun *curlun = common->curlun; 1293 1282 int msf = common->cmnd[1] & 0x02; 1294 1283 u32 lba = get_unaligned_be32(&common->cmnd[2]); 1295 - u8 *buf = (u8 *) bh->buf; 1284 + u8 *buf = (u8 *)bh->buf; 1296 1285 1297 1286 if (common->cmnd[1] & ~0x02) { /* Mask away MSF */ 1298 1287 curlun->sense_data = SS_INVALID_FIELD_IN_CDB; ··· 1308 1299 return 8; 1309 1300 } 1310 1301 1311 - 1312 1302 static int do_read_toc(struct fsg_common *common, struct fsg_buffhd *bh) 1313 1303 { 1314 1304 struct fsg_lun *curlun = common->curlun; 1315 1305 int msf = common->cmnd[1] & 0x02; 1316 1306 int start_track = common->cmnd[6]; 1317 - u8 *buf = (u8 *) bh->buf; 1307 + u8 *buf = (u8 *)bh->buf; 1318 1308 1319 1309 if ((common->cmnd[1] & ~0x02) != 0 || /* Mask away MSF */ 1320 1310 start_track > 1) { ··· 1334 1326 store_cdrom_address(&buf[16], msf, curlun->num_sectors); 1335 1327 return 20; 1336 1328 } 1337 - 1338 1329 1339 1330 static int do_mode_sense(struct fsg_common *common, struct fsg_buffhd *bh) 1340 1331 { ··· 1359 1352 changeable_values = (pc == 1); 1360 1353 all_pages = (page_code == 0x3f); 1361 1354 1362 - /* Write the mode parameter header. Fixed values are: default 1355 + /* 1356 + * Write the mode parameter header. Fixed values are: default 1363 1357 * medium type, no cache control (DPOFUA), and no block descriptors. 1364 1358 * The only variable value is the WriteProtect bit. We will fill in 1365 - * the mode data length later. */ 1359 + * the mode data length later. 1360 + */ 1366 1361 memset(buf, 0, 8); 1367 1362 if (mscmnd == MODE_SENSE) { 1368 1363 buf[2] = (curlun->ro ? 0x80 : 0x00); /* WP, DPOFUA */ ··· 1378 1369 1379 1370 /* No block descriptors */ 1380 1371 1381 - /* The mode pages, in numerical order. The only page we support 1382 - * is the Caching page. */ 1372 + /* 1373 + * The mode pages, in numerical order. The only page we support 1374 + * is the Caching page. 1375 + */ 1383 1376 if (page_code == 0x08 || all_pages) { 1384 1377 valid_page = 1; 1385 1378 buf[0] = 0x08; /* Page code */ ··· 1403 1392 buf += 12; 1404 1393 } 1405 1394 1406 - /* Check that a valid page was requested and the mode data length 1407 - * isn't too long. */ 1395 + /* 1396 + * Check that a valid page was requested and the mode data length 1397 + * isn't too long. 1398 + */ 1408 1399 len = buf - buf0; 1409 1400 if (!valid_page || len > limit) { 1410 1401 curlun->sense_data = SS_INVALID_FIELD_IN_CDB; ··· 1420 1407 put_unaligned_be16(len - 2, buf0); 1421 1408 return len; 1422 1409 } 1423 - 1424 1410 1425 1411 static int do_start_stop(struct fsg_common *common) 1426 1412 { ··· 1440 1428 loej = common->cmnd[4] & 0x02; 1441 1429 start = common->cmnd[4] & 0x01; 1442 1430 1443 - /* Our emulation doesn't support mounting; the medium is 1444 - * available for use as soon as it is loaded. */ 1431 + /* 1432 + * Our emulation doesn't support mounting; the medium is 1433 + * available for use as soon as it is loaded. 1434 + */ 1445 1435 if (start) { 1446 1436 if (!fsg_lun_is_open(curlun)) { 1447 1437 curlun->sense_data = SS_MEDIUM_NOT_PRESENT; ··· 1484 1470 : 0; 1485 1471 } 1486 1472 1487 - 1488 1473 static int do_prevent_allow(struct fsg_common *common) 1489 1474 { 1490 1475 struct fsg_lun *curlun = common->curlun; ··· 1508 1495 return 0; 1509 1496 } 1510 1497 1511 - 1512 1498 static int do_read_format_capacities(struct fsg_common *common, 1513 1499 struct fsg_buffhd *bh) 1514 1500 { ··· 1524 1512 buf[4] = 0x02; /* Current capacity */ 1525 1513 return 12; 1526 1514 } 1527 - 1528 1515 1529 1516 static int do_mode_select(struct fsg_common *common, struct fsg_buffhd *bh) 1530 1517 { ··· 1606 1595 bh->inreq->length = nsend; 1607 1596 bh->inreq->zero = 0; 1608 1597 start_transfer(fsg, fsg->bulk_in, bh->inreq, 1609 - &bh->inreq_busy, &bh->state); 1598 + &bh->inreq_busy, &bh->state); 1610 1599 bh = fsg->common->next_buffhd_to_fill = bh->next; 1611 1600 fsg->common->usb_amount_left -= nsend; 1612 1601 nkeep = 0; ··· 1632 1621 1633 1622 /* A short packet or an error ends everything */ 1634 1623 if (bh->outreq->actual != bh->outreq->length || 1635 - bh->outreq->status != 0) { 1624 + bh->outreq->status != 0) { 1636 1625 raise_exception(common, 1637 1626 FSG_STATE_ABORT_BULK_OUT); 1638 1627 return -EINTR; ··· 1646 1635 && common->usb_amount_left > 0) { 1647 1636 amount = min(common->usb_amount_left, FSG_BUFLEN); 1648 1637 1649 - /* amount is always divisible by 512, hence by 1650 - * the bulk-out maxpacket size */ 1638 + /* 1639 + * amount is always divisible by 512, hence by 1640 + * the bulk-out maxpacket size. 1641 + */ 1651 1642 bh->outreq->length = amount; 1652 1643 bh->bulk_out_intended_length = amount; 1653 1644 bh->outreq->short_not_ok = 1; 1654 1645 if (!start_out_transfer(common, bh)) 1655 - /* Don't know what to do if 1656 - * common->fsg is NULL */ 1646 + /* Dunno what to do if common->fsg is NULL */ 1657 1647 return -EIO; 1658 1648 common->next_buffhd_to_fill = bh->next; 1659 1649 common->usb_amount_left -= amount; ··· 1669 1657 return 0; 1670 1658 } 1671 1659 1672 - 1673 1660 static int finish_reply(struct fsg_common *common) 1674 1661 { 1675 1662 struct fsg_buffhd *bh = common->next_buffhd_to_fill; ··· 1678 1667 case DATA_DIR_NONE: 1679 1668 break; /* Nothing to send */ 1680 1669 1681 - /* If we don't know whether the host wants to read or write, 1670 + /* 1671 + * If we don't know whether the host wants to read or write, 1682 1672 * this must be CB or CBI with an unknown command. We mustn't 1683 1673 * try to send or receive any data. So stall both bulk pipes 1684 - * if we can and wait for a reset. */ 1674 + * if we can and wait for a reset. 1675 + */ 1685 1676 case DATA_DIR_UNKNOWN: 1686 1677 if (!common->can_stall) { 1687 1678 /* Nothing */ ··· 1708 1695 return -EIO; 1709 1696 common->next_buffhd_to_fill = bh->next; 1710 1697 1711 - /* For Bulk-only, if we're allowed to stall then send the 1698 + /* 1699 + * For Bulk-only, if we're allowed to stall then send the 1712 1700 * short packet and halt the bulk-in endpoint. If we can't 1713 - * stall, pad out the remaining data with 0's. */ 1701 + * stall, pad out the remaining data with 0's. 1702 + */ 1714 1703 } else if (common->can_stall) { 1715 1704 bh->inreq->zero = 1; 1716 1705 if (!start_in_transfer(common, bh)) ··· 1730 1715 } 1731 1716 break; 1732 1717 1733 - /* We have processed all we want from the data the host has sent. 1734 - * There may still be outstanding bulk-out requests. */ 1718 + /* 1719 + * We have processed all we want from the data the host has sent. 1720 + * There may still be outstanding bulk-out requests. 1721 + */ 1735 1722 case DATA_DIR_FROM_HOST: 1736 1723 if (common->residue == 0) { 1737 1724 /* Nothing to receive */ ··· 1743 1726 raise_exception(common, FSG_STATE_ABORT_BULK_OUT); 1744 1727 rc = -EINTR; 1745 1728 1746 - /* We haven't processed all the incoming data. Even though 1729 + /* 1730 + * We haven't processed all the incoming data. Even though 1747 1731 * we may be allowed to stall, doing so would cause a race. 1748 1732 * The controller may already have ACK'ed all the remaining 1749 1733 * bulk-out packets, in which case the host wouldn't see a 1750 1734 * STALL. Not realizing the endpoint was halted, it wouldn't 1751 - * clear the halt -- leading to problems later on. */ 1735 + * clear the halt -- leading to problems later on. 1736 + */ 1752 1737 #if 0 1753 1738 } else if (common->can_stall) { 1754 1739 if (fsg_is_set(common)) ··· 1760 1741 rc = -EINTR; 1761 1742 #endif 1762 1743 1763 - /* We can't stall. Read in the excess data and throw it 1764 - * all away. */ 1744 + /* 1745 + * We can't stall. Read in the excess data and throw it 1746 + * all away. 1747 + */ 1765 1748 } else { 1766 1749 rc = throw_away_data(common); 1767 1750 } ··· 1771 1750 } 1772 1751 return rc; 1773 1752 } 1774 - 1775 1753 1776 1754 static int send_status(struct fsg_common *common) 1777 1755 { ··· 1830 1810 1831 1811 /*-------------------------------------------------------------------------*/ 1832 1812 1833 - /* Check whether the command is properly formed and whether its data size 1834 - * and direction agree with the values we already have. */ 1813 + /* 1814 + * Check whether the command is properly formed and whether its data size 1815 + * and direction agree with the values we already have. 1816 + */ 1835 1817 static int check_command(struct fsg_common *common, int cmnd_size, 1836 - enum data_direction data_dir, unsigned int mask, 1837 - int needs_medium, const char *name) 1818 + enum data_direction data_dir, unsigned int mask, 1819 + int needs_medium, const char *name) 1838 1820 { 1839 1821 int i; 1840 1822 int lun = common->cmnd[1] >> 5; ··· 1847 1825 hdlen[0] = 0; 1848 1826 if (common->data_dir != DATA_DIR_UNKNOWN) 1849 1827 sprintf(hdlen, ", H%c=%u", dirletter[(int) common->data_dir], 1850 - common->data_size); 1828 + common->data_size); 1851 1829 VDBG(common, "SCSI command: %s; Dc=%d, D%c=%u; Hc=%d%s\n", 1852 1830 name, cmnd_size, dirletter[(int) data_dir], 1853 1831 common->data_size_from_cmnd, common->cmnd_size, hdlen); 1854 1832 1855 - /* We can't reply at all until we know the correct data direction 1856 - * and size. */ 1833 + /* 1834 + * We can't reply at all until we know the correct data direction 1835 + * and size. 1836 + */ 1857 1837 if (common->data_size_from_cmnd == 0) 1858 1838 data_dir = DATA_DIR_NONE; 1859 1839 if (common->data_size < common->data_size_from_cmnd) { 1860 - /* Host data size < Device data size is a phase error. 1840 + /* 1841 + * Host data size < Device data size is a phase error. 1861 1842 * Carry out the command, but only transfer as much as 1862 - * we are allowed. */ 1843 + * we are allowed. 1844 + */ 1863 1845 common->data_size_from_cmnd = common->data_size; 1864 1846 common->phase_error = 1; 1865 1847 } ··· 1871 1845 common->usb_amount_left = common->data_size; 1872 1846 1873 1847 /* Conflicting data directions is a phase error */ 1874 - if (common->data_dir != data_dir 1875 - && common->data_size_from_cmnd > 0) { 1848 + if (common->data_dir != data_dir && common->data_size_from_cmnd > 0) { 1876 1849 common->phase_error = 1; 1877 1850 return -EINVAL; 1878 1851 } ··· 1879 1854 /* Verify the length of the command itself */ 1880 1855 if (cmnd_size != common->cmnd_size) { 1881 1856 1882 - /* Special case workaround: There are plenty of buggy SCSI 1857 + /* 1858 + * Special case workaround: There are plenty of buggy SCSI 1883 1859 * implementations. Many have issues with cbw->Length 1884 1860 * field passing a wrong command size. For those cases we 1885 1861 * always try to work around the problem by using the length ··· 1922 1896 curlun = NULL; 1923 1897 common->bad_lun_okay = 0; 1924 1898 1925 - /* INQUIRY and REQUEST SENSE commands are explicitly allowed 1926 - * to use unsupported LUNs; all others may not. */ 1899 + /* 1900 + * INQUIRY and REQUEST SENSE commands are explicitly allowed 1901 + * to use unsupported LUNs; all others may not. 1902 + */ 1927 1903 if (common->cmnd[0] != INQUIRY && 1928 1904 common->cmnd[0] != REQUEST_SENSE) { 1929 1905 DBG(common, "unsupported LUN %d\n", common->lun); ··· 1933 1905 } 1934 1906 } 1935 1907 1936 - /* If a unit attention condition exists, only INQUIRY and 1937 - * REQUEST SENSE commands are allowed; anything else must fail. */ 1908 + /* 1909 + * If a unit attention condition exists, only INQUIRY and 1910 + * REQUEST SENSE commands are allowed; anything else must fail. 1911 + */ 1938 1912 if (curlun && curlun->unit_attention_data != SS_NO_SENSE && 1939 - common->cmnd[0] != INQUIRY && 1940 - common->cmnd[0] != REQUEST_SENSE) { 1913 + common->cmnd[0] != INQUIRY && 1914 + common->cmnd[0] != REQUEST_SENSE) { 1941 1915 curlun->sense_data = curlun->unit_attention_data; 1942 1916 curlun->unit_attention_data = SS_NO_SENSE; 1943 1917 return -EINVAL; ··· 1964 1934 1965 1935 return 0; 1966 1936 } 1967 - 1968 1937 1969 1938 static int do_scsi_command(struct fsg_common *common) 1970 1939 { ··· 2152 2123 "TEST UNIT READY"); 2153 2124 break; 2154 2125 2155 - /* Although optional, this command is used by MS-Windows. We 2156 - * support a minimal version: BytChk must be 0. */ 2126 + /* 2127 + * Although optional, this command is used by MS-Windows. We 2128 + * support a minimal version: BytChk must be 0. 2129 + */ 2157 2130 case VERIFY: 2158 2131 common->data_size_from_cmnd = 0; 2159 2132 reply = check_command(common, 10, DATA_DIR_NONE, ··· 2195 2164 reply = do_write(common); 2196 2165 break; 2197 2166 2198 - /* Some mandatory commands that we recognize but don't implement. 2167 + /* 2168 + * Some mandatory commands that we recognize but don't implement. 2199 2169 * They don't mean much in this setting. It's left as an exercise 2200 2170 * for anyone interested to implement RESERVE and RELEASE in terms 2201 - * of Posix locks. */ 2171 + * of Posix locks. 2172 + */ 2202 2173 case FORMAT_UNIT: 2203 2174 case RELEASE: 2204 2175 case RESERVE: ··· 2228 2195 if (reply == -EINVAL) 2229 2196 reply = 0; /* Error reply length */ 2230 2197 if (reply >= 0 && common->data_dir == DATA_DIR_TO_HOST) { 2231 - reply = min((u32) reply, common->data_size_from_cmnd); 2198 + reply = min((u32)reply, common->data_size_from_cmnd); 2232 2199 bh->inreq->length = reply; 2233 2200 bh->state = BUF_STATE_FULL; 2234 2201 common->residue -= reply; ··· 2258 2225 req->actual, 2259 2226 le32_to_cpu(cbw->Signature)); 2260 2227 2261 - /* The Bulk-only spec says we MUST stall the IN endpoint 2228 + /* 2229 + * The Bulk-only spec says we MUST stall the IN endpoint 2262 2230 * (6.6.1), so it's unavoidable. It also says we must 2263 2231 * retain this state until the next reset, but there's 2264 2232 * no way to tell the controller driver it should ignore ··· 2267 2233 * 2268 2234 * We aren't required to halt the OUT endpoint; instead 2269 2235 * we can simply accept and discard any data received 2270 - * until the next reset. */ 2236 + * until the next reset. 2237 + */ 2271 2238 wedge_bulk_in_endpoint(fsg); 2272 2239 set_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags); 2273 2240 return -EINVAL; ··· 2281 2246 "cmdlen %u\n", 2282 2247 cbw->Lun, cbw->Flags, cbw->Length); 2283 2248 2284 - /* We can do anything we want here, so let's stall the 2285 - * bulk pipes if we are allowed to. */ 2249 + /* 2250 + * We can do anything we want here, so let's stall the 2251 + * bulk pipes if we are allowed to. 2252 + */ 2286 2253 if (common->can_stall) { 2287 2254 fsg_set_halt(fsg, fsg->bulk_out); 2288 2255 halt_bulk_in_endpoint(fsg); ··· 2307 2270 return 0; 2308 2271 } 2309 2272 2310 - 2311 2273 static int get_next_command(struct fsg_common *common) 2312 2274 { 2313 2275 struct fsg_buffhd *bh; ··· 2327 2291 /* Don't know what to do if common->fsg is NULL */ 2328 2292 return -EIO; 2329 2293 2330 - /* We will drain the buffer in software, which means we 2294 + /* 2295 + * We will drain the buffer in software, which means we 2331 2296 * can reuse it for the next filling. No need to advance 2332 - * next_buffhd_to_fill. */ 2297 + * next_buffhd_to_fill. 2298 + */ 2333 2299 2334 2300 /* Wait for the CBW to arrive */ 2335 2301 while (bh->state != BUF_STATE_FULL) { ··· 2462 2424 2463 2425 /****************************** ALT CONFIGS ******************************/ 2464 2426 2465 - 2466 2427 static int fsg_set_alt(struct usb_function *f, unsigned intf, unsigned alt) 2467 2428 { 2468 2429 struct fsg_dev *fsg = fsg_from_func(f); ··· 2489 2452 struct fsg_lun *curlun; 2490 2453 unsigned int exception_req_tag; 2491 2454 2492 - /* Clear the existing signals. Anything but SIGUSR1 is converted 2493 - * into a high-priority EXIT exception. */ 2455 + /* 2456 + * Clear the existing signals. Anything but SIGUSR1 is converted 2457 + * into a high-priority EXIT exception. 2458 + */ 2494 2459 for (;;) { 2495 2460 int sig = 2496 2461 dequeue_signal_lock(current, &current->blocked, &info); ··· 2536 2497 usb_ep_fifo_flush(common->fsg->bulk_out); 2537 2498 } 2538 2499 2539 - /* Reset the I/O buffer states and pointers, the SCSI 2540 - * state, and the exception. Then invoke the handler. */ 2500 + /* 2501 + * Reset the I/O buffer states and pointers, the SCSI 2502 + * state, and the exception. Then invoke the handler. 2503 + */ 2541 2504 spin_lock_irq(&common->lock); 2542 2505 2543 2506 for (i = 0; i < FSG_NUM_BUFFERS; ++i) { ··· 2577 2536 break; 2578 2537 2579 2538 case FSG_STATE_RESET: 2580 - /* In case we were forced against our will to halt a 2539 + /* 2540 + * In case we were forced against our will to halt a 2581 2541 * bulk endpoint, clear the halt now. (The SuperH UDC 2582 - * requires this.) */ 2542 + * requires this.) 2543 + */ 2583 2544 if (!fsg_is_set(common)) 2584 2545 break; 2585 2546 if (test_and_clear_bit(IGNORE_BULK_OUT, ··· 2591 2548 if (common->ep0_req_tag == exception_req_tag) 2592 2549 ep0_queue(common); /* Complete the status stage */ 2593 2550 2594 - /* Technically this should go here, but it would only be 2551 + /* 2552 + * Technically this should go here, but it would only be 2595 2553 * a waste of time. Ditto for the INTERFACE_CHANGE and 2596 - * CONFIG_CHANGE cases. */ 2554 + * CONFIG_CHANGE cases. 2555 + */ 2597 2556 /* for (i = 0; i < common->nluns; ++i) */ 2598 2557 /* common->luns[i].unit_attention_data = */ 2599 2558 /* SS_RESET_OCCURRED; */ ··· 2630 2585 { 2631 2586 struct fsg_common *common = common_; 2632 2587 2633 - /* Allow the thread to be killed by a signal, but set the signal mask 2634 - * to block everything but INT, TERM, KILL, and USR1. */ 2588 + /* 2589 + * Allow the thread to be killed by a signal, but set the signal mask 2590 + * to block everything but INT, TERM, KILL, and USR1. 2591 + */ 2635 2592 allow_signal(SIGINT); 2636 2593 allow_signal(SIGTERM); 2637 2594 allow_signal(SIGKILL); ··· 2642 2595 /* Allow the thread to be frozen */ 2643 2596 set_freezable(); 2644 2597 2645 - /* Arrange for userspace references to be interpreted as kernel 2598 + /* 2599 + * Arrange for userspace references to be interpreted as kernel 2646 2600 * pointers. That way we can pass a kernel pointer to a routine 2647 - * that expects a __user pointer and it will work okay. */ 2601 + * that expects a __user pointer and it will work okay. 2602 + */ 2648 2603 set_fs(get_ds()); 2649 2604 2650 2605 /* The main loop */ ··· 2738 2689 kref_put(&common->ref, fsg_common_release); 2739 2690 } 2740 2691 2741 - 2742 2692 static struct fsg_common *fsg_common_init(struct fsg_common *common, 2743 2693 struct usb_composite_dev *cdev, 2744 2694 struct fsg_config *cfg) ··· 2783 2735 fsg_intf_desc.iInterface = rc; 2784 2736 } 2785 2737 2786 - /* Create the LUNs, open their backing files, and register the 2787 - * LUN devices in sysfs. */ 2738 + /* 2739 + * Create the LUNs, open their backing files, and register the 2740 + * LUN devices in sysfs. 2741 + */ 2788 2742 curlun = kzalloc(nluns * sizeof *curlun, GFP_KERNEL); 2789 2743 if (unlikely(!curlun)) { 2790 2744 rc = -ENOMEM; ··· 2840 2790 } 2841 2791 common->nluns = nluns; 2842 2792 2843 - 2844 2793 /* Data buffers cyclic list */ 2845 2794 bh = common->buffhds; 2846 2795 i = FSG_NUM_BUFFERS; ··· 2855 2806 } 2856 2807 } while (--i); 2857 2808 bh->next = common->buffhds; 2858 - 2859 2809 2860 2810 /* Prepare inquiryString */ 2861 2811 if (cfg->release != 0xffff) { ··· 2877 2829 : "File-CD Gadget"), 2878 2830 i); 2879 2831 2880 - 2881 - /* Some peripheral controllers are known not to be able to 2832 + /* 2833 + * Some peripheral controllers are known not to be able to 2882 2834 * halt bulk endpoints correctly. If one of them is present, 2883 2835 * disable stalls. 2884 2836 */ 2885 2837 common->can_stall = cfg->can_stall && 2886 2838 !(gadget_is_at91(common->gadget)); 2887 2839 2888 - 2889 2840 spin_lock_init(&common->lock); 2890 2841 kref_init(&common->ref); 2891 - 2892 2842 2893 2843 /* Tell the thread to start working */ 2894 2844 common->thread_task = ··· 2898 2852 } 2899 2853 init_completion(&common->thread_notifier); 2900 2854 init_waitqueue_head(&common->fsg_wait); 2901 - 2902 2855 2903 2856 /* Information */ 2904 2857 INFO(common, FSG_DRIVER_DESC ", version: " FSG_DRIVER_VERSION "\n"); ··· 2931 2886 2932 2887 return common; 2933 2888 2934 - 2935 2889 error_luns: 2936 2890 common->nluns = i + 1; 2937 2891 error_release: 2938 2892 common->state = FSG_STATE_TERMINATED; /* The thread is dead */ 2939 - /* Call fsg_common_release() directly, ref might be not 2940 - * initialised */ 2893 + /* Call fsg_common_release() directly, ref might be not initialised. */ 2941 2894 fsg_common_release(&common->ref); 2942 2895 return ERR_PTR(rc); 2943 2896 } 2944 - 2945 2897 2946 2898 static void fsg_common_release(struct kref *ref) 2947 2899 { ··· 2981 2939 2982 2940 /*-------------------------------------------------------------------------*/ 2983 2941 2984 - 2985 2942 static void fsg_unbind(struct usb_configuration *c, struct usb_function *f) 2986 2943 { 2987 2944 struct fsg_dev *fsg = fsg_from_func(f); ··· 2999 2958 usb_free_descriptors(fsg->function.hs_descriptors); 3000 2959 kfree(fsg); 3001 2960 } 3002 - 3003 2961 3004 2962 static int fsg_bind(struct usb_configuration *c, struct usb_function *f) 3005 2963 { ··· 3082 3042 fsg->function.disable = fsg_disable; 3083 3043 3084 3044 fsg->common = common; 3085 - /* Our caller holds a reference to common structure so we 3045 + /* 3046 + * Our caller holds a reference to common structure so we 3086 3047 * don't have to be worry about it being freed until we return 3087 3048 * from this function. So instead of incrementing counter now 3088 3049 * and decrement in error recovery we increment it only when 3089 - * call to usb_add_function() was successful. */ 3050 + * call to usb_add_function() was successful. 3051 + */ 3090 3052 3091 3053 rc = usb_add_function(c, &fsg->function); 3092 3054 if (unlikely(rc)) ··· 3099 3057 } 3100 3058 3101 3059 static inline int __deprecated __maybe_unused 3102 - fsg_add(struct usb_composite_dev *cdev, 3103 - struct usb_configuration *c, 3060 + fsg_add(struct usb_composite_dev *cdev, struct usb_configuration *c, 3104 3061 struct fsg_common *common) 3105 3062 { 3106 3063 return fsg_bind_config(cdev, c, common); ··· 3107 3066 3108 3067 3109 3068 /************************* Module parameters *************************/ 3110 - 3111 3069 3112 3070 struct fsg_module_parameters { 3113 3071 char *file[FSG_MAX_LUNS]; ··· 3120 3080 unsigned int luns; /* nluns */ 3121 3081 int stall; /* can_stall */ 3122 3082 }; 3123 - 3124 3083 3125 3084 #define _FSG_MODULE_PARAM_ARRAY(prefix, params, name, type, desc) \ 3126 3085 module_param_array_named(prefix ## name, params.name, type, \ ··· 3147 3108 "number of LUNs"); \ 3148 3109 _FSG_MODULE_PARAM(prefix, params, stall, bool, \ 3149 3110 "false to prevent bulk stalls") 3150 - 3151 3111 3152 3112 static void 3153 3113 fsg_config_from_params(struct fsg_config *cfg,
+1 -1
drivers/usb/gadget/mass_storage.c
··· 102 102 }; 103 103 FSG_MODULE_PARAMETERS(/* no prefix */, mod_data); 104 104 105 - static unsigned long msg_registered = 0; 105 + static unsigned long msg_registered; 106 106 static void msg_cleanup(void); 107 107 108 108 static int msg_thread_exits(struct fsg_common *common)