[CIFS] fix casts of unicode strings to match function definition

Signed-off-by: Steve French (sfrench@us.ibm.com)

+29 -29
+1 -1
fs/cifs/cifsproto.h
··· 228 228 const struct nls_table *nls_codepage, 229 229 int remap_special_chars); 230 230 #endif /* CONFIG_CIFS_EXPERIMENTAL */ 231 - extern int cifs_convertUCSpath(char *target, const __u16 *source, int maxlen, 231 + extern int cifs_convertUCSpath(char *target, const __le16 *source, int maxlen, 232 232 const struct nls_table * codepage); 233 233 extern int cifsConvertToUCS(__le16 * target, const char *source, int maxlen, 234 234 const struct nls_table * cp, int mapChars);
+28 -28
fs/cifs/cifssmb.c
··· 567 567 568 568 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 569 569 name_len = 570 - cifsConvertToUCS((__u16 *) pSMB->fileName, fileName, 570 + cifsConvertToUCS((__le16 *) pSMB->fileName, fileName, 571 571 PATH_MAX, nls_codepage, remap); 572 572 name_len++; /* trailing null */ 573 573 name_len *= 2; ··· 665 665 return rc; 666 666 667 667 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 668 - name_len = cifsConvertToUCS((__u16 *) pSMB->DirName, name, 668 + name_len = cifsConvertToUCS((__le16 *) pSMB->DirName, name, 669 669 PATH_MAX, nls_codepage, remap); 670 670 name_len++; /* trailing null */ 671 671 name_len *= 2; ··· 719 719 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 720 720 count = 1; /* account for one byte pad to word boundary */ 721 721 name_len = 722 - cifsConvertToUCS((__u16 *) (pSMB->fileName + 1), 722 + cifsConvertToUCS((__le16 *) (pSMB->fileName + 1), 723 723 fileName, PATH_MAX, nls_codepage, remap); 724 724 name_len++; /* trailing null */ 725 725 name_len *= 2; ··· 1141 1141 1142 1142 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 1143 1143 name_len = 1144 - cifsConvertToUCS((__u16 *) pSMB->OldFileName, fromName, 1144 + cifsConvertToUCS((__le16 *) pSMB->OldFileName, fromName, 1145 1145 PATH_MAX, nls_codepage, remap); 1146 1146 name_len++; /* trailing null */ 1147 1147 name_len *= 2; ··· 1149 1149 /* protocol requires ASCII signature byte on Unicode string */ 1150 1150 pSMB->OldFileName[name_len + 1] = 0x00; 1151 1151 name_len2 = 1152 - cifsConvertToUCS((__u16 *) &pSMB->OldFileName[name_len + 2], 1152 + cifsConvertToUCS((__le16 *) &pSMB->OldFileName[name_len + 2], 1153 1153 toName, PATH_MAX, nls_codepage, remap); 1154 1154 name_len2 += 1 /* trailing null */ + 1 /* Signature word */ ; 1155 1155 name_len2 *= 2; /* convert to bytes */ ··· 1236 1236 /* unicode only call */ 1237 1237 if(target_name == NULL) { 1238 1238 sprintf(dummy_string,"cifs%x",pSMB->hdr.Mid); 1239 - len_of_str = cifsConvertToUCS((__u16 *)rename_info->target_name, 1239 + len_of_str = cifsConvertToUCS((__le16 *)rename_info->target_name, 1240 1240 dummy_string, 24, nls_codepage, remap); 1241 1241 } else { 1242 - len_of_str = cifsConvertToUCS((__u16 *)rename_info->target_name, 1242 + len_of_str = cifsConvertToUCS((__le16 *)rename_info->target_name, 1243 1243 target_name, PATH_MAX, nls_codepage, remap); 1244 1244 } 1245 1245 rename_info->target_name_len = cpu_to_le32(2 * len_of_str); ··· 1296 1296 pSMB->Flags = cpu_to_le16(flags & COPY_TREE); 1297 1297 1298 1298 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 1299 - name_len = cifsConvertToUCS((__u16 *) pSMB->OldFileName, 1299 + name_len = cifsConvertToUCS((__le16 *) pSMB->OldFileName, 1300 1300 fromName, PATH_MAX, nls_codepage, 1301 1301 remap); 1302 1302 name_len++; /* trailing null */ ··· 1304 1304 pSMB->OldFileName[name_len] = 0x04; /* pad */ 1305 1305 /* protocol requires ASCII signature byte on Unicode string */ 1306 1306 pSMB->OldFileName[name_len + 1] = 0x00; 1307 - name_len2 = cifsConvertToUCS((__u16 *)&pSMB->OldFileName[name_len + 2], 1307 + name_len2 = cifsConvertToUCS((__le16 *)&pSMB->OldFileName[name_len + 2], 1308 1308 toName, PATH_MAX, nls_codepage, remap); 1309 1309 name_len2 += 1 /* trailing null */ + 1 /* Signature word */ ; 1310 1310 name_len2 *= 2; /* convert to bytes */ ··· 1453 1453 return rc; 1454 1454 1455 1455 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 1456 - name_len = cifsConvertToUCS((__u16 *) pSMB->FileName, toName, 1456 + name_len = cifsConvertToUCS((__le16 *) pSMB->FileName, toName, 1457 1457 PATH_MAX, nls_codepage, remap); 1458 1458 name_len++; /* trailing null */ 1459 1459 name_len *= 2; ··· 1476 1476 data_offset = (char *) (&pSMB->hdr.Protocol) + offset; 1477 1477 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 1478 1478 name_len_target = 1479 - cifsConvertToUCS((__u16 *) data_offset, fromName, PATH_MAX, 1479 + cifsConvertToUCS((__le16 *) data_offset, fromName, PATH_MAX, 1480 1480 nls_codepage, remap); 1481 1481 name_len_target++; /* trailing null */ 1482 1482 name_len_target *= 2; ··· 1546 1546 1547 1547 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 1548 1548 name_len = 1549 - cifsConvertToUCS((__u16 *) pSMB->OldFileName, fromName, 1549 + cifsConvertToUCS((__le16 *) pSMB->OldFileName, fromName, 1550 1550 PATH_MAX, nls_codepage, remap); 1551 1551 name_len++; /* trailing null */ 1552 1552 name_len *= 2; 1553 1553 pSMB->OldFileName[name_len] = 0; /* pad */ 1554 1554 pSMB->OldFileName[name_len + 1] = 0x04; 1555 1555 name_len2 = 1556 - cifsConvertToUCS((__u16 *)&pSMB->OldFileName[name_len + 2], 1556 + cifsConvertToUCS((__le16 *)&pSMB->OldFileName[name_len + 2], 1557 1557 toName, PATH_MAX, nls_codepage, remap); 1558 1558 name_len2 += 1 /* trailing null */ + 1 /* Signature word */ ; 1559 1559 name_len2 *= 2; /* convert to bytes */ ··· 1939 1939 1940 1940 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 1941 1941 name_len = 1942 - cifsConvertToUCS((__u16 *) pSMB->FileName, searchName, 1942 + cifsConvertToUCS((__le16 *) pSMB->FileName, searchName, 1943 1943 PATH_MAX, nls_codepage, remap); 1944 1944 name_len++; /* trailing null */ 1945 1945 name_len *= 2; ··· 2024 2024 return rc; 2025 2025 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 2026 2026 name_len = 2027 - cifsConvertToUCS((__u16 *) pSMB->FileName, fileName, 2027 + cifsConvertToUCS((__le16 *) pSMB->FileName, fileName, 2028 2028 PATH_MAX, nls_codepage, remap); 2029 2029 name_len++; /* trailing null */ 2030 2030 name_len *= 2; ··· 2188 2188 2189 2189 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 2190 2190 name_len = 2191 - cifsConvertToUCS((__u16 *) pSMB->FileName, searchName, 2191 + cifsConvertToUCS((__le16 *) pSMB->FileName, searchName, 2192 2192 PATH_MAX, nls_codepage, remap); 2193 2193 name_len++; /* trailing null */ 2194 2194 name_len *= 2; ··· 2269 2269 2270 2270 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 2271 2271 name_len = 2272 - cifsConvertToUCS((__u16 *) pSMB->FileName, searchName, 2272 + cifsConvertToUCS((__le16 *) pSMB->FileName, searchName, 2273 2273 PATH_MAX, nls_codepage, remap); 2274 2274 name_len++; /* trailing null */ 2275 2275 name_len *= 2; ··· 2350 2350 2351 2351 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 2352 2352 name_len = 2353 - cifsConvertToUCS((wchar_t *) pSMB->FileName, searchName, PATH_MAX 2353 + cifsConvertToUCS((__le16 *) pSMB->FileName, searchName, PATH_MAX 2354 2354 /* find define for this maxpathcomponent */ 2355 2355 , nls_codepage); 2356 2356 name_len++; /* trailing null */ ··· 2435 2435 2436 2436 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 2437 2437 name_len = 2438 - cifsConvertToUCS((__u16 *) pSMB->FileName,searchName, 2438 + cifsConvertToUCS((__le16 *) pSMB->FileName,searchName, 2439 2439 PATH_MAX, nls_codepage, remap); 2440 2440 /* We can not add the asterik earlier in case 2441 2441 it got remapped to 0xF03A as if it were part of the ··· 2726 2726 2727 2727 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 2728 2728 name_len = 2729 - cifsConvertToUCS((__u16 *) pSMB->FileName, searchName, 2729 + cifsConvertToUCS((__le16 *) pSMB->FileName, searchName, 2730 2730 PATH_MAX,nls_codepage, remap); 2731 2731 name_len++; /* trailing null */ 2732 2732 name_len *= 2; ··· 2837 2837 if (ses->capabilities & CAP_UNICODE) { 2838 2838 pSMB->hdr.Flags2 |= SMBFLG2_UNICODE; 2839 2839 name_len = 2840 - cifsConvertToUCS((__u16 *) pSMB->RequestFileName, 2840 + cifsConvertToUCS((__le16 *) pSMB->RequestFileName, 2841 2841 searchName, PATH_MAX, nls_codepage, remap); 2842 2842 name_len++; /* trailing null */ 2843 2843 name_len *= 2; ··· 3369 3369 3370 3370 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 3371 3371 name_len = 3372 - cifsConvertToUCS((__u16 *) pSMB->FileName, fileName, 3372 + cifsConvertToUCS((__le16 *) pSMB->FileName, fileName, 3373 3373 PATH_MAX, nls_codepage, remap); 3374 3374 name_len++; /* trailing null */ 3375 3375 name_len *= 2; ··· 3627 3627 3628 3628 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 3629 3629 name_len = 3630 - cifsConvertToUCS((__u16 *) pSMB->FileName, fileName, 3630 + cifsConvertToUCS((__le16 *) pSMB->FileName, fileName, 3631 3631 PATH_MAX, nls_codepage, remap); 3632 3632 name_len++; /* trailing null */ 3633 3633 name_len *= 2; ··· 3708 3708 3709 3709 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 3710 3710 name_len = 3711 - ConvertToUCS((wchar_t *) pSMB->fileName, fileName, 3711 + ConvertToUCS((__le16 *) pSMB->fileName, fileName, 3712 3712 PATH_MAX, nls_codepage); 3713 3713 name_len++; /* trailing null */ 3714 3714 name_len *= 2; ··· 3759 3759 3760 3760 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 3761 3761 name_len = 3762 - cifsConvertToUCS((__u16 *) pSMB->FileName, fileName, 3762 + cifsConvertToUCS((__le16 *) pSMB->FileName, fileName, 3763 3763 PATH_MAX, nls_codepage, remap); 3764 3764 name_len++; /* trailing null */ 3765 3765 name_len *= 2; ··· 3904 3904 3905 3905 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 3906 3906 name_len = 3907 - cifsConvertToUCS((wchar_t *) pSMB->FileName, searchName, 3907 + cifsConvertToUCS((__le16 *) pSMB->FileName, searchName, 3908 3908 PATH_MAX, nls_codepage, remap); 3909 3909 name_len++; /* trailing null */ 3910 3910 name_len *= 2; ··· 4047 4047 4048 4048 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 4049 4049 name_len = 4050 - cifsConvertToUCS((__u16 *) pSMB->FileName, searchName, 4050 + cifsConvertToUCS((__le16 *) pSMB->FileName, searchName, 4051 4051 PATH_MAX, nls_codepage, remap); 4052 4052 name_len++; /* trailing null */ 4053 4053 name_len *= 2; ··· 4194 4194 4195 4195 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 4196 4196 name_len = 4197 - cifsConvertToUCS((__u16 *) pSMB->FileName, fileName, 4197 + cifsConvertToUCS((__le16 *) pSMB->FileName, fileName, 4198 4198 PATH_MAX, nls_codepage, remap); 4199 4199 name_len++; /* trailing null */ 4200 4200 name_len *= 2;