From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [bug report] drm/nouveau/devinit: move simple pll setting routines to devinit
Date: Tue, 10 Jan 2017 23:22:28 +0300 [thread overview]
Message-ID: <20170110202227.GA12656@elgon.mountain> (raw)
Hello Ben Skeggs,
The patch 88524bc06926: "drm/nouveau/devinit: move simple pll setting
routines to devinit" from Mar 5, 2013, leads to the following static
checker warning:
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c:53 nv50_devinit_pll_set()
info: return a literal instead of 'ret'
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c
34 int
35 nv50_devinit_pll_set(struct nvkm_devinit *init, u32 type, u32 freq)
36 {
37 struct nvkm_subdev *subdev = &init->subdev;
38 struct nvkm_device *device = subdev->device;
39 struct nvkm_bios *bios = device->bios;
40 struct nvbios_pll info;
41 int N1, M1, N2, M2, P;
42 int ret;
43
44 ret = nvbios_pll_parse(bios, type, &info);
45 if (ret) {
46 nvkm_error(subdev, "failed to retrieve pll data, %d\n", ret);
47 return ret;
48 }
49
50 ret = nv04_pll_calc(subdev, &info, freq, &N1, &M1, &N2, &M2, &P);
51 if (!ret) {
52 nvkm_error(subdev, "failed pll calculation\n");
53 return ret;
This should probably be a negative error code instead of "ret"?
54 }
55
56 switch (info.type) {
57 case PLL_VPLL0:
58 case PLL_VPLL1:
59 nvkm_wr32(device, info.reg + 0, 0x10000611);
60 nvkm_mask(device, info.reg + 4, 0x00ff00ff, (M1 << 16) | N1);
61 nvkm_mask(device, info.reg + 8, 0x7fff00ff, (P << 28) |
62 (M2 << 16) | N2);
63 break;
64 case PLL_MEMORY:
65 nvkm_mask(device, info.reg + 0, 0x01ff0000,
66 (P << 22) |
67 (info.bias_p << 19) |
68 (P << 16));
69 nvkm_wr32(device, info.reg + 4, (N1 << 8) | M1);
70 break;
71 default:
72 nvkm_mask(device, info.reg + 0, 0x00070000, (P << 16));
73 nvkm_wr32(device, info.reg + 4, (N1 << 8) | M1);
74 break;
75 }
76
77 return 0;
78 }
regards,
dan carpenter
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
reply other threads:[~2017-01-10 20:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170110202227.GA12656@elgon.mountain \
--to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
--cc=bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.