Message ID | 20220609221702.347522-5-morbo@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Clang -Wformat warning fixes | expand |
On Thu, Jun 09, 2022 at 10:16:23PM +0000, Bill Wendling wrote: > vsnprintf(bdi->dev_name, sizeof(bdi->dev_name), fmt, args); > - dev = device_create(bdi_class, NULL, MKDEV(0, 0), bdi, bdi->dev_name); > + dev = device_create(bdi_class, NULL, MKDEV(0, 0), bdi, "%s", bdi->dev_name); Please avoid the overly long line. But given that bdi names aren't user input this warning seems to shoot from the hip a bit.
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index ff60bd7d74e0..7b7786dceff3 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -877,7 +877,7 @@ int bdi_register_va(struct backing_dev_info *bdi, const char *fmt, va_list args) return 0; vsnprintf(bdi->dev_name, sizeof(bdi->dev_name), fmt, args); - dev = device_create(bdi_class, NULL, MKDEV(0, 0), bdi, bdi->dev_name); + dev = device_create(bdi_class, NULL, MKDEV(0, 0), bdi, "%s", bdi->dev_name); if (IS_ERR(dev)) return PTR_ERR(dev);