From patchwork Sat Jan 7 18:48:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rix X-Patchwork-Id: 40445 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1413718wrt; Sat, 7 Jan 2023 10:51:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXsHROI1rjxEGx2yRNf6fCzzJJmUJfuNlIZTH6tNfEwy2LiOMWGnaAyLRzrINc6A+vqos9AO X-Received: by 2002:a17:902:8688:b0:189:77c1:b5a7 with SMTP id g8-20020a170902868800b0018977c1b5a7mr57395656plo.41.1673117470975; Sat, 07 Jan 2023 10:51:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673117470; cv=none; d=google.com; s=arc-20160816; b=fybgNMvyBdx8b0dxXV9kp0556iCZO/0kbhZQgneb6gdYdMLSV9XETgbXg+QaOR7XTM dGjiq+3HPYYiMw20xjeF6d/s8Pr8+XlbB5IaJC0Zh0xvA3Cu3Xzh8Ty6rFG2jNzsYNzt BnE5hGuZ79enHDJ5s8m+42R9LxXJZx9Fhf73TrYfh4QIB3LG0J710SB5Rh53dF2f0Tmj 7Q2jtBp/qFXiVTSnSZgXlYOycBaobOLDezszIbOzTTRCr0kUiG8pzU+kuOfDTnr1n+OJ xilVn0QQDc4VgGDIWCShrGq+8v9gxwOtPVXnLkC437NcH0/fgsiBc5kp4NUlTMsThjA+ Jc+A== 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:dkim-signature; bh=NEY3gLZEXX4WZYkSBG8Y3BNi/aeS/CuZ7LY05TbsVxs=; b=uuVxvk43WpKhvrq2oz542Bl6Tb+xfi2dA2zIp0PaUpxSJ4ApNs7yTZvIfyiSGL/Voz LVRJ/djcSYRs91DWfqWl0Ja5LEP37159yRsw5vnRDsfzOqm4v4KOvzYJ4PHsb7gCoIs9 Zz+SSglJLQuRqWmWrssmTX/0/JZ2iJdaWX8qC9wpCjgSQhwCuZV+ABL/zlQcsV4kVLpY 5Ub+VgItJiaC6yasfEKBzfjtSvFBG9lIFWy/DHvXlS2L9oQ91IdzCnC0dGhYW5nsc07H Mv8BZntBMTxjtZCBqjRgb8ZHpLK8ZNEh3PxPzOwlyP2PbKmck4YtBqkEao7Qwp4TPcUj +LTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="A5M+X/hK"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u5-20020a170902e80500b00188712fdf88si4869933plg.46.2023.01.07.10.50.58; Sat, 07 Jan 2023 10:51:10 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="A5M+X/hK"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232726AbjAGSti (ORCPT + 99 others); Sat, 7 Jan 2023 13:49:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232804AbjAGSt0 (ORCPT ); Sat, 7 Jan 2023 13:49:26 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3F321114E for ; Sat, 7 Jan 2023 10:48:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673117319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=NEY3gLZEXX4WZYkSBG8Y3BNi/aeS/CuZ7LY05TbsVxs=; b=A5M+X/hKnsf0KTnxn2tJqyr5SsZI8XLuYaJlT7KXcB7rDu3/y7CHOe9cjBWbojO2t823Ob ZEGgjeIIhHLdHKue0ATFemEJtb5z/GmCJtpquYgkD5PyXdYumI74e4KwyoPGcoVj87ELEA NfQacyhzutsP5t5uJCyXYVZXPNK+wxc= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-630-siy2TH3XNtmurAFkMuGr7Q-1; Sat, 07 Jan 2023 13:48:37 -0500 X-MC-Unique: siy2TH3XNtmurAFkMuGr7Q-1 Received: by mail-qv1-f69.google.com with SMTP id nt2-20020a0562143c0200b004c74f7ec3afso2714155qvb.2 for ; Sat, 07 Jan 2023 10:48:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NEY3gLZEXX4WZYkSBG8Y3BNi/aeS/CuZ7LY05TbsVxs=; b=lGEJjtuBhh/DIv9uYbmi5fiuHjrtXrX/8GmoiBO5FrW7u+VRBI8v2/qnz+RxP4AdYU 1u/RI1tM/kDI/0g73X+FgE3FSALvhAJR2+hRJghocAx4OqHvHRHV3loPQW1t4BJkzKmg tL8DsGRHckpskzsX+ZOwwjBLPK1+wfOHY8mlwnFm84F21eM8IJ/gIcZb4zoxtASX23ET /3QzPhSeLSMA2aVkHuBjEpMMqYldUs6IRZI4DwIMUN39UhMnt7Lphq3j3esvlytuH4he ct5RryxqQ2CyE/Ti/UhLxiAepGwq+NudX0XYYBMA9PsRe2txE53hwzrXMNimsBh8Vxvg jUow== X-Gm-Message-State: AFqh2kqZolmD4a70LLt3fUwtdxAN3ETBziiyeAFILGv4bCr8NccScMKx Q2xNo8DRJHGH4johi1TLs7S25znKJGF9MDk0gRRmXiF5Xuy+HgFSZgN/1mA6n70/ACv7goU3byt JpVNRd2rgzXQ4UMu1PLhBUh6g X-Received: by 2002:ac8:65da:0:b0:3a9:7789:7d1a with SMTP id t26-20020ac865da000000b003a977897d1amr78611122qto.25.1673117316949; Sat, 07 Jan 2023 10:48:36 -0800 (PST) X-Received: by 2002:ac8:65da:0:b0:3a9:7789:7d1a with SMTP id t26-20020ac865da000000b003a977897d1amr78611111qto.25.1673117316729; Sat, 07 Jan 2023 10:48:36 -0800 (PST) Received: from dell-per740-01.7a2m.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id az31-20020a05620a171f00b006fbbdc6c68fsm2535696qkb.68.2023.01.07.10.48.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 10:48:36 -0800 (PST) From: Tom Rix To: ogabbay@kernel.org, gregkh@linuxfoundation.org, dliberman@habana.ai, osharabi@habana.ai, obitton@habana.ai, talcohen@habana.ai Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tom Rix Subject: [PATCH] habanalabs: remove redundant memset Date: Sat, 7 Jan 2023 13:48:27 -0500 Message-Id: <20230107184827.2837347-1-trix@redhat.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754390824991064735?= X-GMAIL-MSGID: =?utf-8?q?1754390824991064735?= From reviewing the code, the line memset(kdata, 0, usize); is not needed because kdata is either zeroed by kdata = kzalloc(asize, GFP_KERNEL); when allocated at runtime or by char stack_kdata[128] = {0}; at compile time. Signed-off-by: Tom Rix Reviewed-by: Oded Gabbay --- drivers/accel/habanalabs/common/habanalabs_ioctl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/accel/habanalabs/common/habanalabs_ioctl.c b/drivers/accel/habanalabs/common/habanalabs_ioctl.c index 619d56c40b30..949d38527160 100644 --- a/drivers/accel/habanalabs/common/habanalabs_ioctl.c +++ b/drivers/accel/habanalabs/common/habanalabs_ioctl.c @@ -1123,8 +1123,6 @@ static long _hl_ioctl(struct file *filep, unsigned int cmd, unsigned long arg, retcode = -EFAULT; goto out_err; } - } else if (cmd & IOC_OUT) { - memset(kdata, 0, usize); } retcode = func(hpriv, kdata);