| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2016-2017 Imagination Technologies |
|---|
| 3 | 4 | * Author: Paul Burton <paul.burton@mips.com> |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 6 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 7 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 8 | | - * option) any later version. |
|---|
| 9 | 5 | */ |
|---|
| 10 | 6 | |
|---|
| 11 | 7 | #define pr_fmt(fmt) "clk-boston: " fmt |
|---|
| .. | .. |
|---|
| 62 | 58 | cpu_div = ext_field(mmcmdiv, BOSTON_PLAT_MMCMDIV_CLK1DIV); |
|---|
| 63 | 59 | cpu_freq = mult_frac(in_freq, mul, cpu_div); |
|---|
| 64 | 60 | |
|---|
| 65 | | - onecell = kzalloc(sizeof(*onecell) + |
|---|
| 66 | | - (BOSTON_CLK_COUNT * sizeof(struct clk_hw *)), |
|---|
| 61 | + onecell = kzalloc(struct_size(onecell, hws, BOSTON_CLK_COUNT), |
|---|
| 67 | 62 | GFP_KERNEL); |
|---|
| 68 | 63 | if (!onecell) |
|---|
| 69 | 64 | return; |
|---|