Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3781186imm; Tue, 29 May 2018 13:36:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZovfxwNzXuUT1UMW2+c07AzoEgBOsgG23UJRvnwXdxAon6qytEo2Mo8ptKqTWI0in2ne42/ X-Received: by 2002:a17:902:369:: with SMTP id 96-v6mr19238779pld.64.1527626191216; Tue, 29 May 2018 13:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527626191; cv=none; d=google.com; s=arc-20160816; b=GuE1sjE2XImqMiY9B2kpvVE9bl1c0vQfnJH7LKhO0RKBP5h5b5eEVlVz4jVylvnRzF IUijwmbL0xQpwQfCyQlPqPnvzwdKP+141mEvj95isGJbBmo3iixVS+TXqdWtYVe8EB/k Lju91bkF16Fk59lQ70foB5JbZc5LmWratnvIobzCgwcgyWc7j645rdMbXWFRO+9gix3W 749G7nj8/lkaIbbuYNMTOzKPVmSqg99b0XtVKhq58wCDFPv0g+ud5CeucXw25eh0fPBX GKYK/FwciFAn5Rw49fu+VyJd98gaPwUWGqSb7nhtRb5HCIXpo6muvPC4UI6wO/5Q3EXs Ykjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=sjqgds4ObEo3/EgIgm54slaDLkIz4GEmY3/Qw77bdfs=; b=VMxlqmoNE+Mq4b+cxaoWd+eDyNEAOoPQvM7sXNXt6uERCmxxToPBMHzgof86MSEEA6 Y8wFRXGNN/8UlheGmCZFUrbtJl4ikOcmWG3Ue6NQ+YGvz18+HR2ZvOUevJipO24+HgGJ 8EBk4PZkTFz6tGii08W/laR0VLpIpZxHBlSMTN5jYzVhwHr0fy7N6up4szJ8YtmMqZGU JZfU3uUjFWzPxLXEITe55B7ul6+0r2fzTOzTGxelWBuYEWH/z9oQ+WmmXVANa6/R89gv JIXZ1D8whbB4hCYWm5KEwavef2JlX3YkdC7An3yll6at/Wci752aUn6T2EgY/eaIzT9E Z6fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OmkLa5jF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u10-v6si5655343plz.153.2018.05.29.13.36.16; Tue, 29 May 2018 13:36:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OmkLa5jF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966789AbeE2UfS (ORCPT + 99 others); Tue, 29 May 2018 16:35:18 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:43748 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966480AbeE2UfP (ORCPT ); Tue, 29 May 2018 16:35:15 -0400 Received: by mail-qk0-f195.google.com with SMTP id h19-v6so12613962qkj.10; Tue, 29 May 2018 13:35:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sjqgds4ObEo3/EgIgm54slaDLkIz4GEmY3/Qw77bdfs=; b=OmkLa5jFiJKdPIh1MYZwrs6iPyPKC0jtZKAhq7HR/P0pu6uLZMb7me/TXGRAHG7lY8 KdS7rSVVKFNgaU6zp4iU4FBbaWeST8q6Q+rCaNAdL48ijE8u0aXGq0UJU0hz20jC45RN yZGntsJVxAYjx6EixY40ZZqLn5X+uItHaQ+fLoFLA2qDmyoKmTN1CZ0ZzwBUev69VMws I35Tsu10nEQCz279vBKgJfEjcZ0ePXh1y2+YBuk7bjrQVp+Jhi2Wmb/TbNy4cDTQDp66 6UpHUKFOXw+T6pvR/Brgo9MHJVstr2Fj90U2GxxvJ300x/GC40HpghAGK0GJEA5qdBHd gZdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sjqgds4ObEo3/EgIgm54slaDLkIz4GEmY3/Qw77bdfs=; b=DeXTDSZJPBEqGJVTg2b7ph8kEZB1mS+9UBLnTUO0d/HU2iUm9CukVcvzIad2gtaZiJ YEsVu+tyK/9PRBT5iWq7gjJ+EtycpkrJsbc6IGCTtOqIVNqyZXeuHTqHGwvWczH5toaK bbZ5woB2jHufe5ijlFLB2EesiePb+FAmlTJkom5IW+ssVe68xXF0t6ICtBpKbbjlPO7d NyNo3lxoIN3wElHgUq6lga6ahwK2PMv1rfm3WVcvClGcJyPj+e4/qX3l18AuoTX3s11G eTV5ZKpdcChvn70vypWJOr2wEA6oCYHitwzJqNjNHjgKd38iSEEvYCgtOmKv/7SJrBBz i+ug== X-Gm-Message-State: ALKqPwdSIBE19wgi5gZnNLYoFHLF8sne1bmyvRHAPTi9UgPnhRXQWwKJ Vrj8SCsMBFFcH7yFe3TRcHYtIoA5xadGx3o8suI= X-Received: by 2002:a37:1399:: with SMTP id 25-v6mr15823717qkt.83.1527626114696; Tue, 29 May 2018 13:35:14 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:9896:0:0:0:0:0 with HTTP; Tue, 29 May 2018 13:35:13 -0700 (PDT) In-Reply-To: <20180529131014.18641-8-ricardo.ribalda@gmail.com> References: <20180529131014.18641-1-ricardo.ribalda@gmail.com> <20180529131014.18641-8-ricardo.ribalda@gmail.com> From: Andy Shevchenko Date: Tue, 29 May 2018 23:35:13 +0300 Message-ID: Subject: Re: [PATCH 07/19] serdev: Allows dynamic creation of devices via sysfs To: Ricardo Ribalda Delgado Cc: Linux Kernel Mailing List , "open list:SERIAL DRIVERS" , Rob Herring , Johan Hovold , Greg Kroah-Hartman , Jiri Slaby Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 29, 2018 at 4:10 PM, Ricardo Ribalda Delgado wrote: > Allow creating and deleting devices via sysfs. Devices created will be > matched to serdev drivers via modalias (the string provided by the user) > and deleted via their name. > + int err; > + char *nline; Better to read in reversed order. > + nline = strchr(buf, '\n'); > + if (nline) > + *nline = '\0'; strim() / strstrip() ? > + nline = strchr(buf, '\n'); > + if (nline) > + *nline = '\0'; Ditto. > +static DEVICE_ATTR_IGNORE_LOCKDEP(delete_device, 0200, NULL, > + delete_device_store); Perhaps leave it on one line? -- With Best Regards, Andy Shevchenko