Prev: Exposing TSC "reliability" to userland
Next: Add a bootparameter to reserve high linear address space.
From: Andrew Morton on 4 May 2010 19:30 On Mon, 3 May 2010 11:45:57 -0400 Alexandre Bounine <alexandre.bounine(a)idt.com> wrote: > +static int > +idtcps_set_domain(struct rio_mport *mport, u16 destid, u8 hopcount, > + u8 sw_domain) > +{ > + /* > + * Switch domain configuration operates only at global level > + */ > + rio_mport_write_config_32(mport, destid, hopcount, > + IDTCPS_RIO_DOMAIN, (u32)sw_domain); > + return 0; > +} > + > +static int > +idtcps_get_domain(struct rio_mport *mport, u16 destid, u8 hopcount, > + u8 *sw_domain) > +{ > + u32 regval; > + > + /* > + * Switch domain configuration operates only at global level > + */ > + rio_mport_read_config_32(mport, destid, hopcount, > + IDTCPS_RIO_DOMAIN, ®val); > + > + *sw_domain = (u8)(regval & 0xff); > + > + return 0; > +} This ignores the return values from rio_mport_write_config_*(). AFACIT these things always return hard-wired 0 anyway. Perhaps we should give up and change ->cread() and friends to return void. That beats the alternative of adding lots of untestable test-n-return unwinding code. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Bounine, Alexandre on 5 May 2010 08:30
On Tuesday, May 04, 2010 7:25 PM Andrew Morton [mailto:akpm(a)linux-foundation.org] wrote: > > On Mon, 3 May 2010 11:45:57 -0400 > Alexandre Bounine <alexandre.bounine(a)idt.com> wrote: > > > +static int > > +idtcps_set_domain(struct rio_mport *mport, u16 destid, u8 hopcount, > > + u8 sw_domain) > > +{ > > + /* > > + * Switch domain configuration operates only at global level > > + */ > > + rio_mport_write_config_32(mport, destid, hopcount, > > + IDTCPS_RIO_DOMAIN, (u32)sw_domain); > > + return 0; > > +} > > + > > +static int > > +idtcps_get_domain(struct rio_mport *mport, u16 destid, u8 hopcount, > > + u8 *sw_domain) > > +{ > > + u32 regval; > > + > > + /* > > + * Switch domain configuration operates only at global level > > + */ > > + rio_mport_read_config_32(mport, destid, hopcount, > > + IDTCPS_RIO_DOMAIN, ®val); > > + > > + *sw_domain = (u8)(regval & 0xff); > > + > > + return 0; > > +} > > This ignores the return values from rio_mport_write_config_*(). > > AFACIT these things always return hard-wired 0 anyway. Perhaps we > should give up and change ->cread() and friends to return void. That > beats the alternative of adding lots of untestable test-n-return > unwinding code. We are planning to address this by properly handling return values of these functions. This is work in progress and we may see it published later (for entire RapidIO subsystem). At this moment I simply follow established trend. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |