lkml.org 
[lkml]   [2008]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Misuse of sizeof
IMO there's a bug in the use of sizeof in /arch/x86/boot/main.c, it's
also a strange style.
From 473bf306f25b05b1516164cbbf7bd0831133275a Mon Sep 17 00:00:00 2001
From: MisterIO <mrio@debian-hell.inferis.org>
Date: Sat, 13 Dec 2008 17:19:27 +0100
Subject: [PATCH] misuse of sizeof

---
arch/x86/boot/main.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/boot/main.c b/arch/x86/boot/main.c
index 197421d..ecd87cf 100644
--- a/arch/x86/boot/main.c
+++ b/arch/x86/boot/main.c
@@ -34,8 +34,8 @@ static void copy_boot_params(void)
const struct old_cmdline * const oldcmd =
(const struct old_cmdline *)OLD_CL_ADDRESS;

- BUILD_BUG_ON(sizeof boot_params != 4096);
- memcpy(&boot_params.hdr, &hdr, sizeof hdr);
+ BUILD_BUG_ON(sizeof(boot_params) != 4096);
+ memcpy(&boot_params.hdr, &hdr, sizeof(hdr));

if (!boot_params.hdr.cmd_line_ptr &&
oldcmd->cl_magic == OLD_CL_MAGIC) {
--
1.6.0.4
\
 
 \ /
  Last update: 2008-12-13 17:33    [W:0.060 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site