Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp761082imw; Mon, 4 Jul 2022 19:53:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sKbmsxm5milobZUuA0yaQ1yyXRTiJquoX5J8PiwJq1hnPcfCOtXZRmdElhH/qe6wp+CtDE X-Received: by 2002:a65:4907:0:b0:3fd:bc3e:fb0a with SMTP id p7-20020a654907000000b003fdbc3efb0amr26706198pgs.123.1656989601121; Mon, 04 Jul 2022 19:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656989601; cv=none; d=google.com; s=arc-20160816; b=uMdzDzcLxVvN/c4IZYKldh2Xjhq4D8UK46Z5RVFOqgvr9MmedXHrNF/vp0Xzruiv0c GO/h7eam5zVmdVGm0rMfI8OPiQIzIw7cvqXn8+Ny6fYyhWeUfky1aPNFOVCATdkzrgEo 9dJMl4+3kCctOJWUmcjakg/Y0cd1MuJ8wi1TeO79BqlXXhfLGBBjdtzg6wqY861Pkzc1 2f8OiLE/GWEo6Iauv7VJodpYsa1QPO3CYKDFSg6anr5vSIsZEaP9yd4pqd9jJ7jXghiy nrjYG4j8sEAeJiGRVA8SJALprRTTKx1RFQaBaHv/k3g5ldXmNaWp0GQw9R7JxZmZWnB/ dD+g== 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; bh=W58DF2oFCEP+D6j5idOiiQvKpCKuHFWH+Rn+7iBXyzI=; b=XMS4u6NDE6uduQWN/yKNV825tgvurvEybeje5kVScD+wNegGqvehnf0S+PvdoS6xnU DI7gGuVTt3FsTOia1elhZgpKipKmbhAEbb57xzn0bAGyADQGYf/1eFqrhVwCpxoAGuVj dUXUjPRrPcqgrGH14m+RZuSGl64FQMJK49eY7RBs+we2WvtNt/7anckGQ6qKvTMXrU89 wCTCH/CBE7KV9SogVxjbUrLBdtjOgGPBz1kqWQ0rolLNGjiWovOUATG+QHiCpWclzCN9 lrHC3vob+a9gmO9lzhU2lhGUmrIK5iFiVNBIyzskTiWFY002KtGDZMoDE+A/71BU+uZb Mz7A== 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=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o10-20020a65458a000000b003fc61e0fb47si43968483pgq.799.2022.07.04.19.53.08; Mon, 04 Jul 2022 19:53: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; 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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234412AbiGEC0D (ORCPT + 99 others); Mon, 4 Jul 2022 22:26:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231287AbiGEC0C (ORCPT ); Mon, 4 Jul 2022 22:26:02 -0400 Received: from out30-44.freemail.mail.aliyun.com (out30-44.freemail.mail.aliyun.com [115.124.30.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47F94E5F; Mon, 4 Jul 2022 19:26:01 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R211e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0VIPhdNS_1656987958; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0VIPhdNS_1656987958) by smtp.aliyun-inc.com; Tue, 05 Jul 2022 10:25:59 +0800 From: Yang Li To: rafael@kernel.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH -next] powercap: arm_scmi: Fix an ignored error return from num_domains_get() Date: Tue, 5 Jul 2022 10:25:57 +0800 Message-Id: <20220705022557.19747-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 line 428 pr->num_zones = powercap_ops->num_domains_get(), the return of num_domains_get() is int, it can be a negative error code, however this is being assigned to an unsigned int variable, so make the num_zones to int to solve this problem without affecting other functions. Eliminate the following coccicheck warning: ./drivers/powercap/arm_scmi_powercap.c:429:5-18: WARNING: Unsigned expression compared with zero: pr -> num_zones < 0 Signed-off-by: Yang Li --- drivers/powercap/arm_scmi_powercap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/powercap/arm_scmi_powercap.c b/drivers/powercap/arm_scmi_powercap.c index 36f6dc211fbb..11018e63bb8b 100644 --- a/drivers/powercap/arm_scmi_powercap.c +++ b/drivers/powercap/arm_scmi_powercap.c @@ -29,7 +29,7 @@ struct scmi_powercap_zone { }; struct scmi_powercap_root { - unsigned int num_zones; + int num_zones; struct scmi_powercap_zone *spzones; struct list_head *registered_zones; }; -- 2.20.1.7.g153144c