hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/video/fbdev/mmp/core.c
....@@ -1,23 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * linux/drivers/video/mmp/common.c
34 * This driver is a common framework for Marvell Display Controller
45 *
56 * Copyright (C) 2012 Marvell Technology Group Ltd.
67 * Authors: Zhou Zhu <zzhu3@marvell.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License as published by the
10
- * Free Software Foundation; either version 2 of the License, or (at your
11
- * option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful, but WITHOUT
14
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16
- * more details.
17
- *
18
- * You should have received a copy of the GNU General Public License along with
19
- * this program. If not, see <http://www.gnu.org/licenses/>.
20
- *
218 */
229
2310 #include <linux/slab.h>
....@@ -166,13 +153,11 @@
166153 struct mmp_path *mmp_register_path(struct mmp_path_info *info)
167154 {
168155 int i;
169
- size_t size;
170156 struct mmp_path *path = NULL;
171157 struct mmp_panel *panel;
172158
173
- size = sizeof(struct mmp_path)
174
- + sizeof(struct mmp_overlay) * info->overlay_num;
175
- path = kzalloc(size, GFP_KERNEL);
159
+ path = kzalloc(struct_size(path, overlays, info->overlay_num),
160
+ GFP_KERNEL);
176161 if (!path)
177162 return NULL;
178163