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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 22 Oct 2007 21:54:24 +0200
From:	Adrian Bunk <bunk@...nel.org>
To:	Mauro Carvalho Chehab <mchehab@...radead.org>
Cc:	Patrick Boettcher <patrick.boettcher@...y.de>,
	v4l-dvb maintainer list <v4l-dvb-maintainer@...uxtv.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [v4l-dvb-maintainer] DVB: BANDWIDTH_TO_KHZ strangeness

On Mon, Oct 22, 2007 at 04:29:36PM -0200, Mauro Carvalho Chehab wrote:
> 
> > I know that in the future the linux-dvb-API will also support other 
> > bandwidths so I'm begging for mercy for those 3 things here to not get too 
> > much out-of-sync with our internal code.
> 
> I don't see much problem on keeping this for a while. 
> 
> However, if not causing to much troubles for you to manage, I would to
> this, instead:
> #if 0
> 	/* Currently, DVB API allows only bandwidths starting from 5 GHz */
>         factor = BANDWIDTH_TO_KHZ(ch->u.ofdm.bandwidth);
>         if (factor >= 5000)
>                 factor = 1;
>         else
>                 factor = 6;
> #else
> 	factor = 6;
> #endif
> 
> With the above code, gentree.pl scripts will automatically remove the
> dead code from the Kernel, while keeping it defined at the development
> environment.
>...

Good compilers like gcc generate the same code for both cases [1], so 
there's no reason for changing anything.

The reason for my email was that it looked strange, but since it's 
intended I'd say it's OK.

> Cheers,
> Mauro

cu
Adrian

[1] except that your #else case contains the wrong value  ;-)

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

-
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