Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp4369815pxb; Wed, 20 Apr 2022 01:29:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdwW9RdDbFzeGL4waN2LGp2IlCjkz8yXrEpwi8lSVuRG4rLm2OKRMz4dz5NfJJNEol3nOi X-Received: by 2002:aa7:d54e:0:b0:41d:6172:b12 with SMTP id u14-20020aa7d54e000000b0041d61720b12mr21970394edr.390.1650443385509; Wed, 20 Apr 2022 01:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650443385; cv=none; d=google.com; s=arc-20160816; b=rbJqzPkLRtdqxmc0Drje8ojIqupJ1fyC9CftAPs+K6Ut56LgBv0oTowBLXKKZiP4qn /ZD8V3861eUtx/knh0TJ3zoHPrhfp4n4XljvoDZ203ZlSAqbr6fu2reOeQw+Agq3lXu4 2+qCS0UBQcEFkU3mX3HcIploGNGswZX4lHaeOj7e03pzHECyjlhJHal0X4HNoQfz1dNS 37FFHtkadVU2RlwK2RzO2KW9gbitgV8T5KilLOoA4uxWezi3YHCODM3i98+HFq8lK4gC u2yl4Xatvlov/SWvtKACtB+nf1SXbhJTlxBa5C/R54Py4jDqC+qc90AS6DuYN8IuB6mJ n5xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=M9dqKdVcw1cEubCU7YGL59hXsXGnT0zuFloHutZ9+14=; b=u8D/sUmzTa71rbVITeeUi3ItV7ht2IiQNBhD/miF6sCK/+/xeOmKF1Axehf1ZUH6Fu 84gUIzc2V2jBCZNp1F+PstRrZT4/PaPxm8rpg4tyvFwMEBWIySZFmk7XhQ2mUjd17bUC GeX43ihoTViR+06jCG/GHpJeR55O8avYkJxVrILvoHGhy0muY8FAWq8MXhT/asi8o29e 3LnCerWJwUrLztUk7EluRQCza9z/rl84FSnzN8r5XadD6aWcg6dwR9a/v1dUWu9SQRnC JayzLlcniblgjKJPcu4BMDT/KhTzqP1FbN2xV4ceZyQvATjuuUcLjU2TSsUfjT0snRhL ikWw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bx20-20020a170906a1d400b006e8add22d60si1299634ejb.393.2022.04.20.01.29.18; Wed, 20 Apr 2022 01:29:45 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348756AbiDSGH7 (ORCPT + 99 others); Tue, 19 Apr 2022 02:07:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233569AbiDSGH5 (ORCPT ); Tue, 19 Apr 2022 02:07:57 -0400 Received: from mail.meizu.com (edge05.meizu.com [157.122.146.251]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4348060F3; Mon, 18 Apr 2022 23:05:14 -0700 (PDT) Received: from IT-EXMB-1-125.meizu.com (172.16.1.125) by mz-mail12.meizu.com (172.16.1.108) with Microsoft SMTP Server (TLS) id 14.3.487.0; Tue, 19 Apr 2022 14:05:13 +0800 Received: from meizu.meizu.com (172.16.137.70) by IT-EXMB-1-125.meizu.com (172.16.1.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Tue, 19 Apr 2022 14:05:11 +0800 From: Haowen Bai To: CC: , , , , , , , , Subject: [PATCH V2] s390/dasd: Use kzalloc instead of kmalloc/memset Date: Tue, 19 Apr 2022 14:05:10 +0800 Message-ID: <1650348310-18553-1-git-send-email-baihaowen@meizu.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.16.137.70] X-ClientProxiedBy: IT-EXMB-1-126.meizu.com (172.16.1.126) To IT-EXMB-1-125.meizu.com (172.16.1.125) X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no 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 Use kzalloc rather than duplicating its implementation, which makes code simple and easy to understand. Signed-off-by: Haowen Bai --- V1->V2: also remove the isglobal assigment above, so the whole else block could go away drivers/s390/block/dasd_eckd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 8410a25a65c1..6b70f9dfff02 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c @@ -1480,7 +1480,7 @@ static int dasd_eckd_pe_handler(struct dasd_device *device, { struct pe_handler_work_data *data; - data = kmalloc(sizeof(*data), GFP_ATOMIC | GFP_DMA); + data = kzalloc(sizeof(*data), GFP_ATOMIC | GFP_DMA); if (!data) { if (mutex_trylock(&dasd_pe_handler_mutex)) { data = pe_handler_worker; @@ -1488,9 +1488,6 @@ static int dasd_eckd_pe_handler(struct dasd_device *device, } else { return -ENOMEM; } - } else { - memset(data, 0, sizeof(*data)); - data->isglobal = 0; } INIT_WORK(&data->worker, do_pe_handler_work); dasd_get_device(device); -- 2.7.4