Skip to content

Commit f90133b

Browse files
pinchartlhverkuil
authored andcommitted
media: ccs-pll: Make variables const where appropriate
Many functions operate on data structures that are read only, both in the implementation and by design. Mark them as const to increase readability and avoid future mistakes. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent c0c1a6b commit f90133b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/media/i2c/ccs-pll.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ static const char *pll_string(unsigned int which)
7575

7676
#define PLL_FL(f) CCS_PLL_FLAG_##f
7777

78-
static void print_pll(struct device *dev, struct ccs_pll *pll)
78+
static void print_pll(struct device *dev, const struct ccs_pll *pll)
7979
{
8080
const struct {
81-
struct ccs_pll_branch_fr *fr;
82-
struct ccs_pll_branch_bk *bk;
81+
const struct ccs_pll_branch_fr *fr;
82+
const struct ccs_pll_branch_bk *bk;
8383
unsigned int which;
8484
} branches[] = {
8585
{ &pll->vt_fr, &pll->vt_bk, PLL_VT },
@@ -150,10 +150,10 @@ static u32 op_pix_ddr(u32 flags)
150150

151151
static int check_fr_bounds(struct device *dev,
152152
const struct ccs_pll_limits *lim,
153-
struct ccs_pll *pll, unsigned int which)
153+
const struct ccs_pll *pll, unsigned int which)
154154
{
155155
const struct ccs_pll_branch_limits_fr *lim_fr;
156-
struct ccs_pll_branch_fr *pll_fr;
156+
const struct ccs_pll_branch_fr *pll_fr;
157157
const char *s = pll_string(which);
158158
int rval;
159159

@@ -190,10 +190,10 @@ static int check_fr_bounds(struct device *dev,
190190

191191
static int check_bk_bounds(struct device *dev,
192192
const struct ccs_pll_limits *lim,
193-
struct ccs_pll *pll, unsigned int which)
193+
const struct ccs_pll *pll, unsigned int which)
194194
{
195195
const struct ccs_pll_branch_limits_bk *lim_bk;
196-
struct ccs_pll_branch_bk *pll_bk;
196+
const struct ccs_pll_branch_bk *pll_bk;
197197
const char *s = pll_string(which);
198198
int rval;
199199

@@ -230,7 +230,7 @@ static int check_bk_bounds(struct device *dev,
230230
return rval;
231231
}
232232

233-
static int check_ext_bounds(struct device *dev, struct ccs_pll *pll)
233+
static int check_ext_bounds(struct device *dev, const struct ccs_pll *pll)
234234
{
235235
if (!(pll->flags & CCS_PLL_FLAG_FIFO_DERATING) &&
236236
pll->pixel_rate_pixel_array > pll->pixel_rate_csi) {

0 commit comments

Comments
 (0)