From patchwork Wed Jun 24 15:07:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 11623503 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C469D913 for ; Wed, 24 Jun 2020 15:12:57 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9B59720656 for ; Wed, 24 Jun 2020 15:12:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="eivJ6fTm"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DPUhRWgB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B59720656 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GeFLAF5xajz+DDYML2rHXCHgTjZQIcc+YZ5o8x2HppM=; b=eivJ6fTmepYrKiyvK8PbReoCV AziPoKpNp8jKSwe/1J9MLVOpC8N1ktZrs1BpEXuPHMKaEWDKUeeub8QINKy7VCjHi1LnLta3wY3W5 RGSW2aiwyfz/mrZzmUgp1heGfCZAYVAMW1IELm5ddS25NgkRibyfkAZ/CRZljPZ6rVKXNQpzR3SGM t42KccgGIEdP2IL95tbNG/WzVgrJZQ03PE/ZFeIZyF0MUuQB+T10HAhs18byBsnwIQUjDu3bZdmbu WtotWE7rk0Boysjq9zYcdcPd0G/9np8RQpd/0RXFJW8UxyuRWjeFmAqhNljwoJ+ygtmHguzHgruU3 GOaL/IuiA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo72R-0005xW-U9; Wed, 24 Jun 2020 15:10:11 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo6zj-0004DY-8w for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2020 15:07:25 +0000 Received: by mail-wr1-x444.google.com with SMTP id o11so2620285wrv.9 for ; Wed, 24 Jun 2020 08:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZDwUiot6YU8OgX3Hsb4EAg8793UTa9837ZvsB3Ajb68=; b=DPUhRWgBdf4z6Kq3oWU8vrFS/EIgLp6T1Rjiov9INnODXro+UNi8yI8adJRwBb0utU 7Pm3vem2rv8I4QJIpGeXDr5oIFYw7N0HnH07oS/h/x/xgKsH1rkfR+v4BHlP/y+79eyw p6ClIinjeu01EHHr/ntpl6Pu1CqJm9076Dt52/rKxDXw28C8Wg23+Uys/DJw4//G0Lg2 kJJo4eSujafjVkZdQcjpwrnR+NUQRGh5WdZkKoFRB0OTACrZ5/h0jEZisLqxQCBOZ9YB 084H5InBZNTRYzrTu+pYo+r5TQXYYBL7tywwHul7NsS26H2HBonPPvirVNEOc7UAiv21 3n2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZDwUiot6YU8OgX3Hsb4EAg8793UTa9837ZvsB3Ajb68=; b=HDNZJkC00ypCW9rqz8jlV5iUnmJnDOkMpqxMEEsLd1XlFj8NBrACKe/6d/F9PS6rXf ArAeltyufAztUlvFKyOcRNl7/ZWNmYY/WLtWw5KBfS7jV16PBF5r2OwRMDBlU2uC59Nn duoRWTjV4YMR0Mx7uDcvdfH2YkhAldgDSOu5N6RQHqjsA2vBkW9hy9RKMAa1TtPeSRdM EHlUEMoLJS9zeztRYxP1VGX2aG9KBwwbnztM4sNC6QXYkevixDnCCSEinCQNA8lwD/Iw SXMjPrHpPRKL6I+1/E+IW27uCixiRRIofoi0ajR8PZR+30A8uww2m1nhz12C8IkH2c+1 uYag== X-Gm-Message-State: AOAM530yG504nTBFu/6EakwRHfgA0ns9qzjMv/sJscdceBzeY/RcliSD E1yzd3I7jnSQMztKsnMkjPZo3A== X-Google-Smtp-Source: ABdhPJwRg+dd0nV6QlWORkWed0heqJcLSegy+1eW8ToYmwLs3DPPatue04iD98sXOOpgScYdnnXdiw== X-Received: by 2002:adf:a514:: with SMTP id i20mr31153581wrb.112.1593011240649; Wed, 24 Jun 2020 08:07:20 -0700 (PDT) Received: from localhost.localdomain ([2.27.35.144]) by smtp.gmail.com with ESMTPSA id h14sm11543361wrt.36.2020.06.24.08.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 08:07:19 -0700 (PDT) From: Lee Jones To: lee.jones@linaro.org Subject: [PATCH 07/10] mfd: ab8500-debugfs: Fix incompatible types in comparison expression issue Date: Wed, 24 Jun 2020 16:07:01 +0100 Message-Id: <20200624150704.2729736-8-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200624150704.2729736-1-lee.jones@linaro.org> References: <20200624150704.2729736-1-lee.jones@linaro.org> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stable@vger.kernel.org, Linus Walleij , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Smatch reports: drivers/mfd/ab8500-debugfs.c:1804:20: error: incompatible types in comparison expression (different type sizes): drivers/mfd/ab8500-debugfs.c:1804:20: unsigned int * drivers/mfd/ab8500-debugfs.c:1804:20: unsigned long * This is due to mixed types being compared in a min() comparison. Fix this by treating values as signed and casting them to the same type as the receiving variable. Cc: Cc: Linus Walleij Signed-off-by: Lee Jones Reviewed-by: Linus Walleij --- drivers/mfd/ab8500-debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c index 1a9a3414d4fa8..6d1bf7c3ca3b1 100644 --- a/drivers/mfd/ab8500-debugfs.c +++ b/drivers/mfd/ab8500-debugfs.c @@ -1801,7 +1801,7 @@ static ssize_t ab8500_hwreg_write(struct file *file, int buf_size, ret; /* Get userspace string and assure termination */ - buf_size = min(count, (sizeof(buf)-1)); + buf_size = min((int)count, (int)(sizeof(buf)-1)); if (copy_from_user(buf, user_buf, buf_size)) return -EFAULT; buf[buf_size] = 0;