From patchwork Sat Jun 19 17:26:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 463879 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1019251jao; Sat, 19 Jun 2021 10:30:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/JmiK18hHGEYFlOFTE//bOMMiS4E0KIbz0xSN9mMw5tw+MPR1PE0S2YHpf00cb8e4yNU6 X-Received: by 2002:a05:6602:38d:: with SMTP id f13mr12980021iov.109.1624123814437; Sat, 19 Jun 2021 10:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624123814; cv=none; d=google.com; s=arc-20160816; b=tZGwuNNAsv6eoIA1BNczS8uYIdJi0Aem7qJsTUvk24ZmHL0ClQoDCySSpp5s7RzH6l iWEo/Bj5v/KJ276R31BjC11bOF3WALvSS2pzGDLLdQz4xfM+5kwdtviVlBlZNf/ffN96 RunQbO0bZSdlOLRJ2tkrZuLEKBk2Y3jYxeZVKtOFEWH1uam5L2zjOx/hRSpX35OKf/MG x/E5PVG+gx4giR9Gaa2DpNzhIuo4GKKIw5aq2s4Dwsv0gU4pRQx6ZRxk/m5miL0lhyU6 olxn6FuJ1XXvKx/gMEKeEmeir+0Ulfl1wF2I7s/F1r6zrLzcIbabhj+lx8JJ47QDS/jo tpeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=4DqfBYyC7ObKfbG1l0o4eNafS1Tj4TIv+YV4IdJQSPo=; b=z4rYOv9pcfwFERUUgBQyvSN37DQo66J3jWVO5lEUDLtSkQiDwkCVGoZsQ/S8cZhy7i frgBMpzFoDzaPCOfnMvqdSE6Lf4gu40x/DIaa+EA2H+Yg6QCz5HtePra8HggS5e2UGRQ iOMs1dRYTwtobAVt6K788f/5MatXVUOjLvjoq1UbCxx0wipFojhLfdCTN+nAMUFqeUHA ky6e/nzoqD7YsbscgpeDJiT3ue0xX2+ovLboMcCA0xB+pelxlSMoAOO2GFz3fv3/yan7 WYGMChkHNYGXfYnX6yczvrysYvMGdXXhD+XBEJLDkNVSKR/QLJCJ5boJxTH2tWmkF87m +2Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="l2vev/ws"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w14si3222362ilg.134.2021.06.19.10.30.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Jun 2021 10:30:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="l2vev/ws"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1luenN-0000v9-Qv for patch@linaro.org; Sat, 19 Jun 2021 13:30:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luejr-0003Sm-Nq for qemu-devel@nongnu.org; Sat, 19 Jun 2021 13:26:35 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:38597) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luejq-0003aU-6G for qemu-devel@nongnu.org; Sat, 19 Jun 2021 13:26:35 -0400 Received: by mail-pg1-x534.google.com with SMTP id t17so10538602pga.5 for ; Sat, 19 Jun 2021 10:26:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4DqfBYyC7ObKfbG1l0o4eNafS1Tj4TIv+YV4IdJQSPo=; b=l2vev/wsBIu24+tueVFV7HZGAuMEDul93jt+Q89bB7LcdutySDUupFnMAcmgcAXjWc vVZwx0N08XkJikZOp+4z2m8ayhXJQoKlhSklb8l406FthQKEOJYMJp4SXiRB2xL2tNK3 yT8SLpwzrTVdxPa+fMrr/SnmkF5SlgFSP9mH3YuKLFCFnu3wwrdkBleqrIQzfKFyVUkZ 2j6vYjFQoYviLZFqBc4AO6HSZ83JHr5Zwb1pKx9WOJoPAbL6WzPPLawBcO6EtUBkxvEM XP62I9HVSCKJyUmZAsVh/1Ez9G3t3a5JBoQgw0kQ6s7HM8941xHimi1bgkG/toF+FbqB QBHA== 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=4DqfBYyC7ObKfbG1l0o4eNafS1Tj4TIv+YV4IdJQSPo=; b=l/BkdX6lyZ1LOvby88SUhjN3DPMEej86uEhA8lWU/ABptblO0w/gcN1ijWMn8LZ0Oe EZo5q7M1szhWcRplA67QdtT5JhkKDCkhqavJ1pb9YcowYV+f+UQ43A0XFF+iLupwSgUW LaTH/Sv+Wbc5yyMw1lPds4hVJ/M3IpqJc/EjoNwyAf62DNj05kxd5NjjuM5UdpGJvpuG ZKJmOeWC3Lzkokknk6ePKnZjnfyOoi+hu7agDcxIhEq7gK8d0CXNMXLtzZ7AXf3RIYrN DPbYjp/ZHNB4FMIESTFsD5qo9rU4hCaRsoGni8ravk3CFAmy0W5BwOKGSfPe66zpamhm oxBA== X-Gm-Message-State: AOAM533Ts3UaXk7C1eqMNxvg1PM7IKI5e9u2WA5jseUqiF/xE0y8Oapy b2GDZyAsBBv45hbqWGYEU7NjSeIj7ZyTxw== X-Received: by 2002:aa7:96e3:0:b029:2ec:e8a1:3d66 with SMTP id i3-20020aa796e30000b02902ece8a13d66mr10926914pfq.79.1624123592978; Sat, 19 Jun 2021 10:26:32 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id co18sm2084241pjb.37.2021.06.19.10.26.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 10:26:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 08/15] hw/net/e1000e: Fix size of io operations Date: Sat, 19 Jun 2021 10:26:19 -0700 Message-Id: <20210619172626.875885-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210619172626.875885-1-richard.henderson@linaro.org> References: <20210619172626.875885-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , Jason Wang , mark.cave-ayland@ilande.co.uk, f4bug@amsat.org, pbonzini@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The size of the operation is an argument to the respective functions, and has nothing to do with sizeof(val). Cc: Jason Wang Cc: Dmitry Fleytman Signed-off-by: Richard Henderson --- hw/net/e1000e.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index a8a77eca95..ea3347fbb4 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -145,7 +145,7 @@ e1000e_io_read(void *opaque, hwaddr addr, unsigned size) return s->ioaddr; case E1000_IODATA: if (e1000e_io_get_reg_index(s, &idx)) { - val = e1000e_core_read(&s->core, idx, sizeof(val)); + val = e1000e_core_read(&s->core, idx, size); trace_e1000e_io_read_data(idx, val); return val; } @@ -171,7 +171,7 @@ e1000e_io_write(void *opaque, hwaddr addr, case E1000_IODATA: if (e1000e_io_get_reg_index(s, &idx)) { trace_e1000e_io_write_data(idx, val); - e1000e_core_write(&s->core, idx, val, sizeof(val)); + e1000e_core_write(&s->core, idx, val, size); } return; default: