aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-11-11 18:18:19 -0500
committerSteve French <sfrench@us.ibm.com>2005-11-11 18:18:19 -0500
commite89dc9209692293434da45ec31826a55becb91c0 (patch)
tree171ebb84c30467cbff8a5bf8213dbf40e64d84f7 /fs/cifs/cifssmb.c
parent8b94bcb923dff923a5a5b7c6f890702a54cb19cf (diff)
[CIFS] Cleanup sparse warnings for unicode little endian casts
Following Shaggy's suggestion, do a better job on the unicode string handling routines in cifs in specifying that the wchar_t are really little endian widechars (__le16). Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index a53c596e1082..8dbd8c2c0e3b 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1553,7 +1553,7 @@ createSymLinkRetry:
1553 1553
1554 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 1554 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
1555 name_len = 1555 name_len =
1556 cifs_strtoUCS((wchar_t *) pSMB->FileName, fromName, PATH_MAX 1556 cifs_strtoUCS((__le16 *) pSMB->FileName, fromName, PATH_MAX
1557 /* find define for this maxpathcomponent */ 1557 /* find define for this maxpathcomponent */
1558 , nls_codepage); 1558 , nls_codepage);
1559 name_len++; /* trailing null */ 1559 name_len++; /* trailing null */
@@ -1577,7 +1577,7 @@ createSymLinkRetry:
1577 data_offset = (char *) (&pSMB->hdr.Protocol) + offset; 1577 data_offset = (char *) (&pSMB->hdr.Protocol) + offset;
1578 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 1578 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
1579 name_len_target = 1579 name_len_target =
1580 cifs_strtoUCS((wchar_t *) data_offset, toName, PATH_MAX 1580 cifs_strtoUCS((__le16 *) data_offset, toName, PATH_MAX
1581 /* find define for this maxpathcomponent */ 1581 /* find define for this maxpathcomponent */
1582 , nls_codepage); 1582 , nls_codepage);
1583 name_len_target++; /* trailing null */ 1583 name_len_target++; /* trailing null */
@@ -1803,7 +1803,7 @@ querySymLinkRetry:
1803 1803
1804 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 1804 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
1805 name_len = 1805 name_len =
1806 cifs_strtoUCS((wchar_t *) pSMB->FileName, searchName, PATH_MAX 1806 cifs_strtoUCS((__le16 *) pSMB->FileName, searchName, PATH_MAX
1807 /* find define for this maxpathcomponent */ 1807 /* find define for this maxpathcomponent */
1808 , nls_codepage); 1808 , nls_codepage);
1809 name_len++; /* trailing null */ 1809 name_len++; /* trailing null */
@@ -1860,7 +1860,7 @@ querySymLinkRetry:
1860 min_t(const int, buflen,count) / 2); 1860 min_t(const int, buflen,count) / 2);
1861 /* BB FIXME investigate remapping reserved chars here */ 1861 /* BB FIXME investigate remapping reserved chars here */
1862 cifs_strfromUCS_le(symlinkinfo, 1862 cifs_strfromUCS_le(symlinkinfo,
1863 (wchar_t *) ((char *)&pSMBr->hdr.Protocol + 1863 (__le16 *) ((char *)&pSMBr->hdr.Protocol +
1864 data_offset), 1864 data_offset),
1865 name_len, nls_codepage); 1865 name_len, nls_codepage);
1866 } else { 1866 } else {
@@ -1951,7 +1951,7 @@ CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon,
1951 reparse_buf->TargetNameOffset), 1951 reparse_buf->TargetNameOffset),
1952 min(buflen/2, reparse_buf->TargetNameLen / 2)); 1952 min(buflen/2, reparse_buf->TargetNameLen / 2));
1953 cifs_strfromUCS_le(symlinkinfo, 1953 cifs_strfromUCS_le(symlinkinfo,
1954 (wchar_t *) (reparse_buf->LinkNamesBuf + 1954 (__le16 *) (reparse_buf->LinkNamesBuf +
1955 reparse_buf->TargetNameOffset), 1955 reparse_buf->TargetNameOffset),
1956 name_len, nls_codepage); 1956 name_len, nls_codepage);
1957 } else { /* ASCII names */ 1957 } else { /* ASCII names */
@@ -3203,7 +3203,7 @@ getDFSRetry:
3203 temp = ((char *)referrals) + le16_to_cpu(referrals->DfsPathOffset); 3203 temp = ((char *)referrals) + le16_to_cpu(referrals->DfsPathOffset);
3204 if (pSMBr->hdr.Flags2 & SMBFLG2_UNICODE) { 3204 if (pSMBr->hdr.Flags2 & SMBFLG2_UNICODE) {
3205 cifs_strfromUCS_le(*targetUNCs, 3205 cifs_strfromUCS_le(*targetUNCs,
3206 (wchar_t *) temp, name_len, nls_codepage); 3206 (__le16 *) temp, name_len, nls_codepage);
3207 } else { 3207 } else {
3208 strncpy(*targetUNCs,temp,name_len); 3208 strncpy(*targetUNCs,temp,name_len);
3209 } 3209 }