Kernel Newbies archive on lore.kernel.org
 help / Atom feed
* drivers/char/efirtc.c - efi_rtc_open\ efi_rtc_close
@ 2019-01-21 10:10 Muni Sekhar
  2019-01-21 10:28 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Muni Sekhar @ 2019-01-21 10:10 UTC (permalink / raw)
  To: kernelnewbies; +Cc: Greg KH, arnd

[-- Attachment #1.1: Type: text/plain, Size: 526 bytes --]

Hello All,

The drivers/char/efirtc.c file has ‘struct file_operations.open’ & ‘struct
file_operations.close’ functions efi_rtc_open()\ efi_rtc_close() does
nothing, just returns ‘0’.

So it accept multiple open files at the same time. If we don’t define these
empty function, still driver accepts multiple open() calls at the same
time, right?

If so I’d like to know what is the advantage of keeping these function
which does nothing instead of removing it from driver?


-- 
Thanks,
Sekhar

[-- Attachment #1.2: Type: text/html, Size: 805 bytes --]

<div dir="ltr"><div>Hello All,</div><div> </div><div>The drivers/char/efirtc.c file has ‘struct file_operations.open’ &amp; ‘struct file_operations.close’ functions efi_rtc_open()\ efi_rtc_close() does nothing, just returns ‘0’.</div><div> </div><div>So it accept multiple open files at the same time. If we don’t define these empty function, still driver accepts multiple open() calls at the same time, right?</div><div> </div><div>If so I’d like to know what is the advantage of keeping these function which does nothing instead of removing it from driver?<span class="sew7lhpcmn90mfz"></span><span class="sew7lhpcmn90mfz"></span></div><br clear="all"><br>-- <br><div class="gmail_signature" dir="ltr" data-smartmail="gmail_signature"><div>Thanks,</div><div>Sekhar</div></div></div>

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: drivers/char/efirtc.c - efi_rtc_open\ efi_rtc_close
  2019-01-21 10:10 drivers/char/efirtc.c - efi_rtc_open\ efi_rtc_close Muni Sekhar
@ 2019-01-21 10:28 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2019-01-21 10:28 UTC (permalink / raw)
  To: Muni Sekhar; +Cc: arnd, kernelnewbies

On Mon, Jan 21, 2019 at 03:40:31PM +0530, Muni Sekhar wrote:
> Hello All,
> 
> The drivers/char/efirtc.c file has ‘struct file_operations.open’ & ‘struct
> file_operations.close’ functions efi_rtc_open()\ efi_rtc_close() does
> nothing, just returns ‘0’.
> 
> So it accept multiple open files at the same time. If we don’t define these
> empty function, still driver accepts multiple open() calls at the same
> time, right?
> 
> If so I’d like to know what is the advantage of keeping these function
> which does nothing instead of removing it from driver?

There is no advantage at all, those functions can be removed safely, no
need to have them at all.  Care to send a patch for this?

thanks,

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-21 10:10 drivers/char/efirtc.c - efi_rtc_open\ efi_rtc_close Muni Sekhar
2019-01-21 10:28 ` Greg KH

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org kernelnewbies@archiver.kernel.org
	public-inbox-index kernelnewbies


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/ public-inbox