From patchwork Tue Jan 11 17:04:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Keeping X-Patchwork-Id: 1578576 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=metanate.com header.i=@metanate.com header.a=rsa-sha256 header.s=stronger header.b=ode3jrL7; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JYHBF67Sgz9s1l for ; Wed, 12 Jan 2022 04:05:07 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3A43881879; Tue, 11 Jan 2022 18:05:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=metanate.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=metanate.com header.i=@metanate.com header.b="ode3jrL7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2350A82A71; Tue, 11 Jan 2022 18:04:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RDNS_NONE,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from metanate.com (unknown [IPv6:2001:8b0:1628:5005::111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AEA8880562 for ; Tue, 11 Jan 2022 18:04:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=metanate.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=john@metanate.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=Content-Transfer-Encoding:Message-Id:Date: Subject:Cc:To:From:Content-Type:Reply-To:Content-ID:Content-Description: In-Reply-To:References; bh=QTSa0OM/45Fvpxvg9Gh+ywyS0hJAorNEoiiWjtUay84=; b=od e3jrL7t3cTMwWh77B8LABspnhy+nvfKF8ktx6Lgu+c2gcrS6GKnueBVwfqSxymt8RUojHDe9LHyuH rqqYgwG6owCv5M8ys2wuy4io5h+wN7HAv6u3Fv6LGQ5+m08UM2/2PCPxDmVN7B2m1Hg665a9yzHec XgxOzvm/O0Cqt1NHH2g9TJXeUoebcIwThJMHXWYfTTcYwT0ZujDtjlvQtK/sx4yTQHofnbK4JI8C8 wFAxPmxS91Iq+tjhleXQ34QaISl8qQcj3PzffLV6nZbYwOwDSzOvm6kDytvwpEHgCRyLPNIz54gjk ISq2rz38+z1mtpYq1fG5Dha6Ni+BzY5g==; Received: from [81.174.171.191] (helo=donbot.metanate.com) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1n7KZr-0001B1-L6; Tue, 11 Jan 2022 17:04:55 +0000 From: John Keeping To: u-boot@lists.denx.de Cc: Simon Glass , John Keeping Subject: [PATCH] misc: mark write buffer const Date: Tue, 11 Jan 2022 17:04:49 +0000 Message-Id: <20220111170449.2514811-1-john@metanate.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Authenticated: YES X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean The write operation in misc_ops already takes a "const void *" buffer, but misc_write() takes a mutable "void *". There's no reason for this, so make misc_write() consistent with the standard write() prototype. Signed-off-by: John Keeping Reviewed-by: Simon Glass --- drivers/misc/misc-uclass.c | 2 +- include/misc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/misc-uclass.c b/drivers/misc/misc-uclass.c index cbfacc3801..cfe9d562fa 100644 --- a/drivers/misc/misc-uclass.c +++ b/drivers/misc/misc-uclass.c @@ -26,7 +26,7 @@ int misc_read(struct udevice *dev, int offset, void *buf, int size) return ops->read(dev, offset, buf, size); } -int misc_write(struct udevice *dev, int offset, void *buf, int size) +int misc_write(struct udevice *dev, int offset, const void *buf, int size) { const struct misc_ops *ops = device_get_ops(dev); diff --git a/include/misc.h b/include/misc.h index 82ec2ce793..6f042625c9 100644 --- a/include/misc.h +++ b/include/misc.h @@ -28,7 +28,7 @@ int misc_read(struct udevice *dev, int offset, void *buf, int size); * * Return: number of bytes written if OK (may be < @size), -ve on error */ -int misc_write(struct udevice *dev, int offset, void *buf, int size); +int misc_write(struct udevice *dev, int offset, const void *buf, int size); /** * misc_ioctl() - Assert command to the device, optional.