Skip to content

Commit 0854ba5

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
David writes: "Sparc fixes: 1) Minor fallthru comment tweaks from Gustavo A. R. Silva. 2) VLA removal from Kees Cook. 3) Make sparc vdso Makefile match x86, from Masahiro Yamada. 4) Fix clock divider programming in mach64 driver, from Mikulas Patocka." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc: sparc64: fix fall-through annotation sparc32: fix fall-through annotation sparc: vdso: clean-up vdso Makefile oradax: remove redundant null check before kfree sparc64: viohs: Remove VLA usage sbus: Use of_get_child_by_name helper sparc: Convert to using %pOFn instead of device_node.name mach64: detect the dot clock divider correctly on sparc
2 parents 0238df6 + b7dc10b commit 0854ba5

File tree

13 files changed

+78
-82
lines changed

13 files changed

+78
-82
lines changed

arch/sparc/kernel/auxio_64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ static int auxio_probe(struct platform_device *dev)
115115
auxio_devtype = AUXIO_TYPE_SBUS;
116116
size = 1;
117117
} else {
118-
printk("auxio: Unknown parent bus type [%s]\n",
119-
dp->parent->name);
118+
printk("auxio: Unknown parent bus type [%pOFn]\n",
119+
dp->parent);
120120
return -ENODEV;
121121
}
122122
auxio_register = of_ioremap(&dev->resource[0], 0, size, "auxio");

arch/sparc/kernel/kgdb_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
122122
linux_regs->pc = addr;
123123
linux_regs->npc = addr + 4;
124124
}
125-
/* fallthru */
125+
/* fall through */
126126

127127
case 'D':
128128
case 'k':

arch/sparc/kernel/kgdb_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
148148
linux_regs->tpc = addr;
149149
linux_regs->tnpc = addr + 4;
150150
}
151-
/* fallthru */
151+
/* fall through */
152152

153153
case 'D':
154154
case 'k':

arch/sparc/kernel/power.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ static int power_probe(struct platform_device *op)
4141

4242
power_reg = of_ioremap(res, 0, 0x4, "power");
4343

44-
printk(KERN_INFO "%s: Control reg at %llx\n",
45-
op->dev.of_node->name, res->start);
44+
printk(KERN_INFO "%pOFn: Control reg at %llx\n",
45+
op->dev.of_node, res->start);
4646

