Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp637389pxb; Fri, 16 Apr 2021 14:24:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwNf1AzfG1bKptBP9IeCKMECkn5g++UxPSWrKfLiyg24V3riAhCwN82lQAT7CY2/I/zB0M X-Received: by 2002:aa7:95aa:0:b029:256:143:e5d8 with SMTP id a10-20020aa795aa0000b02902560143e5d8mr9417596pfk.67.1618608298740; Fri, 16 Apr 2021 14:24:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618608298; cv=none; d=google.com; s=arc-20160816; b=ja0Gb0wHLPN8H7ZbILlPM+VpLLnhZjU6DCO/c8FWQxbwVOXoeRHuwv4ky+QmHbFPJt DhCM+jMBYW7d6cw80fHLiGX+IXz/9ntOj5oWbSkRCWJoFFGY/QAeUgABfGsKWNDyB409 P7AuHuAT06+ajhMGQ6GaZwCQUAP/U0dqrsGHUXps8ZVAtIJwSdowo9NbH1TImzS2U/jQ ZM7hFGru/aI8PuvB3UdIPX07/5Zvl/JhkrIwWF51kAa4kdiMz3W4ptulkubpKK/Tpixl JkKDeT4cFZFbAIIHsMMErSMnG7hEfy7BXOr5HuciULZfoMdc6AxHp/76kdO1RnDC7JBE /I0g== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=Q5fHn+JTcUnD2SystmVcK37lyq7acyF7LXyDG6VJu4I=; b=oNclTVCtqlt7qajZ48WlrDSBS6HXRKaEruQmol6CSuByN1UKXV3As761DB+8QC3TZq cSRnBs92L4dLqlbdLhqYdbMY9N5Np1snl1ojYwnjCr5tgPow/pHWXri4Qj5SENSLgWQJ dg6dkiXP0w4q+M4jaqrTeTCGz1vmmF5CrYZHy6KRfXiN3s0yjsK6ZGCWCSVL/hkUGmBz tpp0NVxUS97pI3fTL5AVZIqVzz2YXFeBs0WPzM8zo/VqbYV5d7mgA1OYYkocQt53wbZ7 90gqxE8TJKdJqywG1o4Ed4C9XGFEYClkmbQoUoNlrMqYA9LaaIR478UG/PEJJ/AOgeJq mEtA== 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 n2si7150423pfu.26.2021.04.16.14.24.46; Fri, 16 Apr 2021 14:24:58 -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 S239081AbhDPSeG convert rfc822-to-8bit (ORCPT + 99 others); Fri, 16 Apr 2021 14:34:06 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:40121 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236085AbhDPSeF (ORCPT ); Fri, 16 Apr 2021 14:34:05 -0400 X-Originating-IP: 90.89.138.59 Received: from xps13 (lfbn-tou-1-1325-59.w90-89.abo.wanadoo.fr [90.89.138.59]) (Authenticated sender: miquel.raynal@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 8C4C7C0003; Fri, 16 Apr 2021 18:33:37 +0000 (UTC) Date: Fri, 16 Apr 2021 20:33:36 +0200 From: Miquel Raynal To: Tudor Ambarus Cc: , , , , , , , Subject: Re: [PATCH] mtd: core: Constify buf in mtd_write_user_prot_reg() Message-ID: <20210416203336.388878ad@xps13> In-Reply-To: <20210403060931.7119-1-tudor.ambarus@microchip.com> References: <20210403060931.7119-1-tudor.ambarus@microchip.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tudor, Tudor Ambarus wrote on Sat, 3 Apr 2021 09:09:31 +0300: > The write buffer comes from user and should be const. > Constify write buffer in mtd core and across all _write_user_prot_reg() > users. cfi_cmdset_{0001, 0002} and onenand_base will pay the cost of an > explicit cast to discard the const qualifier since the beginning, since > they are using an otp_op_t function prototype that is used for both reads > and writes. mtd_dataflash and SPI NOR will benefit of the const buffer > because they are using different paths for writes and reads. > > Signed-off-by: Tudor Ambarus Applied on top of mtd/next after the merge of all our internal PR's. Thanks, Miquèl