Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp177073pxb; Fri, 16 Apr 2021 02:50:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1eWs4oAysuBbfJFzJt0Vc+FBUB/nAOTwSfE4iD9r03jeXyMK13ACCRyDzHsqoe/QRYGpG X-Received: by 2002:a17:90a:fa84:: with SMTP id cu4mr8964087pjb.2.1618566619800; Fri, 16 Apr 2021 02:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618566619; cv=none; d=google.com; s=arc-20160816; b=XDGhI6y4Iz8v0Ww0o8U3GLvPahcMz6fsj6SeRFtgam5+P+lVOfztUW723WPa0e3WQ5 CB4npGD4YN5VFF/bFca9N/0SJ8M/MEA/yMtNkY5E9/00ctzwoZGlNejuYoqTHfsShQEo sR00oEX9HVZAKYZe4vg34ih+0eiR3I95fN0dyP7LIxTnTOTN5sQdwp25KRSQFLzTwp9w 2F/4pQEiNR8vUe8gNRbzYHIGR8Y/SIVznG4aKrT8LyVxRyat8QeN+nWiNq8v2IQHjvkW N8nLkq8/xe2Z1YLkjCbmlcdEfpSmqnK4qJE4tRg9WZFlbMWBaWDsBgypeE+Yu8T+D9Py JjBg== 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=w+SWBg6vyMpiCnh+pmxIKMewgtfrKgyoDu1G+uKhgXY=; b=VjRMi3Y7V+aKI++wN4we4iWDT+56633zytI+E/x9oLo9neu0FvZ+cHdmMy/zmKTgzY 68uwc9qlf2bpMU+JT608MDFMYdGxXsFD+YTlVeNtjh/i8AfmMilT26VwCB4bZRTeZwNS cG1zj6NAsxr5okzKhmvR7iOykWJGcQSx7o8QAPvRvnRXhX0CXvmIpFdr0ey2XZG2nUYl e0ZCLYutCfAEbZXRFuCfQICtRot2zh+nyyDXP1cDDXFrVjm19GWGb8/lltai/yY7C3pD WLzmecF2lmFMPldqzio0vuoIq5SR00LZ74lacQdy4gymijVOt+FYrKvn0rQhPenpPPf5 Mqdg== 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 na14si6376758pjb.60.2021.04.16.02.50.07; Fri, 16 Apr 2021 02:50:19 -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 S240486AbhDPIgK (ORCPT + 99 others); Fri, 16 Apr 2021 04:36:10 -0400 Received: from mail-qt1-f172.google.com ([209.85.160.172]:43602 "EHLO mail-qt1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240464AbhDPIgG (ORCPT ); Fri, 16 Apr 2021 04:36:06 -0400 Received: by mail-qt1-f172.google.com with SMTP id i6so10642946qti.10; Fri, 16 Apr 2021 01:35:42 -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=w+SWBg6vyMpiCnh+pmxIKMewgtfrKgyoDu1G+uKhgXY=; b=Gvd5U83C5yAmbzFGgWs3hrDnIXYi4wszHRWe15B1/4Saig01uy+40zvG2c+htkZgsA NeksPHgm4s7xOXGhkmX2IKW3h6QFiqQPgYTn18Aaj+PhBpGQzDbgIPSfm+3d74AfZSPQ 7k1l+ltc3rnR7ozh4C3w1RMSClRfYTOgjG8Zuyo/Mh7c6K7/vmhUg7aVkiawsMPsldYj 8IVDetaMYM40i3QkBo4Dk9dFZ3wsohpVvg2A9GKkscSlndrIbaOSry5hZQ4UFf3GaHXs HmQ1qIb7h1Ws7J0XJQM+V34FNabld5krLsN8gedTMmsi5ax6Lf8lkdg+sBR6qwiT9XIq 0h+g== X-Gm-Message-State: AOAM533S8v8RDoo4zgZ32yZEo14050rBB07/rjKvvLoVIsi9/YDGhkDM LIaM4wON67NNV8IGM50oBedQv9qG1BI3jg== X-Received: by 2002:ac8:5cc5:: with SMTP id s5mr6854950qta.15.1618562141372; Fri, 16 Apr 2021 01:35:41 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 01:35:41 -0700 (PDT) From: Denis Efremov To: linux-block@vger.kernel.org Cc: Denis Efremov , linux-kernel@vger.kernel.org Subject: [PATCH 4/5] floppy: cleanups: use memcpy() to copy reply_buffer Date: Fri, 16 Apr 2021 11:34:48 +0300 Message-Id: <20210416083449.72700-5-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 memcpy() in raw_cmd_done() to copy reply_buffer instead of a for loop. Signed-off-by: Denis Efremov --- drivers/block/floppy.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index c58b0b079afc..c584657bacab 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -2988,8 +2988,6 @@ static const char *drive_name(int type, int drive) /* raw commands */ static void raw_cmd_done(int flag) { - int i; - if (!flag) { raw_cmd->flags |= FD_RAW_FAILURE; raw_cmd->flags |= FD_RAW_HARDFAILURE; @@ -2997,8 +2995,7 @@ static void raw_cmd_done(int flag) raw_cmd->reply_count = inr; if (raw_cmd->reply_count > FD_RAW_REPLY_SIZE) raw_cmd->reply_count = 0; - for (i = 0; i < raw_cmd->reply_count; i++) - raw_cmd->reply[i] = reply_buffer[i]; + memcpy(raw_cmd->reply, reply_buffer, raw_cmd->reply_count); if (raw_cmd->flags & (FD_RAW_READ | FD_RAW_WRITE)) { unsigned long flags; -- 2.30.2