4747
if (has_button_interrupt(irq, op->dev.of_node)) {
4848
if (request_irq(irq,

arch/sparc/kernel/prom_32.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ static void __init sparc32_path_component(struct device_node *dp, char *tmp_buf)
6868
return;
6969

7070
regs = rprop->value;
71-
sprintf(tmp_buf, "%s@%x,%x",
72-
dp->name,
71+
sprintf(tmp_buf, "%pOFn@%x,%x",
72+
dp,
7373
regs->which_io, regs->phys_addr);
7474
}
7575

@@ -84,8 +84,8 @@ static void __init sbus_path_component(struct device_node *dp, char *tmp_buf)
8484
return;
8585

8686
regs = prop->value;
87-
sprintf(tmp_buf, "%s@%x,%x",
88-
dp->name,
87+
sprintf(tmp_buf, "%pOFn@%x,%x",
88+
dp,
8989
regs->which_io,
9090
regs->phys_addr);
9191
}
@@ -104,13 +104,13 @@ static void __init pci_path_component(struct device_node *dp, char *tmp_buf)
104104
regs = prop->value;
105105
devfn = (regs->phys_hi >> 8) & 0xff;
106106
if (devfn & 0x07) {
107-
sprintf(tmp_buf, "%s@%x,%x",
108-
dp->name,
107+
sprintf(tmp_buf, "%pOFn@%x,%x",
108+
dp,
109109
devfn >> 3,
110110
devfn & 0x07);
111111
} else {
112-
sprintf(tmp_buf, "%s@%x",
113-
dp->name,
112+
sprintf(tmp_buf, "%pOFn@%x",
113+
dp,
114114
devfn >> 3);
115115
}
116116
}
@@ -127,8 +127,8 @@ static void __init ebus_path_component(struct device_node *dp, char *tmp_buf)
127127

128128
regs = prop->value;
129129

130-
sprintf(tmp_buf, "%s@%x,%x",
131-
dp->name,
130+
sprintf(tmp_buf, "%pOFn@%x,%x",
131+
dp,
132132
regs->which_io, regs->phys_addr);
133133
}
134134

@@ -167,8 +167,8 @@ static void __init ambapp_path_component(struct device_node *dp, char *tmp_buf)
167167
return;
168168
device = prop->value;
169169

170-
sprintf(tmp_buf, "%s:%d:%d@%x,%x",
171-
dp->name, *vendor, *device,
170+
sprintf(tmp_buf, "%pOFn:%d:%d@%x,%x",
171+
dp, *vendor, *device,
172172
*intr, reg0);
173173
}
174174

@@ -201,7 +201,7 @@ char * __init build_path_component(struct device_node *dp)
201201
tmp_buf[0] = '\0';
202202
__build_path_component(dp, tmp_buf);
203203
if (tmp_buf[0] == '\0')
204-
strcpy(tmp_buf, dp->name);
204+
snprintf(tmp_buf, sizeof(tmp_buf), "%pOFn", dp);
205205

206206
n = prom_early_alloc(strlen(tmp_buf) + 1);
207207
strcpy(n, tmp_buf);

arch/sparc/kernel/prom_64.c

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf)
8282

8383
regs = rprop->value;
8484
if (!of_node_is_root(dp->parent)) {
85-
sprintf(tmp_buf, "%s@%x,%x",
86-
dp->name,
85+
sprintf(tmp_buf, "%pOFn@%x,%x",
86+
dp,
8787
(unsigned int) (regs->phys_addr >> 32UL),
8888
(unsigned int) (regs->phys_addr & 0xffffffffUL));
8989
return;
@@ -97,17 +97,17 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf)
9797
const char *prefix = (type == 0) ? "m" : "i";
9898

9999
if (low_bits)
100-
sprintf(tmp_buf, "%s@%s%x,%x",
101-
dp->name, prefix,
100+
sprintf(tmp_buf, "%pOFn@%s%x,%x",
101+
dp, prefix,
102102
high_bits, low_bits);
103103
else
104-
sprintf(tmp_buf, "%s@%s%x",
105-
dp->name,
104+
sprintf(tmp_buf, "%pOFn@%s%x",
105+
dp,
106106
prefix,
107107
high_bits);
108108
} else if (type == 12) {
109-
sprintf(tmp_buf, "%s@%x",
110-
dp->name, high_bits);
109+
sprintf(tmp_buf, "%pOFn@%x",
110+
dp, high_bits);
111111
}
112112
}
113113

@@ -122,8 +122,8 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf)
122122

123123
regs = prop->value;
124124
if (!of_node_is_root(dp->parent)) {
125-
sprintf(tmp_buf, "%s@%x,%x",
126-
dp->name,
125+
sprintf(tmp_buf, "%pOFn@%x,%x",
126+
dp,
127127
(unsigned int) (regs->phys_addr >> 32UL),
128128
(unsigned int) (regs->phys_addr & 0xffffffffUL));
129129
return;
@@ -138,8 +138,8 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf)
138138
if (tlb_type >= cheetah)
139139
mask = 0x7fffff;
140140

141-
sprintf(tmp_buf, "%s@%x,%x",
142-
dp->name,
141+
sprintf(tmp_buf, "%pOFn@%x,%x",
142+
dp,
143143
*(u32 *)prop->value,
144144
(unsigned int) (regs->phys_addr & mask));
145145
}
@@ -156,8 +156,8 @@ static void __init sbus_path_component(struct device_node *dp, char *tmp_buf)
156156
return;
157157

158158
regs = prop->value;
159-
sprintf(tmp_buf, "%s@%x,%x",
160-
dp->name,
159+
sprintf(tmp_buf, "%pOFn@%x,%x",
160+
dp,
161161
regs->which_io,
162162
regs->phys_addr);
163163
}
@@ -176,13 +176,13 @@ static void __init pci_path_component(struct device_node *dp, char *tmp_buf)
176176
regs = prop->value;
177177
devfn = (regs->phys_hi >> 8) & 0xff;
178178
if (devfn & 0x07) {
179-
sprintf(tmp_buf, "%s@%x,%x",
180-
dp->name,
179+
sprintf(tmp_buf, "%pOFn@%x,%x",
180+
dp,
181181
devfn >> 3,
182182
devfn & 0x07);
183183
} else {
184-
sprintf(tmp_buf, "%s@%x",
185-
dp->name,
184+
sprintf(tmp_buf, "%pOFn@%x",
185+
dp,
186186
devfn >> 3);
187187
}
188188
}
@@ -203,8 +203,8 @@ static void __init upa_path_component(struct device_node *dp, char *tmp_buf)
203203
if (!prop)
204204
return;
205205

206-
sprintf(tmp_buf, "%s@%x,%x",
207-
dp->name,
206+
sprintf(tmp_buf, "%pOFn@%x,%x",
207+
dp,
208208
*(u32 *) prop->value,
209209
(unsigned int) (regs->phys_addr & 0xffffffffUL));
210210
}
@@ -221,7 +221,7 @@ static void __init vdev_path_component(struct device_node *dp, char *tmp_buf)
221221

222222
regs = prop->value;
223223

224-
sprintf(tmp_buf, "%s@%x", dp->name, *regs);
224+
sprintf(tmp_buf, "%pOFn@%x", dp, *regs);
225225
}
226226

227227
/* "name@addrhi,addrlo" */
@@ -236,8 +236,8 @@ static void __init ebus_path_component(struct device_node *dp, char *tmp_buf)
236236

237237
regs = prop->value;
238238

239-
sprintf(tmp_buf, "%s@%x,%x",
240-
dp->name,
239+
sprintf(tmp_buf, "%pOFn@%x,%x",
240+
dp,
241241
(unsigned int) (regs->phys_addr >> 32UL),
242242
(unsigned int) (regs->phys_addr & 0xffffffffUL));
243243
}
@@ -257,8 +257,8 @@ static void __init i2c_path_component(struct device_node *dp, char *tmp_buf)
257257
/* This actually isn't right... should look at the #address-cells
258258
* property of the i2c bus node etc. etc.
259259
*/
260-
sprintf(tmp_buf, "%s@%x,%x",
261-
dp->name, regs[0], regs[1]);
260+
sprintf(tmp_buf, "%pOFn@%x,%x",
261+
dp, regs[0], regs[1]);
262262
}
263263

264264
/* "name@reg0[,reg1]" */
@@ -274,11 +274,11 @@ static void __init usb_path_component(struct device_node *dp, char *tmp_buf)
274274
regs = prop->value;
275275

276276
if (prop->length == sizeof(u32) || regs[1] == 1) {
277-
sprintf(tmp_buf, "%s@%x",
278-
dp->name, regs[0]);
277+
sprintf(tmp_buf, "%pOFn@%x",
278+
dp, regs[0]);
279279
} else {
280-
sprintf(tmp_buf, "%s@%x,%x",
281-
dp->name, regs[0], regs[1]);
280+
sprintf(tmp_buf, "%pOFn@%x,%x",
281+
dp, regs[0], regs[1]);
282282
}
283283
}
284284

@@ -295,11 +295,11 @@ static void __init ieee1394_path_component(struct device_node *dp, char *tmp_buf
295295
regs = prop->value;
296296

297297
if (regs[2] || regs[3]) {
298-
sprintf(tmp_buf, "%s@%08x%08x,%04x%08x",
299-
dp->name, regs[0], regs[1], regs[2], regs[3]);
298+
sprintf(tmp_buf, "%pOFn@%08x%08x,%04x%08x",
299+
dp, regs[0], regs[1], regs[2], regs[3]);
300300
} else {
301-
sprintf(tmp_buf, "%s@%08x%08x",
302-
dp->name, regs[0], regs[1]);
301+
sprintf(tmp_buf, "%pOFn@%08x%08x",
302+
dp, regs[0], regs[1]);
303303
}
304304
}
305305

@@ -361,7 +361,7 @@ char * __init build_path_component(struct device_node *dp)
361361
tmp_buf[0] = '\0';
362362
__build_path_component(dp, tmp_buf);
363363
if (tmp_buf[0] == '\0')
364-
strcpy(tmp_buf, dp->name);
364+
snprintf(tmp_buf, sizeof(tmp_buf), "%pOFn", dp);
365365

366366
n = prom_early_alloc(strlen(tmp_buf) + 1);
367367
strcpy(n, tmp_buf);

arch/sparc/kernel/viohs.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,17 @@ static int send_dreg(struct vio_driver_state *vio)
180180
struct vio_dring_register pkt;
181181
char all[sizeof(struct vio_dring_register) +
182182
(sizeof(struct ldc_trans_cookie) *
183-
dr->ncookies)];
183+
VIO_MAX_RING_COOKIES)];
184184
} u;
185+
size_t bytes = sizeof(struct vio_dring_register) +
186+
(sizeof(struct ldc_trans_cookie) *
187+
dr->ncookies);
185188
int i;
186189

