Message ID | 20220113100622.12783-3-farbere@amazon.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | edac_align_ptr() bug fix and refactoring | expand |
On Thu, Jan 13, 2022 at 10:06:20AM +0000, Eliav Farber wrote: > Amend commit 7391c6dcab30 ("drivers/edac: mod edac_align_ptr function") > and change all return path to use void* instead of char* according > to the new signature. > > Signed-off-by: Eliav Farber <farbere@amazon.com> > --- > drivers/edac/edac_mc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c > index 61d72bd96754..8b9b86a7720a 100644 > --- a/drivers/edac/edac_mc.c > +++ b/drivers/edac/edac_mc.c > @@ -263,12 +263,12 @@ void *edac_align_ptr(void **p, unsigned size, int n_elems) > else if (size > sizeof(char)) > align = sizeof(short); > else > - return (char *)ptr; > + return ptr; > > r = (unsigned long)ptr % align; > > if (r == 0) > - return (char *)ptr; > + return ptr; > > *p += align - r; > > -- Applied, thanks.
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 61d72bd96754..8b9b86a7720a 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -263,12 +263,12 @@ void *edac_align_ptr(void **p, unsigned size, int n_elems) else if (size > sizeof(char)) align = sizeof(short); else - return (char *)ptr; + return ptr; r = (unsigned long)ptr % align; if (r == 0) - return (char *)ptr; + return ptr; *p += align - r;
Amend commit 7391c6dcab30 ("drivers/edac: mod edac_align_ptr function") and change all return path to use void* instead of char* according to the new signature. Signed-off-by: Eliav Farber <farbere@amazon.com> --- drivers/edac/edac_mc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)