Ander Juaristi <a...@juaristi.eus> wrote:
> +++ b/net/netfilter/nft_meta.c
> @@ -28,6 +28,27 @@
>  
>  static DEFINE_PER_CPU(struct rnd_state, nft_prandom_state);
>  
> +static u8 nft_meta_weekday(unsigned long secs)
> +{
> +     u8 wday;
> +     unsigned int dse;
> +
> +     secs -= 60 * sys_tz.tz_minuteswest;
> +     dse = secs / 86400;

This will probably fail to compile (link) on 32bit arches.
You need to use do_div() here.

> +     wday = (4 + dse) % 7;

This is fine, as this only involves 32bit integers.

Reply via email to