187-
memset(&u, 0, sizeof(u));
190+
if (WARN_ON(bytes > sizeof(u)))
191+
return -EINVAL;
192+
193+
memset(&u, 0, bytes);
188194
init_tag(&u.pkt.tag, VIO_TYPE_CTRL, VIO_SUBTYPE_INFO, VIO_DRING_REG);
189195
u.pkt.dring_ident = 0;
190196
u.pkt.num_descr = dr->num_entries;
@@ -206,7 +212,7 @@ static int send_dreg(struct vio_driver_state *vio)
206212
(unsigned long long) u.pkt.cookies[i].cookie_size);
207213
}
208214

209-
return send_ctrl(vio, &u.pkt.tag, sizeof(u));
215+
return send_ctrl(vio, &u.pkt.tag, bytes);
210216
}
211217

212218
static int send_rdx(struct vio_driver_state *vio)

arch/sparc/vdso/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,21 @@ obj-y += $(vdso_img_objs)
3131
targets += $(vdso_img_cfiles)
3232
targets += $(vdso_img_sodbg) $(vdso_img-y:%=vdso%.so)
3333

34-
export CPPFLAGS_vdso.lds += -P -C
34+
CPPFLAGS_vdso.lds += -P -C
3535

3636
VDSO_LDFLAGS_vdso.lds = -m64 -Wl,-soname=linux-vdso.so.1 \
3737
-Wl,--no-undefined \
3838
-Wl,-z,max-page-size=8192 -Wl,-z,common-page-size=8192 \
3939
$(DISABLE_LTO)
4040

