From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755544AbbJARLP (ORCPT ); Thu, 1 Oct 2015 13:11:15 -0400 Received: from muin.pair.com ([209.68.1.55]:52032 "EHLO muin.pair.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753401AbbJARLN (ORCPT ); Thu, 1 Oct 2015 13:11:13 -0400 Subject: Re: [PATCH v3 1/3] powerpc/512x: add LocalPlus Bus FIFO device driver To: alex.popov@linux.com, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Anatolij Gustschin , Rob Herring , Grant Likely , Dan Williams , Vinod Koul , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , linuxppc-dev@lists.ozlabs.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <1443115737-3948-1-git-send-email-alex.popov@linux.com> <1443115737-3948-2-git-send-email-alex.popov@linux.com> <56049CD0.7080104@tabi.org> <560C5325.6070406@linux.com> From: Timur Tabi Message-ID: <560D692E.1010309@tabi.org> Date: Thu, 1 Oct 2015 12:11:10 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <560C5325.6070406@linux.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/30/2015 04:24 PM, Alexander Popov wrote: >> Can you test for "!cs" here instead? >> >>> + e = -EFAULT; >>> + goto err_param; >>> + } > > Unfortunately no: 0 is a valid value for Chip Select. > Is it OK to leave it like that? Yes. >>> + lpbfifo.ram_bus_addr = sg_dma_address(&sg); /* For freeing later */ >>> + sg_dma_len(&sg) = lpbfifo.req->size; >> >> I don't think sg_dma_len() is meant to be used as an lvalue. > > I've double-checked and found many cases of such usage of this macro. > It seems that I can't avoid it too. Ok. >> Driver code that has to parse #address-cells or #size-cells >> is usually wrong. > > I would not call it "parsing", I just check whether the dts-file is good. > Anyway, could you give me a clue how to do better? You should use of_n_size_cells() and of_n_addr_cells(). --