Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp1754471rdb; Thu, 17 Aug 2023 00:37:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE19jJpu1io1nuT8dkj+jdFNM31PswMuBpeWvrs+vC/mPUXm897+QXWtDopJf3PB4S8HkZ4 X-Received: by 2002:a05:6a00:acf:b0:686:6e90:a99b with SMTP id c15-20020a056a000acf00b006866e90a99bmr5124160pfl.25.1692257841599; Thu, 17 Aug 2023 00:37:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692257841; cv=none; d=google.com; s=arc-20160816; b=gl001Mb61V1FwvDDq5cDKdJT1QtVIus06nRGQe6KuzhqPJGdPfkb4FP0vx9gGcZEED rI1YG+ZdjZ3DvAjjX+MBCXR6O3e03Uxf+RBl8rOtxLU8uXXSMPsXcSX5MeOvqKJxbFGR HmSfbwf8ampbOrgXFfhdQ6toEI/BO7HnEXwXIUZqw3xi3Dm7m7qzB6589qkr5Q8f2Tk3 ulMPhfluIzLoiIUpl6tHLqzbmvdugVhZ+9vQMI07XrBVLIDxcUtweMwolVPoGSvIWBNK yAyojX/6Yx/LKt5t/8sPotA1TCU6oGJAK+2uCX1mj1NVtS8oV1lsUkKbf2e0GQo15tx1 Sk9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=s+sox40CoYialdouSMhoXUJ6N94QVhbiZm8KN8TlClo=; fh=X90vgSvsdl+hGb8TC5BUs1NzH60hR8mC1ZUXbcF7g8E=; b=MCl6AjYmzwZMUeQ2F34L4ZAi0d3YIjSJsDjOLJZO9CVCSK+QJdVyg//nBaNmuFAkwA nVU/SAGw8PyQe/YPYpHzs+H811QU9fo7hT70ki7ylRGFfw/N/yOZRj+/hCG/RiBC8m8V WtliMn5sK9YogmPqKmM76zgvtmpAljjBuQMaTZBwJdeNPfwPrMkpLQBbwtQSV/vXI/eO yKz5XEHwrlgo6T9O63rE+f92gnrjqOF0U3O9HaDjFFjIU/azQPhJxEfFxbldhwL4SfOj h93SxS6ciiMaz/+SOYQI7AqnSrDtVOw1hWt+MV2OBY1bL51suUvuDD7ozRtGiyZblAQJ Zx2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qu2vRBDX; 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 e23-20020a63e017000000b005644a9be955si13235465pgh.179.2023.08.17.00.37.09; Thu, 17 Aug 2023 00:37:21 -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=qu2vRBDX; 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 S1345114AbjHPROC (ORCPT + 99 others); Wed, 16 Aug 2023 13:14:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345160AbjHPRNm (ORCPT ); Wed, 16 Aug 2023 13:13:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D98CE52; Wed, 16 Aug 2023 10:13:41 -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 0205F62232; Wed, 16 Aug 2023 17:13:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EACAC433C7; Wed, 16 Aug 2023 17:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692206020; bh=p24LV4d/PSjicOA4bNsxeM8KTvX0pE92+j4eepvZU6M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qu2vRBDXS+n1XINFh040FrwUvC+/M1w4Ul37EH8D4Lxl2Gi6UQ1SQiguVYF7Z0r2Z uc+++yqVHTXSQUmB7vSfNX0Bw5mZKxOzqsNGx5em2wZuptyW0No6g8XWYwgUn2TBnD ifY2sqCRNYVkuKEE0rtcZWvhd0tRqKc6biOcQp9Bh63UzO2cjLSLSefAX60lmFMYPo NS8P6oMJc0T2B+qrE5NynW7V1xFB53dKNHxY3TjaTBBsP/O/ceWiOQRjzkjXULC+eT Ku4lMy90FrXDqjwVBPm4Ma+DZwlg04N/G5/ELAxjDQa6OWOazbdqQtrePI4N2AlF6C g4GGEd2gGc4ng== Date: Wed, 16 Aug 2023 10:13:38 -0700 From: Nathan Chancellor To: "Jiri Slaby (SUSE)" Cc: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, kernel test robot Subject: Re: [PATCH] tty: gdm724x: use min_t() for size_t varable and a constant Message-ID: <20230816171338.GA2138570@dev-arch.thelio-3990X> References: <20230816085322.22065-1-jirislaby@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230816085322.22065-1-jirislaby@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 On Wed, Aug 16, 2023 at 10:53:22AM +0200, Jiri Slaby (SUSE) wrote: > 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/ Tested-by: Nathan Chancellor # build > --- > 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 >