Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1110594pxb; Tue, 26 Oct 2021 03:00:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy96os6RIBDdvERznn8v0fKwr4+8/DYTiid+7evJbM3ETHckzZKegVY4C4TeUpQ5vmq+1rm X-Received: by 2002:a17:902:b60b:b0:13e:dfc0:139 with SMTP id b11-20020a170902b60b00b0013edfc00139mr21420927pls.80.1635242418707; Tue, 26 Oct 2021 03:00:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635242418; cv=none; d=google.com; s=arc-20160816; b=HjVrGau+TNmzUzG6mLw52gbJpMBqnyizhUgHLrkBAoSfp5aSmDwd6+26M4581RvyfE pmnL35FzbIQt84+vDvWpEG2pm0c5B9UVDX6uNz0/8IYE3SopTnQxb2MsLd8TL8VY/T2W HX3p/ZQa4BZa3FQr+mJczVa2WigBc+hhef2wsVyIlDgI3yJa25aDvdZkz1crFh8HXr4m cdEvBjG6AFpizLdVJAWaopivEDfEl3a8mqGI5A6hIFK72A9QeqzDoZ6V21stleopy8Dt yV6oiqmXtKtLBW3xdeGYhLnuSSJiechsQu4+cdCuwGY1Cn5ixsy7bQelkdqgYjGWfuUV pUZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=BSYsy65yZV7ABFbqudBFoIc+feE658GAQ3lPctdgmhg=; b=Pw3nLUEdpMzmFu4vr/ejUkS92mb+ZTFXfzbx4ibgTJAAudMJkOYGJqMGxq9TjWOxyO LBt13jLvTUMfOwViF1yRtWfVvujBSakZHXT+TRnZUsLZ6uFPivwjEVm9jpag/Lj9CAeh gGRzK2KviJg978Es73ErcgwysC+qqP3L6y57s7//jyWke6DV6caodzwcw8vfelvAXECg 55bk6Qd0XOHr97i5O07DuQiZ/0V1hd3wBG3/FzX09DTBWjUEc0RQo5wHbMT/VZc/clK/ leyCbTyyHi0VKoRHbOzhmQNP15o0Le6NTS7GqqtMX9xuayQnaPIxB+CcOOeeS7re7H9A yNVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z10si23716543pgk.95.2021.10.26.02.59.50; Tue, 26 Oct 2021 03:00:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233609AbhJZIPX (ORCPT + 99 others); Tue, 26 Oct 2021 04:15:23 -0400 Received: from smtp25.cstnet.cn ([159.226.251.25]:49788 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233330AbhJZIPW (ORCPT ); Tue, 26 Oct 2021 04:15:22 -0400 Received: from localhost.localdomain (unknown [124.16.138.128]) by APP-05 (Coremail) with SMTP id zQCowAB3fKh3uHdhdvM0BQ--.56608S2; Tue, 26 Oct 2021 16:12:39 +0800 (CST) From: Jiasheng Jiang To: song@kernel.org Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: [PATCH] md/raid5: Fix implicit type conversion Date: Tue, 26 Oct 2021 08:12:37 +0000 Message-Id: <1635235957-2446919-1-git-send-email-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: zQCowAB3fKh3uHdhdvM0BQ--.56608S2 X-Coremail-Antispam: 1UD129KBjvdXoW7JrW5tr1ftw1rury8ZrWrXwb_yoWDXrXEkr 1fXr1Yqr9Yqrn2vw13Ww1fCryS93WkWws2va4FgrsIvw1Fqa13Wr1vg34rXr17CrZ8ZF4q qryDtwn3Zry8WjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbckFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s 0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xII jxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr 1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxkIecxEwVAFwVW8ZwCF 04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r 18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vI r41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr 1lIxAIcVCF04k26cxKx2IYs7xG6rWUJVWrZr1UMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF 0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUIzuXUUUUU= X-Originating-IP: [124.16.138.128] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The variable 'cpu' is defined as ULONG. However in the for_each_present_cpu, its value is assigned to -1. That doesn't make sense and in the cpumask_next() it is implicitly type conversed to INT. It is universally accepted that the implicit type conversion is terrible. Also, having the good programming custom will set an example for others. Thus, it might be better to change the definition of 'cpu' from UINT to INT. Fixes: 738a273 ("md/raid5: fix allocation of 'scribble' array.") Signed-off-by: Jiasheng Jiang --- drivers/md/raid5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 7d4ff8a..c7b88eb 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -2425,7 +2425,7 @@ static int scribble_alloc(struct raid5_percpu *percpu, static int resize_chunks(struct r5conf *conf, int new_disks, int new_sectors) { - unsigned long cpu; + int cpu; int err = 0; /* -- 2.7.4