lkml.org 
[lkml]   [2005]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 1/6] RTC subsystem, class
Alessandro Zummo wrote:
> > > +static const unsigned char rtc_days_in_month[] = {
> > > + 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
> > > +};
> > > +EXPORT_SYMBOL(rtc_days_in_month);
> >
> > exporting static symbols is pretty wrong. Exporting tables is pretty
> > bad style aswell.
>
> Tables like this one are often used in rtc drivers. What
> can I use instead?

Why not just provide a macro in a .h file? Something like:

/* Days in month -- month is in the range (0..11), no leap year */
#define rtc_days_in_month(mon) (28 + ((0xEEFBB3 >> ((mon) * 2)) & 3))

-Mitch
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-12-21 02:53    [W:0.043 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site