Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3867552pxb; Tue, 19 Apr 2022 11:23:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHIfxIS7sdIoBDhcx3BCK72E7uvk2tbmYsNEU2+kMFM3fuKVKJY5DCyNf1BIZsdp/rEZ3F X-Received: by 2002:a17:90b:4a8a:b0:1d2:f7ba:8728 with SMTP id lp10-20020a17090b4a8a00b001d2f7ba8728mr1480790pjb.43.1650392637917; Tue, 19 Apr 2022 11:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650392637; cv=none; d=google.com; s=arc-20160816; b=tVSi+uVDbBHhskInFHWsPP/lVscVnU5kmuzOyLPWfTAQSRfG/Jq/TP0HI0YWyBk8DT 7i8Kd77pgu0DnU9nRVswbSfvlhyS/EEKjr/n0EsJFNaaRhsFvIK5mBcbk5tWpeHj0UZh s7ETemufo99jz6OZOtTq8MeratWLuOnKqZf760AWbOAowmufQp90YNONlb4uAInrsRqW T9rtFomK20l7xTzosEZ4hFxGNUCLH5DsOGyKN8c5ZwPB1QjpFjB0meolkRSJEP62vVOv lKWITwpvwQfdEO7B/gfQvih6nRB+EkRDYZW1lYmqVPdR/m8mTqOP+eNm1/RyZABqfl8F iN8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=ILKtZqeuxSF/9zrhcaQXOVouv1Un2iI3KZiRUENlsYA=; b=ZWiDhMEMqcmo+kNw+ddJkRmIRg9jj9BLFmnP8AnZa+XkBWXpr23AJoB6vwUjZTIGiD MBa+Nsvo9fsE9gs8/UIVq1mKGCg2HCEWPSBt5IeGzzfm5WIBe1kBGMGS1kSHwXgoX2XJ nxN2uOvs47nl5rZzR7c7/PCe0LwzcI+RayHczI385dvSUldxe5KEjX53h28L1rEZQJR9 nOx0FnOVGp+ebKSyRtBZou8ZG6fth78FuJV7+4HtR6X+8s0I+L9OFAY3VeYssM/b7ZY8 57vnYF2BrzctJMqFomfZPR/MGvdj8Apubi2ET+sk6f3fqJLR5bPPOT92bSVkoJAJaCz3 W4Pg== 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 b18-20020a056a000cd200b0050a777cd136si6718726pfv.205.2022.04.19.11.23.42; Tue, 19 Apr 2022 11:23:57 -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 S1343638AbiDSBqL (ORCPT + 99 others); Mon, 18 Apr 2022 21:46:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343603AbiDSBqH (ORCPT ); Mon, 18 Apr 2022 21:46:07 -0400 Received: from mail.meizu.com (edge07.meizu.com [112.91.151.210]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E50DE27FE9; Mon, 18 Apr 2022 18:43:23 -0700 (PDT) Received: from IT-EXMB-1-125.meizu.com (172.16.1.125) by mz-mail11.meizu.com (172.16.1.15) with Microsoft SMTP Server (TLS) id 14.3.487.0; Tue, 19 Apr 2022 09:43:23 +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 09:43:21 +0800 From: Haowen Bai To: Stefan Haberland , Jan Hoeppner , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , "Christian Borntraeger" , Sven Schnelle CC: Haowen Bai , , Subject: [PATCH] s390/dasd: Use kzalloc instead of kmalloc/memset Date: Tue, 19 Apr 2022 09:43:20 +0800 Message-ID: <1650332600-5307-1-git-send-email-baihaowen@meizu.com> X-Mailer: git-send-email 2.7.4 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.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,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 Use kzalloc rather than duplicating its implementation, which makes code simple and easy to understand. Signed-off-by: Haowen Bai --- drivers/s390/block/dasd_eckd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 8410a25a65c1..74a035c56c3e 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; @@ -1489,7 +1489,6 @@ static int dasd_eckd_pe_handler(struct dasd_device *device, return -ENOMEM; } } else { - memset(data, 0, sizeof(*data)); data->isglobal = 0; } INIT_WORK(&data->worker, do_pe_handler_work); -- 2.7.4