Skip to content

Commit 3086467

Browse files
Dejin ZhengpH5
authored andcommitted
reset: intel: fix a compile warning about REG_OFFSET redefined
kernel test robot reports a compile warning about REG_OFFSET redefined in the reset-intel-gw.c after merging commit e44ab4e ("regmap: Simplify implementation of the regmap_read_poll_timeout() macro"). the warning is like that: drivers/reset/reset-intel-gw.c:18:0: warning: "REG_OFFSET" redefined #define REG_OFFSET GENMASK(31, 16) In file included from ./arch/arm/mach-ixp4xx/include/mach/hardware.h:30:0, from ./arch/arm/mach-ixp4xx/include/mach/io.h:15, from ./arch/arm/include/asm/io.h:198, from ./include/linux/io.h:13, from ./include/linux/iopoll.h:14, from ./include/linux/regmap.h:20, from drivers/reset/reset-intel-gw.c:12: ./arch/arm/mach-ixp4xx/include/mach/platform.h:25:0: note: this is the location of the previous definition #define REG_OFFSET 3 Reported-by: kernel test robot <[email protected]> Fixes: c9aef21 ("reset: intel: Add system reset controller driver") Signed-off-by: Dejin Zheng <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Philipp Zabel <[email protected]>
1 parent 3b9164c commit 3086467

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

drivers/reset/reset-intel-gw.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
#define RCU_RST_STAT 0x0024
1616
#define RCU_RST_REQ 0x0048
1717

18-
#define REG_OFFSET GENMASK(31, 16)
19-
#define BIT_OFFSET GENMASK(15, 8)
20-
#define STAT_BIT_OFFSET GENMASK(7, 0)
18+
#define REG_OFFSET_MASK GENMASK(31, 16)
19+
#define BIT_OFFSET_MASK GENMASK(15, 8)
20+
#define STAT_BIT_OFFSET_MASK GENMASK(7, 0)
2121

2222
#define to_reset_data(x) container_of(x, struct intel_reset_data, rcdev)
2323

@@ -51,11 +51,11 @@ static u32 id_to_reg_and_bit_offsets(struct intel_reset_data *data,
5151
unsigned long id, u32 *rst_req,
5252
u32 *req_bit, u32 *stat_bit)
5353
{
54-
*rst_req = FIELD_GET(REG_OFFSET, id);
55-
*req_bit = FIELD_GET(BIT_OFFSET, id);
54+
*rst_req = FIELD_GET(REG_OFFSET_MASK, id);
55+
*req_bit = FIELD_GET(BIT_OFFSET_MASK, id);
5656

5757
if (data->soc_data->legacy)
58-
*stat_bit = FIELD_GET(STAT_BIT_OFFSET, id);
58+
*stat_bit = FIELD_GET(STAT_BIT_OFFSET_MASK, id);
5959
else
6060
*stat_bit = *req_bit;
6161

@@ -141,14 +141,14 @@ static int intel_reset_xlate(struct reset_controller_dev *rcdev,
141141
if (spec->args[1] > 31)
142142
return -EINVAL;
143143

144-
id = FIELD_PREP(REG_OFFSET, spec->args[0]);
145-
id |= FIELD_PREP(BIT_OFFSET, spec->args[1]);
144+
id = FIELD_PREP(REG_OFFSET_MASK, spec->args[0]);
145+
id |= FIELD_PREP(BIT_OFFSET_MASK, spec->args[1]);
146146

147147
if (data->soc_data->legacy) {
148148
if (spec->args[2] > 31)
149149
return -EINVAL;
150150

151-
id |= FIELD_PREP(STAT_BIT_OFFSET, spec->args[2]);
151+
id |= FIELD_PREP(STAT_BIT_OFFSET_MASK, spec->args[2]);
152152
}
153153

154154
return id;
@@ -210,11 +210,11 @@ static int intel_reset_probe(struct platform_device *pdev)
210210
if (ret)
211211
return ret;
212212

213-
data->reboot_id = FIELD_PREP(REG_OFFSET, rb_id[0]);
214-
data->reboot_id |= FIELD_PREP(BIT_OFFSET, rb_id[1]);
213+
data->reboot_id = FIELD_PREP(REG_OFFSET_MASK, rb_id[0]);
214+
data->reboot_id |= FIELD_PREP(BIT_OFFSET_MASK, rb_id[1]);
215215

216216
if (data->soc_data->legacy)
217-
data->reboot_id |= FIELD_PREP(STAT_BIT_OFFSET, rb_id[2]);
217+
data->reboot_id |= FIELD_PREP(STAT_BIT_OFFSET_MASK, rb_id[2]);
218218

219219
data->restart_nb.notifier_call = intel_reset_restart_handler;
220220
data->restart_nb.priority = 128;

0 commit comments

Comments
 (0)