From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE2C8C433EF for ; Thu, 5 May 2022 12:25:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235012AbiEEM2i (ORCPT ); Thu, 5 May 2022 08:28:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240218AbiEEM2h (ORCPT ); Thu, 5 May 2022 08:28:37 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE1EB55228; Thu, 5 May 2022 05:24:58 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id c9so3534384plh.2; Thu, 05 May 2022 05:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=aqYca05I1CobNL11/ZSAuzkYP3pUA9+44TaUIjQq30E=; b=HlU4f2mdgIGU44zymXGfRAKrheE60x7GHocboHNZBnucHDvCi30LYg8qdMKXH+VE1S 9TqYxAC81WJbZAn/9sW3DGUP/tOSj+ABuQhvOj7ipczBHPMF9x1Xifw9u72TT2nB6/8x 6u4uF5DnbzvfJtFkvZ0R8Kbpz27c3xoAPVfehY3D8fk/N9GKpTAzPniDb32fZl0j91tU qZqwhlKZp05SdRnt2rKR6l2bwOqxD8C9ChT8sOttFeAxNO83LD0/QXo3cNJ/o9guHw6A py3MvonaowbfyTdnEUS+CzbwJVSv9hfKLStfAdD5JOVNIYyYqrFIGIvC5d59eqtaMDWq qkGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aqYca05I1CobNL11/ZSAuzkYP3pUA9+44TaUIjQq30E=; b=MuYgrHT+RZi7EKlFE5r03lgUui5YleREVUyG1kUfAtcB9eyIS1zqZw/srMxA0FCod+ YYtyif+UUCNuBxYlEEg9ShHByqxM6BmGoFnsC2UdzJ5BOySvgnp/Jf/rOIE+nQpDIfA7 Ui0ZFjAO/BUzSOdk1lv+9aexiXEvCcV9sqqckTc6xpahffSQimDRcnVWjZ4vS88ENyWr jLM1aicwGD3YkFLQzvPAIwtr3Xq24TvQQuwHRWLHiubigIianqECCpDg5j2216Iwg3DI AVuEOW6yAUp0aDnfCk7X5X8elTPaM2USYgQTdExoif9NM4WvzYu3vKsqbEoB7gKh4J8B u7XA== X-Gm-Message-State: AOAM532BsCGXY2SDvaahNwMsDn3KOxVUEHdTNbutgGM0EwqWmoWeAkh5 UzEauMF+k0LV6mCSjKulbs4jVfZ4jhk2Rg== X-Google-Smtp-Source: ABdhPJxBCkQ1cAkRLOXaQKmquOvLrvigW73ZlxaRyHHUoVzYwqfQEHbFvnHA6iO/7W/8X+DY6gwJ2g== X-Received: by 2002:a17:902:f70b:b0:14d:643d:9c99 with SMTP id h11-20020a170902f70b00b0014d643d9c99mr27704828plo.18.1651753498148; Thu, 05 May 2022 05:24:58 -0700 (PDT) Received: from sol ([118.209.204.33]) by smtp.gmail.com with ESMTPSA id 6-20020a17090a000600b001cd4989ff44sm1412787pja.11.2022.05.05.05.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 05:24:56 -0700 (PDT) Date: Thu, 5 May 2022 20:24:50 +0800 From: Kent Gibson To: Bartosz Golaszewski Cc: Yihao Han , Linus Walleij , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , kernel@vivo.com Subject: Re: [PATCH] gpiolib: cdev: fix stream_open.cocci warnings Message-ID: <20220505122450.GA23659@sol> References: <20220505115011.3435-1-hanyihao@vivo.com> 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-gpio@vger.kernel.org On Thu, May 05, 2022 at 02:18:48PM +0200, Bartosz Golaszewski wrote: > On Thu, May 5, 2022 at 1:50 PM Yihao Han wrote: > > > > ./drivers/gpio/gpiolib-cdev.c:2498:7-23: WARNING: > > gpio_fileops: .read() has stream semantic; > > safe to change nonseekable_open -> stream_open. > > > > Generated by: scripts/coccinelle/api/stream_open.cocci > > > > Signed-off-by: Yihao Han > > --- > > drivers/gpio/gpiolib-cdev.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c > > index f5aa5f93342a..d03c8e012c8c 100644 > > --- a/drivers/gpio/gpiolib-cdev.c > > +++ b/drivers/gpio/gpiolib-cdev.c > > @@ -2495,7 +2495,7 @@ static int gpio_chrdev_open(struct inode *inode, struct file *file) > > get_device(&gdev->dev); > > file->private_data = cdev; > > > > - ret = nonseekable_open(inode, file); > > + ret = stream_open(inode, file); > > if (ret) > > goto out_unregister_notifier; > > > > -- > > 2.17.1 > > > > Cc'ing Kent. > > This patch doesn't seem to target current master or rc1. > > It also can't be right - we specifically mark all filesystem objects > exposed by the GPIO character device as non-seekable. > Agreed. I took the coccinelle warning as being a false positive. If I recall correctly I had a quick look to see if it could be disabled, but didn't find anything, and so just ignored it. Cheers, Kent.