41-
$(obj)/vdso64.so.dbg: $(src)/vdso.lds $(vobjs) FORCE
41+
$(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE
4242
$(call if_changed,vdso)
4343

4444
HOST_EXTRACFLAGS += -I$(srctree)/tools/include
4545
hostprogs-y += vdso2c
4646

4747
quiet_cmd_vdso2c = VDSO2C $@
48-
define cmd_vdso2c
49-
$(obj)/vdso2c $< $(<:%.dbg=%) $@
50-
endef
48+
cmd_vdso2c = $(obj)/vdso2c $< $(<:%.dbg=%) $@
5149

5250
$(obj)/vdso-image-%.c: $(obj)/vdso%.so.dbg $(obj)/vdso%.so $(obj)/vdso2c FORCE
5351
$(call if_changed,vdso2c)

drivers/sbus/char/openprom.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -715,22 +715,13 @@ static struct miscdevice openprom_dev = {
715715

716716
static int __init openprom_init(void)
717717
{
718-
struct device_node *dp;
719718
int err;
720719

721720
err = misc_register(&openprom_dev);
722721
if (err)
723722
return err;
724723

725-
dp = of_find_node_by_path("/");
726-
dp = dp->child;
727-
while (dp) {
728-
if (!strcmp(dp->name, "options"))
729-
break;
730-
dp = dp->sibling;
731-
}
732-
options_node = dp;
733-
724+
options_node = of_get_child_by_name(of_find_node_by_path("/"), "options");
734725
if (!options_node) {
735726
misc_deregister(&openprom_dev);
736727
return -EIO;

drivers/sbus/char/oradax.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,7 @@ static int dax_open(struct inode *inode, struct file *f)
689689
alloc_error:
690690
kfree(ctx->ccb_buf);
691691
done:
692-
if (ctx != NULL)
693-
kfree(ctx);
692+
kfree(ctx);
694693
return -ENOMEM;
695694
}
696695

drivers/video/fbdev/aty/atyfb.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ extern const struct aty_pll_ops aty_pll_ct; /* Integrated */
333333
extern void aty_set_pll_ct(const struct fb_info *info, const union aty_pll *pll);
334334
extern u8 aty_ld_pll_ct(int offset, const struct atyfb_par *par);
335335

336+
extern const u8 aty_postdividers[8];
337+
336338

337339
/*
338340
* Hardware cursor support
@@ -359,7 +361,6 @@ static inline void wait_for_idle(struct atyfb_par *par)
359361

360362
extern void aty_reset_engine(const struct atyfb_par *par);
361363
extern void aty_init_engine(struct atyfb_par *par, struct fb_info *info);
362-
extern u8 aty_ld_pll_ct(int offset, const struct atyfb_par *par);
363364

364365
void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
365366
void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);

0 commit comments

Comments
 (0)