Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp176999pxb; Fri, 16 Apr 2021 02:50:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpmWaHfkzZOZKh35Fc7gRm45EXxr/3R2aKEedLfQd7ALlE33MWo1R6HDvkkOSGPBzTVwB3 X-Received: by 2002:a17:90a:7a8b:: with SMTP id q11mr8920047pjf.215.1618566610848; Fri, 16 Apr 2021 02:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618566610; cv=none; d=google.com; s=arc-20160816; b=LlQ9EaE0Mq3RB7PncwycVnQphbGZjn+F1T3p0vdnvYjcaRDo7EakSKedkdFj3r5bVk O35kKsFHwpTE+ly2rkHMWjEus+Edj/Ggc6bT1hl09DEjcZ7hEOZ6Ura/mBqU7oVcHNDS U+dr8kokKAV1DArQK/CJgUihvfBewbdEvOFkkCN1exKVOf85NTZkpAAwGNSC3qsyIKTW yO9JCYCVZxR98m5iil6IRk9Axwgh/ukDmhOzPm8Bq4nmKpKoJEhKbG2q4UuZFdBzpK8B BcOsC77149Bp0f216xl5UvbWDCz/QJ4c/91yVtmDfeYPp8ttw+jZ9/B2EYT7E0wlo8Fx 8nug== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=iaWCqAz1Lh0K+YMS2Sm/+2KskMbWPrmtR34tefX2FCk=; b=z1vN5KPCrHVfA4WCRJ87se4s+n5tE3Ch7p7CKlghT/+C2Igi2HEKdbUSM11L6L/wJQ fpQMu2mHCcqiSpiycnxuFFDegmmrEsW0mos68+1ya5qJI6utvBSBnVIRysiwB6xEfnCT cNuzeOlkPWKfjPhpQKsWgZsE6CCyZAqC9c0bobl2HBWNTP/qAMqq//w8ZYFNfhGz+Tnk BGsWXW7uVx76FEWQcbsLfAj6ZAYQ/hzCjeE9kd42aKKlBGgUG/12dEuEjlE7mdzs24k1 EvshJiODlr5xVdh5bdOnCVcrQei12qLxQeFJRiTxQ8Df4mBN4cbIeiK19JqLMidEcqT+ pBIA== 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 k15si6821111pgt.20.2021.04.16.02.49.59; Fri, 16 Apr 2021 02:50:10 -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 S240473AbhDPIgF (ORCPT + 99 others); Fri, 16 Apr 2021 04:36:05 -0400 Received: from mail-qk1-f180.google.com ([209.85.222.180]:41828 "EHLO mail-qk1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240464AbhDPIgE (ORCPT ); Fri, 16 Apr 2021 04:36:04 -0400 Received: by mail-qk1-f180.google.com with SMTP id f19so10362059qka.8; Fri, 16 Apr 2021 01:35:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iaWCqAz1Lh0K+YMS2Sm/+2KskMbWPrmtR34tefX2FCk=; b=iyVx6eVu2hf25UrvagyrvhCGGIwedPrpvdGcALNQumi2a5lYx18aAvRxraDTIz5SyC RE4AXtr1Lomo8kfpiVCwGlHn7/ujJeRypo8i7II0AjkW/+c7+Kw+8XaM29EFKK5L15ti ZTlURXeJiaIpF4r6IOhFiOElQrFCEsLJZNACJn6rfCgH9Aq5DgFAMCPnWDFt20wGovgI XY3CLXoSJEsrcDkCEKawvIjsknFYueZ8w2+Wjt6pslChbvEBG1ppKHVWrIZB1538Ta2Q XaiN0BywTNY2OYgaBQJEdAXaYcAyjRlf1eNLzGkWMHVTw0S8lqgo1WexmV/mthhFGSh+ UZJQ== X-Gm-Message-State: AOAM533DfO5VCg6w4FD4mFIz5TJR1mNdWlcKhcRjZmRYy7Ibh1JVCCRf cxD7dYuWOnve+TJFMO32EJA5hWPs6wFGQg== X-Received: by 2002:a37:695:: with SMTP id 143mr8039369qkg.217.1618562138773; Fri, 16 Apr 2021 01:35:38 -0700 (PDT) Received: from black.ru.oracle.com (broadband-188-32-236-56.ip.moscow.rt.ru. [188.32.236.56]) by smtp.googlemail.com with ESMTPSA id k17sm3363778qtp.26.2021.04.16.01.35.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 01:35:38 -0700 (PDT) From: Denis Efremov To: linux-block@vger.kernel.org Cc: Denis Efremov , linux-kernel@vger.kernel.org Subject: [PATCH 3/5] floppy: cleanups: use memset() to zero reply_buffer Date: Fri, 16 Apr 2021 11:34:47 +0300 Message-Id: <20210416083449.72700-4-efremov@linux.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210416083449.72700-1-efremov@linux.com> References: <20210416083449.72700-1-efremov@linux.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use memset() to zero reply buffer in raw_cmd_copyin() instead of a for loop. Signed-off-by: Denis Efremov --- drivers/block/floppy.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index df5c32900539..c58b0b079afc 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -3090,7 +3090,6 @@ static int raw_cmd_copyin(int cmd, void __user *param, { struct floppy_raw_cmd *ptr; int ret; - int i; *rcmd = NULL; @@ -3109,8 +3108,7 @@ static int raw_cmd_copyin(int cmd, void __user *param, if (ptr->cmd_count > FD_RAW_CMD_FULLSIZE) return -EINVAL; - for (i = 0; i < FD_RAW_REPLY_SIZE; i++) - ptr->reply[i] = 0; + memset(ptr->reply, 0, FD_RAW_REPLY_SIZE); ptr->resultcode = 0; if (ptr->flags & (FD_RAW_READ | FD_RAW_WRITE)) { -- 2.30.2