From patchwork Sun Jan 18 12:03:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 19171 X-Patchwork-Delegate: benh@kernel.crashing.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 97794DE153 for ; Sun, 18 Jan 2009 23:04:38 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by ozlabs.org (Postfix) with ESMTP id EBD32DE08E for ; Sun, 18 Jan 2009 23:03:50 +1100 (EST) Received: by ey-out-2122.google.com with SMTP id d26so278760eyd.15 for ; Sun, 18 Jan 2009 04:03:48 -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=MinwOKjf7KiPRAzvUSCe0YHDA+iemO9w4Brp7/Z1Nrw=; b=n0OcLZ+hq8UGt5idqPyn8qYlelbpg/gr+B0mh9bNc7243s2efTAxuno/9n3uAFMqxv 04wdv9Vkt+Znxb88oEraVGgqoJ/PVzb+b4sAZCkDo6Q5EOE3tX+IzASAVDWij4Nip2Qe 64CxejJcSgjqmkRz7wGbtlV5v0fujhCPm83qE= 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=thCK7FgRQ/UcxYl+ePHwjYg3B5h+o+6dny+gvfC7UsOaFoJ9WgSYrR4DwzeY//0eID yORZb3w1LPknMuqOR9MK2WxI3Xt3I8fifm0lvCiDNHQJQ5AoFyeo1jgUqnqG9szKeRQD aDWE6fEI5clyk/V79GDixViiolkQN5DsKGr1Y= Received: by 10.210.34.19 with SMTP id h19mr5741944ebh.199.1232280228556; Sun, 18 Jan 2009 04:03:48 -0800 (PST) Received: from ?192.168.1.115? (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id d25sm10514337nfh.76.2009.01.18.04.03.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 18 Jan 2009 04:03:48 -0800 (PST) Message-ID: <49731AA3.5020603@gmail.com> Date: Sun, 18 Jan 2009 13:03:47 +0100 From: Roel Kluin User-Agent: Thunderbird 2.0.0.18 (X11/20081105) MIME-Version: 1.0 To: benh@kernel.crashing.org Subject: [PATCH] therm_adt746x: signed/unsigned confusion Cc: 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 As suggested, this is used for signed rather than unsigned Signed-off-by: Roel Kluin diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index 82607ad..c0621d5 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c @@ -498,8 +498,8 @@ static ssize_t store_##name(struct device *dev, struct device_attribute *attr, c #define BUILD_STORE_FUNC_INT(name, data) \ static ssize_t store_##name(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) \ { \ - u32 val; \ - val = simple_strtoul(buf, NULL, 10); \ + int val; \ + val = simple_strtol(buf, NULL, 10); \ if (val < 0 || val > 255) \ return -EINVAL; \ printk(KERN_INFO "Setting specified fan speed to %d\n", val); \