All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
	kbuild-all@01.org, Felipe Balbi <balbi@ti.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	target-devel <target-devel@vger.kernel.org>,
	Joel Becker <jlbec@evilplan.org>,
	linux-nvme@lists.infradead.org, Christoph Hellwig <hch@lst.de>,
	"Nicholas A. Bellinger" <nab@linux-iscsi.org>
Subject: Re: [PATCH] usb: gadget: uvc: fix returnvar.cocci warnings
Date: Wed, 23 Nov 2016 09:35:36 +0100	[thread overview]
Message-ID: <3504c280-fe7f-9ec2-0f92-2b6aea290080@samsung.com> (raw)
In-Reply-To: <2122146.rzc0RNY0pB@avalon>

Hi Laurent,

Thanks for a reminder.  Please see inline.

W dniu 22.11.2016 o 18:27, Laurent Pinchart pisze:
> Hi Andrzej and Julia,
>
> Could one of you please submit a patch to fix this ?
>
> On Thursday 17 Sep 2015 13:18:04 Andrzej Pietrasiewicz wrote:
>> Hi Julia,
>>
>> W dniu 17.09.2015 o 10:57, Julia Lawall pisze:
>>> Coccinelle suggests the following patch.  But the code is curious.  Is the
>>> function expected to always return a failure value?

As a matter of fact it seems it should not return anything at all,
because...

>>
>> Thank you for catching this. The function is not expected to always
>> return a failure value. Fortunately it does not matter anyway because

...because
>> the return value of the drop_link() operation is silently ignored by

And the Documentation/filesystems/configfs/configfs.txt says here:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/configfs/configfs.txt#n397

"When unlink(2) is called on the symbolic link, the source item is
notified via the ->drop_link() method.  Like the ->drop_item() method,
this is a void function and cannot return failure."

The ->drop_item() is indeed a void function, the ->drop_link() is
actually not. This, together with the fact that the value of ->drop_link()
is silently ignored suggests, that it is the ->drop_link() return
type that should be corrected and changed to void.

@Joel: What is your opinion? Should return type be changed to void?
Is there any reason why it should still be declared int?

I'm sending a copy of this mail to target-devel and linux-nvme,
because other potentially affected users of configfs live there.

AP

WARNING: multiple messages have this Message-ID (diff)
From: andrzej.p@samsung.com (Andrzej Pietrasiewicz)
Subject: [PATCH] usb: gadget: uvc: fix returnvar.cocci warnings
Date: Wed, 23 Nov 2016 09:35:36 +0100	[thread overview]
Message-ID: <3504c280-fe7f-9ec2-0f92-2b6aea290080@samsung.com> (raw)
In-Reply-To: <2122146.rzc0RNY0pB@avalon>

Hi Laurent,

Thanks for a reminder.  Please see inline.

W dniu 22.11.2016 o 18:27, Laurent Pinchart pisze:
> Hi Andrzej and Julia,
>
> Could one of you please submit a patch to fix this ?
>
> On Thursday 17 Sep 2015 13:18:04 Andrzej Pietrasiewicz wrote:
>> Hi Julia,
>>
>> W dniu 17.09.2015 o 10:57, Julia Lawall pisze:
>>> Coccinelle suggests the following patch.  But the code is curious.  Is the
>>> function expected to always return a failure value?

As a matter of fact it seems it should not return anything at all,
because...

>>
>> Thank you for catching this. The function is not expected to always
>> return a failure value. Fortunately it does not matter anyway because

...because
>> the return value of the drop_link() operation is silently ignored by

And the Documentation/filesystems/configfs/configfs.txt says here:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/configfs/configfs.txt#n397

"When unlink(2) is called on the symbolic link, the source item is
notified via the ->drop_link() method.  Like the ->drop_item() method,
this is a void function and cannot return failure."

The ->drop_item() is indeed a void function, the ->drop_link() is
actually not. This, together with the fact that the value of ->drop_link()
is silently ignored suggests, that it is the ->drop_link() return
type that should be corrected and changed to void.

@Joel: What is your opinion? Should return type be changed to void?
Is there any reason why it should still be declared int?

I'm sending a copy of this mail to target-devel and linux-nvme,
because other potentially affected users of configfs live there.

AP

  reply	other threads:[~2016-11-23  8:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201509170828.xv0cYNA5%fengguang.wu@intel.com>
     [not found] ` <20150917000130.GA25134@lkp-ib04>
2015-09-17  8:57   ` [PATCH] usb: gadget: uvc: fix returnvar.cocci warnings Julia Lawall
2015-09-17 11:18     ` Andrzej Pietrasiewicz
2015-09-17 11:30       ` SF Markus Elfring
2016-11-22 17:27       ` Laurent Pinchart
2016-11-23  8:35         ` Andrzej Pietrasiewicz [this message]
2016-11-23  8:35           ` Andrzej Pietrasiewicz
2016-11-28  8:28           ` Christoph Hellwig
2016-11-28  8:28             ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3504c280-fe7f-9ec2-0f92-2b6aea290080@samsung.com \
    --to=andrzej.p@samsung.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=jlbec@evilplan.org \
    --cc=julia.lawall@lip6.fr \
    --cc=kbuild-all@01.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.