From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753525AbcIPIlb (ORCPT ); Fri, 16 Sep 2016 04:41:31 -0400 Received: from verein.lst.de ([213.95.11.211]:59497 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751257AbcIPIlX (ORCPT ); Fri, 16 Sep 2016 04:41:23 -0400 Date: Fri, 16 Sep 2016 10:41:21 +0200 From: Christoph Hellwig To: Andy Lutomirski Cc: Keith Busch , Jens Axboe , linux-nvme@lists.infradead.org, Christoph Hellwig , linux-kernel@vger.kernel.org, J Freyensee Subject: Re: [PATCH v3 2/3] nvme: Pass pointers, not dma addresses, to nvme_get/set_features() Message-ID: <20160916084121.GC2415@lst.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 15, 2016 at 10:24:20PM -0700, Andy Lutomirski wrote: > Any user I can imagine that needs a buffer at all will want to pass > a pointer directly. There are no currently callers that use > buffers, so this change is painless, and it will make it much easier > to start using features that use buffers (e.g. APST). > > Signed-off-by: Andy Lutomirski > --- Looks good mostly good, but a nitpick below: > + /* > + * Casting buffer to void* is safe here: __nvme_submit_sync_cmd knows > + * that we're writing because it decodes the opcode. > + */ > + ret = __nvme_submit_sync_cmd(dev->admin_q, &c, &cqe, > + (void *)buffer, buflen, 0, NVME_QID_ANY, 0, 0); Cant we just drop the const annotation to avoid these casts?