From nobody Tue Feb 10 03:40:36 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1593189298; cv=none; d=zohomail.com; s=zohoarc; b=X1KZri3qMRgw/WbyUgpyoTi7h4y4Q/J4c+2T2ih03OVUgeZDsFuvZABsJ4ktxYKM7aAGFHK/8FebHFTwu6aMupHFvyJsaE82+f3A2+29SEDt8g+JXoWcXZH9pHkOgsgRdacibRIaspLltng3WdYn+jfagyvsa8Sv3MW06igAuX8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593189298; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JbDqgfPHpizj2Xr97jabygp2Vi8eQjOpNs5caV4op9Q=; b=HanTcip9zDffRPyfc+pZc8rIlC7QF68RQnRHekx3Q7sISAXwWZM0hiHCu9loEdCXqsA94S+9mVWriAXSx8x1ORLcQUAeWn/YII3SMFhaFKivnt8KyodCTcQQwNLYdr+WHORpIhVj2zvLJv/eA8zXrP527RIXGOboOjp7xIZ34Mo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593189298264782.8663237528588; Fri, 26 Jun 2020 09:34:58 -0700 (PDT) Received: from localhost ([::1]:47278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jorJY-0006fN-Sg for importer@patchew.org; Fri, 26 Jun 2020 12:34:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jorDP-0005ep-Eb; Fri, 26 Jun 2020 12:28:35 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:47036) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jorDO-0003M7-02; Fri, 26 Jun 2020 12:28:35 -0400 Received: by mail-wr1-x442.google.com with SMTP id r12so10025024wrj.13; Fri, 26 Jun 2020 09:28:33 -0700 (PDT) Received: from localhost.localdomain (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id 12sm4867255wmg.6.2020.06.26.09.28.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 09:28:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JbDqgfPHpizj2Xr97jabygp2Vi8eQjOpNs5caV4op9Q=; b=ZZxJPx41H/UkyyTgJmq9CsOhjw9pZVvtam7IX/v4TM7ifyEbYVMWIjowqONG6Iu96E vNne6Q3HWHDYEZ1xa+uzMLplzXCLZc4PGgHpvG+AVOiL+1+uEm+DNy1QdeGi0ENG75oI /jec3YSsxJ+HkCkNmjRo0wr2FUkVJ51fE97KJmn9698MjrjFaHouggf6bBLYtEFSi+av J8wcZCMMSDruu4rQG+I1+sfLr8n3KZHjg98mo5Ka7YSlfFWLnXTLlRsuFBSrrQ2mTQHA WNLDBf9mqlsuM9uqPqEb5mjdD7V60O3a+Rrmjk1YXNI/yQN1Fifinjuv3HXdm2EkNLlv 2QlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JbDqgfPHpizj2Xr97jabygp2Vi8eQjOpNs5caV4op9Q=; b=ASYNN1r2AGFlp+8xBrl6xuBd5LtOjGAiYdtNLVmjqalKiCnN141fqZr7OB5qRelDcz b83dbgpYNjeuxSnp4G/c1TxsnewQPxMj0l5p5bfAXYOqkN6a1yNaHQ+LozIkguO8BiuG vRF17G2JMwyWh0P9+Vzj+BiypYnkE5c3pbm6um/MVOV/eWilexqdMgzm2lqs+IIUBpXZ KCNdRH8F9huOYPEl42GJOIBL/lJl5Y/qfzKnDf2AZk6hZqtFAvG0uBVlJkkjxNjPiSGN TUrXTfFBl/uE1R1wcqseB5Zd2iQATeqDUoROKurSFG8yFYuy0XXRl//6ApXweCfH/+YU U9uw== X-Gm-Message-State: AOAM530uD0+copJp/cS68E82c25/n17XRC5K4vus4R4Olmt6AI7L+LWx kk5Q3RnXZy17eC1TggIBJd3X/nU2 X-Google-Smtp-Source: ABdhPJwPpDsDCj1k8H5EKnGvTCUUHTsCVV0utlAE0FFIAmbmtRo4I636sFB2cps9EmDC8SU8+3Ou4A== X-Received: by 2002:a5d:630d:: with SMTP id i13mr4671593wru.208.1593188912169; Fri, 26 Jun 2020 09:28:32 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v4 10/14] hw/sd/sdcard: Constify sd_crc*()'s message argument Date: Fri, 26 Jun 2020 18:28:14 +0200 Message-Id: <20200626162818.25840-11-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200626162818.25840-1-f4bug@amsat.org> References: <20200626162818.25840-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::442; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: Peter Maydell , Alistair Francis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) CRC functions don't modify the buffer argument, make it const. Reviewed-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/sd/sd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index b887dce0e1..a0500f4551 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -255,11 +255,11 @@ static const int sd_cmd_class[SDMMC_CMD_MAX] =3D { 7, 7, 10, 7, 9, 9, 9, 8, 8, 10, 8, 8, 8, 8, 8, 8, }; =20 -static uint8_t sd_crc7(void *message, size_t width) +static uint8_t sd_crc7(const void *message, size_t width) { int i, bit; uint8_t shift_reg =3D 0x00; - uint8_t *msg =3D (uint8_t *) message; + const uint8_t *msg =3D (const uint8_t *)message; =20 for (i =3D 0; i < width; i ++, msg ++) for (bit =3D 7; bit >=3D 0; bit --) { @@ -271,11 +271,11 @@ static uint8_t sd_crc7(void *message, size_t width) return shift_reg; } =20 -static uint16_t sd_crc16(void *message, size_t width) +static uint16_t sd_crc16(const void *message, size_t width) { int i, bit; uint16_t shift_reg =3D 0x0000; - uint16_t *msg =3D (uint16_t *) message; + const uint16_t *msg =3D (const uint16_t *)message; width <<=3D 1; =20 for (i =3D 0; i < width; i ++, msg ++) --=20 2.21.3