Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp227584pxu; Tue, 1 Dec 2020 09:45:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqEhMY0JnqgDSrdcPTmvM3/XZR3NmQJVqj9qDdYQ4p3YpvsenNFAyuWEX/6d4ZhP2+Zv2a X-Received: by 2002:a17:906:3401:: with SMTP id c1mr4097206ejb.533.1606844737671; Tue, 01 Dec 2020 09:45:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606844737; cv=none; d=google.com; s=arc-20160816; b=w0nkdotAz/8tcL9LRwffNJa8KfQc1qBOf761kLw9NggI0RGF1l8i+ArlkDn1Qx+xPb clfc8mz83UzeDTpmvA4c7Wa6scB33fzjXSlOrOsytiM/wdLJG8qYXBwOObgnYX4cKQRw +FKyEPDvtfNjFbDmKyxu3m18Ty6DgmteveHesltsgpr6XaTA2V9ibK8Bv1D1oWcEP4AQ BzfOAHc+51AvSwVWCBsVrXLOpaI4qWwuUZVic831A79kqqHGVHg0hYYyyCBzJWB9dBwq 6SSvaJqaSL/Wc+tjdqmPNhncHyyiy/mqv/XK0pe72t7KYGijCmJVWBQbvJJR8iyD9JZY UkJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=3OqCrRcXaOGImpl3brdE8L65SCR5lmtKJXYjgl2sOKo=; b=XuZomBo5JdKdHj4TbzI1gilMBHNQ5GxXA9626Y2e9gtjswmCK8rbPobglwCjsDrRvN wIHl47Ka0bnZDEMo7xcHOHNzp1gwVDJwS7/Rt4wvWuGTwyfhkkWIQDieevyJ8dl+WH2f g+HQtUI7O0r7hWpz2aaRx3ixPal6MsEVGTFZfuyvVy63Vlc3J7cJ05s1Di5W4NWnrh6o iyGw0akXbjJavUHjl4STZWDqXZ+lM64QzoF08O4bk/lKAvRomu2Ls/mJsqzD8eydRVyv tQ120zUwG+O16cbR/CmuCQlYtQ8Xt3qS9QmyInxBp87/y+3Pz36ZO/FCDbjxY04S9rPe nkHw== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l26si338498ejd.258.2020.12.01.09.45.13; Tue, 01 Dec 2020 09:45:37 -0800 (PST) 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729351AbgLARnX (ORCPT + 99 others); Tue, 1 Dec 2020 12:43:23 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:41434 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726104AbgLARnW (ORCPT ); Tue, 1 Dec 2020 12:43:22 -0500 Received: by mail-lj1-f194.google.com with SMTP id y7so4330271lji.8; Tue, 01 Dec 2020 09:43:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3OqCrRcXaOGImpl3brdE8L65SCR5lmtKJXYjgl2sOKo=; b=WGDqXbOOvHZMUxWytfnleZdViam+5EcPuewU3BAI9t1pfm3vPf2ZdkbN690KcqUKsz iMgO0IQa2JdZmelmox76KkaiAp2pER3KOtFhXJ+GgyK9LBJohbi0ZrLGrGN07js3FpEL 7hgFlGKDDhC42UtpXWWppnloejLbRV2H2dTA/kxHb2DDYz3YizQdSeXqqHbRCrrfSncL xhbE4tmJN5uIoQn4JGO8YRWJDZT6JVTlpCyveaBJQ5uM2mmhAnda9SYyqaZGaQTZqhAV xfrEmMsWUIpFgZFRpeKAJ3fsJpBr0bcBZbwFpaoDMvmq7yZ0/fnkRVEAiAttEOOWtvHK HGNg== X-Gm-Message-State: AOAM530p/0U0I2whroKn/pIOUUqoObcY5KgjJYJvymYjHkvk0rsh+NPw OfzhMhNxOmuWT674JnpNiXw= X-Received: by 2002:a2e:9bd2:: with SMTP id w18mr1965743ljj.312.1606844559186; Tue, 01 Dec 2020 09:42:39 -0800 (PST) Received: from xi.terra (c-beaee455.07-184-6d6c6d4.bbcust.telenor.se. [85.228.174.190]) by smtp.gmail.com with ESMTPSA id x23sm15253lfa.219.2020.12.01.09.42.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 09:42:38 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.93.0.4) (envelope-from ) id 1kk9gC-0004r0-5v; Tue, 01 Dec 2020 18:43:08 +0100 Date: Tue, 1 Dec 2020 18:43:08 +0100 From: Johan Hovold To: Andy Shevchenko Cc: Johan Hovold , Greg Kroah-Hartman , Jiri Slaby , "Mychaela N . Falconia" , "open list:SERIAL DRIVERS" , USB , Linux Kernel Mailing List Subject: Re: [PATCH 2/5] serial: core: add sysfs attribute to suppress ready signalling on open Message-ID: References: <20201130153742.9163-1-johan@kernel.org> <20201130153742.9163-3-johan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 01, 2020 at 03:49:19PM +0200, Andy Shevchenko wrote: > On Tue, Dec 1, 2020 at 3:21 PM Johan Hovold wrote: > > On Tue, Dec 01, 2020 at 01:19:30PM +0200, Andy Shevchenko wrote: > > > On Tue, Dec 1, 2020 at 1:04 PM Johan Hovold wrote: > > ... > > > > > 0x01 is 1 and is generally treated as boolean true as you know. > > > > > > Depends how you interpret this. kstrtobool() uses one character (and > > > in some cases two) of the input. Everything else is garbage. > > > Should we interpret garbage? > > > > No, ideally we should reject the input. > > We can do it by the way in kstrtobool() and see if anybody complains > (I believe the world is saner than relying on 0x01 for false and 123 > for true. I bet someone is using "YEAH!" just because they can. ;) > ... > > > > > So why should a sysfs-interface accept it as valid input and treat it as > > > > false? That's just bad design. > > > > > > I can agree with this. > > > > Looks like part of the problem are commits like 4cc7ecb7f2a6 ("param: > > convert some "on"/"off" users to strtobool") which destroyed perfectly > > well-defined interfaces. > > Oh, but the strtobool() in ABI was before that, for instance > % git grep -n -p -w strtobool v3.14 > shows a few dozens of users and some of them looks like ABI. Indeed, it apparently goes further back than strtobool(). The series introducing strtobool() explicitly mentions the lax parsing and for that reason wanted to keep it distinct from the other kstrto* function by dropping the k-prefix: The naming is still distinct enough from kstrtox to avoid any implication that this function has the same tight parameter passing that those functions have. https://lore.kernel.org/lkml/1303213427-12798-1-git-send-email-jic23@cam.ac.uk/#t And it was more recently renamed kstrtobool() anyway. Let's call it a feature then. Johan