mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: sfrench@samba.org
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] Fix warnings from CIFS on 2.5.61
Date: 17 Feb 2003 14:49:52 -0800	[thread overview]
Message-ID: <1045522192.12947.90.camel@dell_ss3.pdx.osdl.net> (raw)

This patch gets rid of the following warnings.

fs/cifs/cifssmb.c: In function `CIFSSMBRead':
fs/cifs/cifssmb.c:489: warning: duplicate `const'
fs/cifs/cifssmb.c: In function `CIFSSMBUnixQuerySymLink':
fs/cifs/cifssmb.c:1030: warning: duplicate `const'
fs/cifs/cifssmb.c:1044: warning: duplicate `const'
fs/cifs/cifssmb.c: In function `CIFSSMBQueryReparseLinkInfo':
fs/cifs/cifssmb.c:1120: warning: duplicate `const'

diff -Nru a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
--- a/fs/cifs/cifssmb.c	Mon Feb 17 14:16:15 2003
+++ b/fs/cifs/cifssmb.c	Mon Feb 17 14:16:15 2003
@@ -504,9 +504,10 @@
 	pSMB->OffsetLow = cpu_to_le32(lseek & 0xFFFFFFFF);
 	pSMB->OffsetHigh = cpu_to_le32(lseek >> 32);
 	pSMB->Remaining = 0;
-	pSMB->MaxCount = cpu_to_le16(min(count,
-					 (tcon->ses->server->maxBuf -
-					  MAX_CIFS_HDR_SIZE) & 0xFFFFFF00));
+	pSMB->MaxCount = cpu_to_le16(min_t(const int, 
+					   count,
+					   (tcon->ses->server->maxBuf -
+					    MAX_CIFS_HDR_SIZE) & 0xFFFFFF00));
 	pSMB->MaxCountHigh = 0;
 	pSMB->ByteCount = 0;  /* no need to do le conversion since it is 0 */
 
@@ -1045,9 +1046,10 @@
 								   Protocol +
 								   pSMBr->
 								   DataOffset),
-						      min(buflen,
-							  (int) pSMBr->
-							  DataCount) / 2);
+						      min_t(const int,
+							    buflen,
+							    pSMBr->
+							    DataCount) / 2);
 				cifs_strfromUCS_le(symlinkinfo,
 						   (wchar_t *) ((char *)
 								&pSMBr->
@@ -1059,9 +1061,9 @@
 			} else {
 				strncpy(symlinkinfo,
 					(char *) &pSMBr->hdr.Protocol +
-					pSMBr->DataOffset, min(buflen, (int)
-							       pSMBr->
-							       DataCount));
+					pSMBr->DataOffset, 
+					min_t(const int,
+						buflen,pSMBr->DataCount));
 			}
 			symlinkinfo[buflen] = 0;
 	/* just in case so calling code does not go off the end of buffer */
@@ -1137,7 +1139,8 @@
 				} else { /* ASCII names */
 					strncpy(symlinkinfo,reparse_buf->LinkNamesBuf + 
 						reparse_buf->TargetNameOffset, 
-						min(buflen, (int)reparse_buf->TargetNameLen));
+						min_t(const int,
+						      buflen, reparse_buf->TargetNameLen));
 				}
 			} else {
 				rc = -EIO;




             reply	other threads:[~2003-02-17 22:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-17 22:49 Stephen Hemminger [this message]
2003-02-18 13:07 ` Dave Kleikamp
2003-02-18 19:26 Steven French

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1045522192.12947.90.camel@dell_ss3.pdx.osdl.net \
    --to=shemminger@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfrench@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®