From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752343AbcFVId3 (ORCPT ); Wed, 22 Jun 2016 04:33:29 -0400 Received: from mga14.intel.com ([192.55.52.115]:37188 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752027AbcFVIdT (ORCPT ); Wed, 22 Jun 2016 04:33:19 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,509,1459839600"; d="scan'208";a="1002872045" Subject: Re: [RFC] regmap: Add regmap_pipe_read API To: Mark Brown References: <7ca3857aa8869a1e1f4709860f57f7d92abf1c6b.1466089603.git.leonard.crestez@intel.com> <20160621184251.GC28202@sirena.org.uk> Cc: linux-spi@vger.kernel.org, Wolfram Sang , linux-i2c@vger.kernel.org, Jonathan Cameron , linux-kernel@vger.kernel.org From: Crestez Dan Leonard Message-ID: Date: Wed, 22 Jun 2016 11:32:20 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160621184251.GC28202@sirena.org.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/21/2016 09:42 PM, Mark Brown wrote: > On Thu, Jun 16, 2016 at 06:24:36PM +0300, Crestez Dan Leonard wrote: > >> + val = ((u8*)val) + read_len; > > This cast looks broken, you should be able to do pointer arithmetic on > void pointers as though they were char *. > Pointer arithmetic on void* is not standard C, it's a GCC extension. I know that GCC extensions are allowed for the kernel but is it really encouraged to rely on them this way? Anyway, are my concerns about the regmap_bus implementation for SPMI valid? In theory this could be submitted in it's present form and let regmap+spmi users If this API is otherwise fine I can just resend this marked as [PATCH] with the cast removed and some rearranged comments. -- Regards, Leonard