From patchwork Wed Jan 5 16:53:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "M. Mohan Kumar" X-Patchwork-Id: 453921 X-Patchwork-Delegate: ericvh@gmail.com Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p05GsHqe023250 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 5 Jan 2011 16:54:38 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1PaWcW-00047a-SC; Wed, 05 Jan 2011 16:53:56 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1PaWcV-00047U-LR for v9fs-developer@lists.sourceforge.net; Wed, 05 Jan 2011 16:53:55 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of in.ibm.com designates 202.81.31.146 as permitted sender) client-ip=202.81.31.146; envelope-from=mohan@in.ibm.com; helo=e23smtp04.au.ibm.com; Received: from e23smtp04.au.ibm.com ([202.81.31.146]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.72) id 1PaWcU-0000HF-F9 for v9fs-developer@lists.sourceforge.net; Wed, 05 Jan 2011 16:53:55 +0000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247]) by e23smtp04.au.ibm.com (8.14.4/8.13.1) with ESMTP id p05GmY4Q009501 for ; Thu, 6 Jan 2011 03:48:34 +1100 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p05Grk7u2183204 for ; Thu, 6 Jan 2011 03:53:47 +1100 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p05GrkOq025328 for ; Thu, 6 Jan 2011 03:53:46 +1100 Received: from oc3510633643.ibm.com ([9.77.212.129]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p05GrjJ1025312; Thu, 6 Jan 2011 03:53:45 +1100 From: "M. Mohan Kumar" To: "v9fs-developer" , "linux-fsdevel@vger.kernel.org" , LKML Date: Wed, 5 Jan 2011 22:23:43 +0530 Message-Id: <1294246423-8454-1-git-send-email-mohan@in.ibm.com> X-Mailer: git-send-email 1.7.3.4 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1PaWcU-0000HF-F9 Subject: [V9fs-developer] [PATCH] net/9p: Use proper data types X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 05 Jan 2011 16:54:39 +0000 (UTC) diff --git a/net/9p/protocol.c b/net/9p/protocol.c index c5180fd..2902eb1 100644 --- a/net/9p/protocol.c +++ b/net/9p/protocol.c @@ -234,14 +234,14 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt, } break; case 'D':{ - int32_t *count = va_arg(ap, int32_t *); + uint32_t *count = va_arg(ap, int32_t *); void **data = va_arg(ap, void **); errcode = p9pdu_readf(pdu, proto_version, "d", count); if (!errcode) { *count = - min_t(int32_t, *count, + min_t(uint32_t, *count, pdu->size - pdu->offset); *data = &pdu->sdata[pdu->offset]; } @@ -404,9 +404,9 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt, break; case 's':{ const char *sptr = va_arg(ap, const char *); - int16_t len = 0; + uint16_t len = 0; if (sptr) - len = min_t(int16_t, strlen(sptr), + len = min_t(uint16_t, strlen(sptr), USHRT_MAX); errcode = p9pdu_writef(pdu, proto_version,