Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2314898rwd; Fri, 16 Jun 2023 02:10:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7kZy9HFK3QxED2rv/gV65shrBAc3EQnH+631Fzc6hAHkUZw40r4qOTurvqqmz6IUQgjvnC X-Received: by 2002:a05:6a20:914d:b0:117:c0a5:5f39 with SMTP id x13-20020a056a20914d00b00117c0a55f39mr1726886pzc.29.1686906658662; Fri, 16 Jun 2023 02:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686906658; cv=none; d=google.com; s=arc-20160816; b=YMeC7lNhny0iobl2HbOIV2dkQKxYw403q0QdXekqwNtLxAwAh7y6eiT5RVqJkpfZEw U8j1EeY+81azAS7lvduDS3BgQjdNhrHm0KfOGq9c4VPBIQSnGLhSs5xY2NqLAaFD7ks3 iV4Th/r31LRHhTQSqWQinY7qVjXIXq4/SfZcMXkB2gOaRZ2xm3f66utDEu1tqR+7j0ed alH0UlCKyxIOVTAsFSmMA+r5+jAND/XR1Arze5FnYR/IcfUSYzzxMEbgHZoVRHgLqc4L 9j4Uua/XLOMYVZeHYJepJiX5teTfNpNmfDWUYU9ZmZaw3/z4IU4Iy7JMT0UWY3y7UUS+ gL8g== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=+EKe6VVSxuSO5uLNyBs11VmVN/5CIVP25VkI6PVbvpg=; b=nLMrKiZJ8g792npsgy/BpSUwHrGoxbfdw9ATcQuxStDVk3W/40YlknAawHYlwEI7ru DNoB1Vh+FSO+bPvdgYXSnEBZFbQ4mdkWFqzf1CKhbrB5H1heJy8OtEVvslr4+fGUyVfv bUowOSvaGShoJ/v4X6Xcaz10p5KJeiAwVkl35TJ8YAGiswTSOtUAs4QEp4znlyxJ4gKF UpWT4cJo7g1HzjJDirBsNdkv+NsOfPBK2z+IcnVjy2m7l86w7/MxhYI/PPaKjWFr+EUI CfLWItfjMxbk8QBVpKSftaBue3mvaymKeqcOX/4JJOhY1o13CE2ZwvEUOD+aiRZ0QqYM CYtA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9-20020a170902e80900b001aaf639c4easi12633283plg.109.2023.06.16.02.10.45; Fri, 16 Jun 2023 02:10:58 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233149AbjFPJBn (ORCPT + 99 others); Fri, 16 Jun 2023 05:01:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344261AbjFPJBI (ORCPT ); Fri, 16 Jun 2023 05:01:08 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DA0C035A0 for ; Fri, 16 Jun 2023 02:00:59 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A3E921FB; Fri, 16 Jun 2023 02:01:43 -0700 (PDT) Received: from bogus (unknown [10.57.96.87]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C74083F5A1; Fri, 16 Jun 2023 02:00:57 -0700 (PDT) Date: Fri, 16 Jun 2023 10:00:54 +0100 From: Sudeep Holla To: Conor Dooley Cc: =?utf-8?B?546L5piOLei9r+S7tuW6leWxguaKgOacr+mDqA==?= , Sudeep Holla , Conor Dooley , Greg Kroah-Hartman , "Rafael J. Wysocki" , "linux-kernel@vger.kernel.org" , "opensource.kernel" , Pierre Gondois Subject: Re: =?utf-8?B?5Zue5aSNOiBbUEFUQw==?= =?utf-8?Q?H?= v1] drivers:base:Fix unsigned compared with less than zero Message-ID: <20230616090054.b3lxtsj67oyp6s3h@bogus> References: <20230614133549.3774-1-machel@vivo.com> <20230614-passcode-stimulate-70eecb6d81d2@spud> <20230615-cathedral-concur-969e91b8c792@wendy> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230615-cathedral-concur-969e91b8c792@wendy> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Thu, Jun 15, 2023 at 07:50:45AM +0100, Conor Dooley wrote: > Hey, > > For some (probably good) reason, this doesn't appear to have made it to > the lists. > > On Thu, Jun 15, 2023 at 02:05:18AM +0000, 王明-软件底层技术部 wrote: > > 发件人: Conor Dooley > > > On Wed, Jun 14, 2023 at 09:35:36PM +0800, Wang Ming wrote: > > > > The return value of the of_count_cache_leaves() is long. > > > > However, the return value is being assigned to an unsigned long > > > > variable 'leaves',so making 'leaves' to long. > > > > > > But you actually made it an int? > > > > > > > silence the warning: > > > > ./drivers/base/cacheinfo.c:300:5-11: WARNING: Unsigned expression > > > > compared with zero: leaves > 0 > > > > > > I'm dumb, why is comparing an unsigned value with zero a problem in > > > and of itself? Zero is a valid value for an unsigned type, no? > > > > > > If you actually look at the function, it only returns positive, > > > non-zero values anyway, so returning an int is a bit pointless, as > > > are the checks, no? > > > Thank you, I see. This doesn't need to be fixed. > > Right, but I was suggesting that you should change the function to not > return a signed value anymore & remove the check for whether it is > zero, instead of your patch. > > Cheers, > Conor. > > +CC Sudeep, Pierre: FYI. Original posting is at > https://lore.kernel.org/all/20230614133549.3774-1-machel@vivo.com/ > in case threading is broken, as I think the in-reply-to header in what > I am replying to is corrupted. Also if the original thread landed, I couldn't have responded because of the disclaimer ????. -- Regards, Sudeep