mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
drm/mgag200: Remove P_ARRAY_SIZE
Replace P_ARRAY_SIZE by array pre-initializing and ARRAY_SIZE(). No functional changes. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-4-tzimmermann@suse.de
This commit is contained in:
parent
08a709467c
commit
83c90cdb75
1 changed files with 3 additions and 4 deletions
|
@ -183,17 +183,16 @@ static int mgag200_g200_set_plls(struct mga_device *mdev, long clock)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define P_ARRAY_SIZE 9
|
|
||||||
|
|
||||||
static int mga_g200se_set_plls(struct mga_device *mdev, long clock)
|
static int mga_g200se_set_plls(struct mga_device *mdev, long clock)
|
||||||
{
|
{
|
||||||
|
static const unsigned int pvalues_e4[] = {16, 14, 12, 10, 8, 6, 4, 2, 1};
|
||||||
|
|
||||||
u32 unique_rev_id = mdev->model.g200se.unique_rev_id;
|
u32 unique_rev_id = mdev->model.g200se.unique_rev_id;
|
||||||
unsigned int vcomax, vcomin, pllreffreq;
|
unsigned int vcomax, vcomin, pllreffreq;
|
||||||
unsigned int delta, tmpdelta, permitteddelta;
|
unsigned int delta, tmpdelta, permitteddelta;
|
||||||
unsigned int testp, testm, testn;
|
unsigned int testp, testm, testn;
|
||||||
unsigned int p, m, n;
|
unsigned int p, m, n;
|
||||||
unsigned int computed;
|
unsigned int computed;
|
||||||
unsigned int pvalues_e4[P_ARRAY_SIZE] = {16, 14, 12, 10, 8, 6, 4, 2, 1};
|
|
||||||
unsigned int fvv;
|
unsigned int fvv;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
@ -247,7 +246,7 @@ static int mga_g200se_set_plls(struct mga_device *mdev, long clock)
|
||||||
/* Permited delta is 0.5% as VESA Specification */
|
/* Permited delta is 0.5% as VESA Specification */
|
||||||
permitteddelta = clock * 5 / 1000;
|
permitteddelta = clock * 5 / 1000;
|
||||||
|
|
||||||
for (i = 0 ; i < P_ARRAY_SIZE ; i++) {
|
for (i = 0 ; i < ARRAY_SIZE(pvalues_e4); i++) {
|
||||||
testp = pvalues_e4[i];
|
testp = pvalues_e4[i];
|
||||||
|
|
||||||
if ((clock * testp) > vcomax)
|
if ((clock * testp) > vcomax)
|
||||||
|
|
Loading…
Add table
Reference in a new issue