Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751987AbbD3Kyx (ORCPT ); Thu, 30 Apr 2015 06:54:53 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:35717 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751913AbbD3Kyd (ORCPT ); Thu, 30 Apr 2015 06:54:33 -0400 MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 30 Apr 2015 13:54:32 +0300 Message-ID: Subject: Re: [RFC 1/1 linux-next] gfs2: convert simple_str to kstr From: Alexey Dobriyan To: fabf@skynet.be, swhiteho@redhat.com Cc: Linux Kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1183 Lines: 39 [cc linux-kernel] On Thu, Apr 30, 2015 at 1:53 PM, Alexey Dobriyan wrote: >> By default I used destination type as a reference. Maybe it's wrong and >> we really want to read long, unsigned long from source ? > > long and unsigned long -- no. Always look at type of data. > There are many places where unsigned long is needlessly > used because there is no simple_strtoint(). > > Your patch is OK except block_store() wdack_store() chunks: > >> @@ static ssize_t block_store(struct gfs2_sbd *sdp, const char *buf, size_t len) >> ssize_t ret = len; >> - int val; >> + int val, error; > > There is no need to add second "error" variable and > there is no need for it to be ssize_t: > > int ret; > > ret = kstrtoint(); > if (ret < 0) > return ret; > if (val == 1) > ... > else if (val == 0) > ... > else > return -EINVAL; > return len; > > Overall, this code is exactly code kstrto*() was designed for. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/