From patchwork Tue Dec 2 21:21:43 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 11838 X-Patchwork-Delegate: paulus@samba.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 991A3475FE for ; Wed, 3 Dec 2008 08:22:02 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.170]) by ozlabs.org (Postfix) with ESMTP id 5A149DDD04 for ; Wed, 3 Dec 2008 08:21:41 +1100 (EST) Received: by ug-out-1314.google.com with SMTP id 17so3144574ugm.14 for ; Tue, 02 Dec 2008 13:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=qDeI0SrxPKgE+O1Gn+EgiqVf6sNWB5dDLBFUY4iUkjk=; b=uu1dEDuGkazuLn76oSgvhEdFtvecIaC2Cx6m8dJ3fRGKqFCMqlKGtr28/mYEoXG3dn P1IqDooW8tWDRMhc5BCEGoGe250fA712jZfkxh0MwdrPfETQoAAiMak/zgbQHkh/kMDP MtqKK0Gk310N03Ah9rAuZWqTcrwTHR7GloZa0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=v+k6Fm2FIE+4HlI8l8Y0R0XNusYE+BX9iTcwI4I79Jic0FHAv+wd1tSHvo5VSkywaH VYB595j2QMBYoDbgm/Sq6M3uTqhYEMKXwDi1U88470EF7g1pSspffS6pMMtO/osY5DWe ACgOcPOFFk8uf09+1dIwUdcQwJYrqvBJ/t+EI= Received: by 10.67.116.7 with SMTP id t7mr1040649ugm.63.1228252899649; Tue, 02 Dec 2008 13:21:39 -0800 (PST) Received: from ?192.168.1.148? (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id o7sm7059461uge.0.2008.12.02.13.21.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 02 Dec 2008 13:21:38 -0800 (PST) Message-ID: <4935A6E7.3070704@gmail.com> Date: Tue, 02 Dec 2008 22:21:43 +0100 From: Roel Kluin User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: paulus@samba.org, Alan Cox Subject: [PATCH v2] hv{c,cs,si}_struct make *count signed Cc: linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Otherwise count < 0 will fail Signed-off-by: Roel Kluin --- This was not tested. Is this how it should be fixed? the locations where the failures occur are in the functions hv*_close, on: vi drivers/char/hvcs.c +1251 vi drivers/char/hvsi.c +911 vi drivers/char/drivers/char/hvc_console.c +387 diff --git a/drivers/char/hvc_console.h b/drivers/char/hvc_console.h index 8297dbc..3c85d78 100644 --- a/drivers/char/hvc_console.h +++ b/drivers/char/hvc_console.h @@ -48,7 +48,7 @@ struct hvc_struct { spinlock_t lock; int index; struct tty_struct *tty; - unsigned int count; + int count; int do_wakeup; char *outbuf; int outbuf_size; diff --git a/drivers/char/hvcs.c b/drivers/char/hvcs.c index 473d9b1..6e6eb44 100644 --- a/drivers/char/hvcs.c +++ b/drivers/char/hvcs.c @@ -269,7 +269,7 @@ struct hvcs_struct { unsigned int index; struct tty_struct *tty; - unsigned int open_count; + int open_count; /* * Used to tell the driver kernel_thread what operations need to take diff --git a/drivers/char/hvsi.c b/drivers/char/hvsi.c index 59c6f9a..af05528 100644 --- a/drivers/char/hvsi.c +++ b/drivers/char/hvsi.c @@ -75,7 +75,7 @@ struct hvsi_struct { spinlock_t lock; int index; struct tty_struct *tty; - unsigned int count; + int count; uint8_t throttle_buf[128]; uint8_t outbuf[N_OUTBUF]; /* to implement write_room and chars_in_buffer */ /* inbuf is for packet reassembly. leave a little room for leftovers. */