All of lore.kernel.org
 help / color / mirror / Atom feed
* For help, whether to check the return value of sata_scr_read should be added in sata_print_link_status
@ 2018-06-04  3:32 Nixiaoming
  0 siblings, 0 replies; only message in thread
From: Nixiaoming @ 2018-06-04  3:32 UTC (permalink / raw)
  To: tj; +Cc: linux-ide, linux-kernel

Hello
I have trouble reading the code, I hope you can help guide

The function sata_print_link_status in the file drivers/ata/libata-core.c checks the return value when the function sata_scr_read is called on line 3009, 
but does not check the return value when calling sata_scr_read on line 3011.
Why are two calls handled differently?
Is there any other code logic that guarantees that the 3011 line will not return an exception? 

drivers/ata/libata-core.c :
3005 static void sata_print_link_status(struct ata_link *link)
3006 {
3007     u32 sstatus, scontrol, tmp;
3008
3009     if (sata_scr_read(link, SCR_STATUS, &sstatus))
3010         return;
3011     sata_scr_read(link, SCR_CONTROL, &scontrol);
3012
3013     if (ata_phys_link_online(link)) {

Thanks

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-06-04  3:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-04  3:32 For help, whether to check the return value of sata_scr_read should be added in sata_print_link_status Nixiaoming

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.