lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 15 Mar 2008 13:39:20 +0100
From:	Ingo Oeser <ingo.oeser@...eria.de>
To:	john stultz <johnstul@...ibm.com>
Cc:	lkml <linux-kernel@...r.kernel.org>,
	Roman Zippel <zippel@...ux-m68k.org>,
	Ingo Molnar <mingo@...e.hu>
Subject: Re: [PATCH 4/5]  ntp.c code flow clenaups  (from Ingo)

Hi John,

On Saturday 15 March 2008, john stultz wrote:
> Index: linux-2.6/kernel/time/ntp.c
> ===================================================================
> --- linux-2.6.orig/kernel/time/ntp.c	2008-03-14 20:10:41.000000000 -0700
> +++ linux-2.6/kernel/time/ntp.c	2008-03-14 20:43:48.000000000 -0700
> @@ -275,6 +275,87 @@ static void notify_cmos_timer(void)
>  static inline void notify_cmos_timer(void) { }
>  #endif
>  
> +static inline void process_adjtimex_adj_offset(struct timex *txc, long sec)
> +{
> +	if (txc->modes & ADJ_STATUS) {
> +		if ((time_status & STA_PLL) && !(txc->status & STA_PLL)) {
> +			time_state = TIME_OK;
> +			time_status = STA_UNSYNC;
> +		}
> +		/* only set allowed bits */
> +		time_status &= STA_RONLY;
> +		time_status |= txc->status & ~STA_RONLY;
> +
> +		switch (time_state) {
> +		case TIME_OK:
> +		start_timer:
> +			if (time_status & STA_INS) {
> +				time_state = TIME_INS;
> +				sec += 86400 - sec % 86400;
> +				hrtimer_start(&leap_timer, ktime_set(sec, 0), HRTIMER_MODE_ABS);
> +			} else if (time_status & STA_DEL) {
> +				time_state = TIME_DEL;
> +				sec += 86400 - (sec + 1) % 86400;
> +				hrtimer_start(&leap_timer, ktime_set(sec, 0), HRTIMER_MODE_ABS);
> +			}
> +			break;
> +		case TIME_INS:
> +		case TIME_DEL:
> +			time_state = TIME_OK;
> +			goto start_timer;
> +			break;

I don't understand, why the goto is required here. 

If you move these two cases in front of case "TIME_OK" and
omit the break, you can remove the goto and the label "start_timer".
Don't forget the /* fall through */ comment then.

If you want to keep this patch a simple code movement,
maybe add a later patch to improve this on top of it.


Best Regards

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