Skip to content

Commit df7b9b4

Browse files
committed
Merge tag 'm68knommu-for-v6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu
Pull m68knommu updates from Greg Ungerer: - use new gpio line value settings - use strscpy() more * tag 'm68knommu-for-v6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68k: Replace memcpy() + manual NUL-termination with strscpy() m68k/kernel: replace strncpy() with strscpy() m68k: coldfire: gpio: use new line value setter callbacks
2 parents d00a834 + eb43efd commit df7b9b4

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

arch/m68k/coldfire/gpio.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,12 @@ static int mcfgpio_direction_output(struct gpio_chip *chip, unsigned offset,
123123
return __mcfgpio_direction_output(offset, value);
124124
}
125125

126-
static void mcfgpio_set_value(struct gpio_chip *chip, unsigned offset,
127-
int value)
126+
static int mcfgpio_set_value(struct gpio_chip *chip, unsigned int offset,
127+
int value)
128128
{
129129
__mcfgpio_set_value(offset, value);
130+
131+
return 0;
130132
}
131133

132134
static int mcfgpio_request(struct gpio_chip *chip, unsigned offset)
@@ -158,7 +160,7 @@ static struct gpio_chip mcfgpio_chip = {
158160
.direction_input = mcfgpio_direction_input,
159161
.direction_output = mcfgpio_direction_output,
160162
.get = mcfgpio_get_value,
161-
.set = mcfgpio_set_value,
163+
.set_rv = mcfgpio_set_value,
162164
.to_irq = mcfgpio_to_irq,
163165
.base = 0,
164166
.ngpio = MCFGPIO_PIN_MAX,

arch/m68k/kernel/setup_no.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ void __init setup_arch(char **cmdline_p)
145145

146146
/* Keep a copy of command line */
147147
*cmdline_p = &command_line[0];
148-
memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
149-
boot_command_line[COMMAND_LINE_SIZE-1] = 0;
148+
strscpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
150149

151150
/*
152151
* Give all the memory to the bootmap allocator, tell it to put the

arch/m68k/kernel/uboot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static void __init parse_uboot_commandline(char *commandp, int size)
7373
uboot_cmd_end = sp[5];
7474

7575
if (uboot_cmd_start && uboot_cmd_end)
76-
strncpy(commandp, (const char *)uboot_cmd_start, size);
76+
strscpy(commandp, (const char *)uboot_cmd_start, size);
7777

7878
#if defined(CONFIG_BLK_DEV_INITRD)
7979
uboot_initrd_start = sp[2];

0 commit comments

Comments
 (0)