Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp1153330rdb; Wed, 16 Aug 2023 03:29:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF++1F1Ma7SD3bSNj8ONct1GtGHi4vxq62PC48Z1CBTfarj5SEcowXk6Kb7Ctx16ij3MRR7 X-Received: by 2002:a05:6a20:914f:b0:133:d1b:a880 with SMTP id x15-20020a056a20914f00b001330d1ba880mr2096779pzc.23.1692181758612; Wed, 16 Aug 2023 03:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692181758; cv=none; d=google.com; s=arc-20160816; b=RTR7X3KhzUviUhfJc+3qwM9QjdLy14zaoj9CAZvlzQtm4/SQUYAE8K7PCsxFKfUH/o ikAyyDK/V+D1sCxlA4z9Axstv8+fWpk0p8GMPUs15Sr4K5uyWyRrkTRtkpIt3mosBBoQ DGIWvqn/GG1wSf+V41ZjDHMrgcMoWc0wX1RHjgA1Qs3p7210NVF8pOxsqJQRfFgl2oQZ F2E1zWIGYXWb5S/b0PqEy5Fydw6/xhBd0rQbcV3tXPZIh06xIGsLv9LHZL8qudLwuEJM dlpRclDjAgzkqtSUBaTPBsO/ggXhI2OuT7y47cL5ra+fu/akJAweFSBF2zWU5M2OVS1Y BqSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=EomDBpJ1bf3bljT7/z6TVrM5yZ5TspOdykx/7ormRaE=; fh=D/OocpUvFhiFDSu5TrVFc8/j64Xe50joN13a/McRnqQ=; b=HS84x1Y7MD28HIQ0fj6cco69ZbCUd7evba3IGHJCCFS+uNU90dMpTspkzDHKx8rzF4 C1jv3G4QwogMg3QMD40dWOwLO+LjHR8PAo0PCG1CygzfPP8TIfGWJyU66BG4A/quOf8l HL3RNppN/sKM8jvnFYlwsR5S6obCkj4esgkNnR41rtjBWvsFTOH92E+mOAUZY0XhHZkj +LJvIDDNMYzXRwaz2zCruNJ/2X0Hq/U7DPEjGAn1B3dd+4UL74MjqxHRyWutbJvP3Mrj 1dvnAbDZSqZub64Y97obrB22WcVvMxJbk9+vT6UPKTC6gMuNuG8aTwD/3u99HA/UFZBJ On1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F3rhb0tz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g18-20020a056a000b9200b006826f3512f1si11590366pfj.204.2023.08.16.03.29.04; Wed, 16 Aug 2023 03:29:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F3rhb0tz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235877AbjHPIxm (ORCPT + 99 others); Wed, 16 Aug 2023 04:53:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243240AbjHPIxg (ORCPT ); Wed, 16 Aug 2023 04:53:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07431198C; Wed, 16 Aug 2023 01:53:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9931D66345; Wed, 16 Aug 2023 08:53:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 940A6C433C7; Wed, 16 Aug 2023 08:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692176006; bh=W6H+YmdxNnL5Y2clvk2f8BlKz84U9aaSlefeeFikQRE=; h=From:To:Cc:Subject:Date:From; b=F3rhb0tzadu2284PcYbX+zLkzqhCL6c//bRfYIALors43WF0RgNfJOXrvXChMOqcn G/GuNU0X+NOXjL79+Ln4GGOZMvaWNTYKzUJ2080CRpt+LmsEOmQd1dvKpM0ODW6kl0 xnY2eAogaoLXyl/ZTjDSNDuwwQqTyASZzc+waYlbaQi1VirIq44jQAW3CbGdTophof K5O/Y6M2Sh+8A48fhDO+aTNtI+dRlD0gWF9Yla+c+uYuh/I8o+JSw1tX9DOZFDeR5N zNfKLk05mXwMS4N00Vv9jsgkgmK5HmpqF08LotDFdMT1PGVNkESelLIpyzuM4Qbegr XOpwtiJYNUFSQ== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Nathan Chancellor , kernel test robot Subject: [PATCH] tty: gdm724x: use min_t() for size_t varable and a constant Date: Wed, 16 Aug 2023 10:53:22 +0200 Message-ID: <20230816085322.22065-1-jirislaby@kernel.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org My thinking was that ulong is the same as size_t everywhere. No, size_t is uint on 32bit. So the below commit introduced a build warning on 32bit: .../gdm724x/gdm_tty.c:165:24: warning: comparison of distinct pointer types ('typeof (2048UL) *' (aka 'unsigned long *') and 'typeof (remain) *' (aka 'unsigned int *')) To fix this, partially revert the commit (remove constants' suffixes) and switch to min_t() in this case instead. /me would hope for Z (or alike) suffix for constants. Signed-off-by: Jiri Slaby (SUSE) Fixes: c3e5c706aefc (tty: gdm724x: convert counts to size_t) Reported-by: Nathan Chancellor Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202308151953.rNNnAR2N-lkp@intel.com/ --- drivers/staging/gdm724x/gdm_tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c index 67d9bf41e836..32b2e817ff04 100644 --- a/drivers/staging/gdm724x/gdm_tty.c +++ b/drivers/staging/gdm724x/gdm_tty.c @@ -17,9 +17,9 @@ #define GDM_TTY_MAJOR 0 #define GDM_TTY_MINOR 32 -#define WRITE_SIZE 2048UL +#define WRITE_SIZE 2048 -#define MUX_TX_MAX_SIZE 2048UL +#define MUX_TX_MAX_SIZE 2048 static inline bool gdm_tty_ready(struct gdm *gdm) { @@ -159,7 +159,7 @@ static ssize_t gdm_tty_write(struct tty_struct *tty, const u8 *buf, size_t len) return -ENODEV; while (remain) { - size_t sending_len = min(MUX_TX_MAX_SIZE, remain); + size_t sending_len = min_t(size_t, MUX_TX_MAX_SIZE, remain); gdm->tty_dev->send_func(gdm->tty_dev->priv_dev, (void *)(buf + sent_len), sending_len, -- 2.41.0